diff --git a/.github/workflows/run_example_scripts.yaml b/.github/workflows/run_example_scripts.yaml index 35ec1def..a14e83e4 100644 --- a/.github/workflows/run_example_scripts.yaml +++ b/.github/workflows/run_example_scripts.yaml @@ -10,7 +10,37 @@ on: jobs: run_examples: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] + + steps: + - name: Checkout code + 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 uv + uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 + + - name: Build the package + run: | + uv build + + - name: Install client with extras + run: | + PACKAGE="dist/$(ls dist | grep whl | head -n 1)[agents]" + uv pip install --system "$PACKAGE" + + examples: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-24.04 + environment: publish strategy: fail-fast: false matrix: @@ -50,7 +80,7 @@ jobs: MISTRAL_API_KEY: ${{ env.MISTRAL_API_KEY }} run_examples_required: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: run_examples if: ${{ always() }} diff --git a/.github/workflows/sdk_generation_mistralai_azure_sdk.yaml b/.github/workflows/sdk_generation_mistralai_azure_sdk.yaml index 7b412a4c..8bfe94db 100644 --- a/.github/workflows/sdk_generation_mistralai_azure_sdk.yaml +++ b/.github/workflows/sdk_generation_mistralai_azure_sdk.yaml @@ -16,7 +16,7 @@ permissions: type: string jobs: resolve-speakeasy-version: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: version: ${{ steps.resolve.outputs.version }} steps: @@ -32,52 +32,79 @@ jobs: echo "Could not resolve speakeasyVersion from .speakeasy/workflow.yaml" exit 1 fi + # Strip optional leading 'v' + VERSION="${VERSION#v}" echo "Resolved Speakeasy version: $VERSION" echo "version=$VERSION" >> "$GITHUB_OUTPUT" generate: 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: ${{ needs.resolve-speakeasy-version.outputs.version }} - target: mistralai-azure-sdk - feature_branch: speakeasy-sdk-regen-${{ github.run_id }} - secrets: - github_access_token: ${{ secrets.CLIENT_PIPELINE }} - pypi_token: ${{ secrets.PYPI_TOKEN }} - speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} + runs-on: ubuntu-24.04 + environment: publish + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + fetch-depth: 0 + token: ${{ secrets.CLIENT_PIPELINE }} + + - name: Install Speakeasy CLI + env: + VERSION: ${{ needs.resolve-speakeasy-version.outputs.version }} + run: | + curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/07977787cc394cb30b418a591b3332e40e209be1/install.sh | sh + speakeasy --version + + - name: Run SDK generation + env: + INPUT_GITHUB_ACCESS_TOKEN: ${{ secrets.CLIENT_PIPELINE }} + SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }} + INPUT_MODE: pr + INPUT_FORCE: ${{ github.event.inputs.force }} + INPUT_TARGET: mistralai-azure-sdk + INPUT_SET_VERSION: ${{ github.event.inputs.set_version }} + INPUT_FEATURE_BRANCH: ${{ format('speakeasy/mistralai-azure-sdk-{0}-{1}', github.run_id, github.run_attempt) }} + INPUT_CLI_ENVIRONMENT_VARIABLES: | + NODE_OPTIONS=--max-old-space-size=4096 + run: speakeasy ci generate align-version: needs: generate - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 + environment: publish steps: - - name: Find PR branch - id: find-pr + - name: Compute expected PR branch + id: branch + run: | + BRANCH="${{ format('speakeasy/mistralai-azure-sdk-{0}-{1}', github.run_id, github.run_attempt) }}" + echo "name=$BRANCH" >> "$GITHUB_OUTPUT" + + - name: Check PR branch exists + id: branch-exists 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" + if git ls-remote --heads "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" "${{ steps.branch.outputs.name }}" | grep -q .; then + echo "exists=true" >> "$GITHUB_OUTPUT" + else + echo "exists=false" >> "$GITHUB_OUTPUT" + echo "Branch not found: ${{ steps.branch.outputs.name }}. Skipping alignment." + fi - name: Checkout PR branch - if: steps.find-pr.outputs.branch != '' + if: steps.branch-exists.outputs.exists == 'true' uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: - ref: ${{ steps.find-pr.outputs.branch }} + ref: ${{ steps.branch.outputs.name }} token: ${{ secrets.CLIENT_PIPELINE }} - name: Install uv - if: steps.find-pr.outputs.branch != '' + if: steps.branch-exists.outputs.exists == 'true' uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 - name: Align version using uv - if: steps.find-pr.outputs.branch != '' + if: steps.branch-exists.outputs.exists == 'true' run: | set -euo pipefail @@ -98,7 +125,7 @@ jobs: uv version "$VERSION" --directory packages/azure - name: Commit and push - if: steps.find-pr.outputs.branch != '' + if: steps.branch-exists.outputs.exists == 'true' run: | git config user.email "action@github.com" git config user.name "GitHub Action" @@ -107,6 +134,6 @@ jobs: 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 commit -m "chore: align 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 5d200ae0..a23105e8 100644 --- a/.github/workflows/sdk_generation_mistralai_gcp_sdk.yaml +++ b/.github/workflows/sdk_generation_mistralai_gcp_sdk.yaml @@ -16,7 +16,7 @@ permissions: type: string jobs: resolve-speakeasy-version: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: version: ${{ steps.resolve.outputs.version }} steps: @@ -32,52 +32,79 @@ jobs: echo "Could not resolve speakeasyVersion from .speakeasy/workflow.yaml" exit 1 fi + # Strip optional leading 'v' + VERSION="${VERSION#v}" echo "Resolved Speakeasy version: $VERSION" echo "version=$VERSION" >> "$GITHUB_OUTPUT" generate: 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: ${{ needs.resolve-speakeasy-version.outputs.version }} - target: mistralai-gcp-sdk - feature_branch: speakeasy-sdk-regen-${{ github.run_id }} - secrets: - github_access_token: ${{ secrets.CLIENT_PIPELINE }} - pypi_token: ${{ secrets.PYPI_TOKEN }} - speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} + runs-on: ubuntu-24.04 + environment: publish + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + fetch-depth: 0 + token: ${{ secrets.CLIENT_PIPELINE }} + + - name: Install Speakeasy CLI + env: + VERSION: ${{ needs.resolve-speakeasy-version.outputs.version }} + run: | + curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/07977787cc394cb30b418a591b3332e40e209be1/install.sh | sh + speakeasy --version + + - name: Run SDK generation + env: + INPUT_GITHUB_ACCESS_TOKEN: ${{ secrets.CLIENT_PIPELINE }} + SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }} + INPUT_MODE: pr + INPUT_FORCE: ${{ github.event.inputs.force }} + INPUT_TARGET: mistralai-gcp-sdk + INPUT_SET_VERSION: ${{ github.event.inputs.set_version }} + INPUT_FEATURE_BRANCH: ${{ format('speakeasy/mistralai-gcp-sdk-{0}-{1}', github.run_id, github.run_attempt) }} + INPUT_CLI_ENVIRONMENT_VARIABLES: | + NODE_OPTIONS=--max-old-space-size=4096 + run: speakeasy ci generate align-version: needs: generate - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 + environment: publish steps: - - name: Find PR branch - id: find-pr + - name: Compute expected PR branch + id: branch + run: | + BRANCH="${{ format('speakeasy/mistralai-gcp-sdk-{0}-{1}', github.run_id, github.run_attempt) }}" + echo "name=$BRANCH" >> "$GITHUB_OUTPUT" + + - name: Check PR branch exists + id: branch-exists 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" + if git ls-remote --heads "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" "${{ steps.branch.outputs.name }}" | grep -q .; then + echo "exists=true" >> "$GITHUB_OUTPUT" + else + echo "exists=false" >> "$GITHUB_OUTPUT" + echo "Branch not found: ${{ steps.branch.outputs.name }}. Skipping alignment." + fi - name: Checkout PR branch - if: steps.find-pr.outputs.branch != '' + if: steps.branch-exists.outputs.exists == 'true' uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: - ref: ${{ steps.find-pr.outputs.branch }} + ref: ${{ steps.branch.outputs.name }} token: ${{ secrets.CLIENT_PIPELINE }} - name: Install uv - if: steps.find-pr.outputs.branch != '' + if: steps.branch-exists.outputs.exists == 'true' uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 - name: Align version using uv - if: steps.find-pr.outputs.branch != '' + if: steps.branch-exists.outputs.exists == 'true' run: | set -euo pipefail @@ -98,7 +125,7 @@ jobs: uv version "$VERSION" --directory packages/gcp - name: Commit and push - if: steps.find-pr.outputs.branch != '' + if: steps.branch-exists.outputs.exists == 'true' run: | git config user.email "action@github.com" git config user.name "GitHub Action" @@ -107,6 +134,6 @@ jobs: 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 commit -m "chore: align 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 251cfdde..50845a3a 100644 --- a/.github/workflows/sdk_generation_mistralai_sdk.yaml +++ b/.github/workflows/sdk_generation_mistralai_sdk.yaml @@ -16,7 +16,7 @@ permissions: type: string jobs: resolve-speakeasy-version: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: version: ${{ steps.resolve.outputs.version }} steps: @@ -32,52 +32,79 @@ jobs: echo "Could not resolve speakeasyVersion from .speakeasy/workflow.yaml" exit 1 fi + # Strip optional leading 'v' + VERSION="${VERSION#v}" echo "Resolved Speakeasy version: $VERSION" echo "version=$VERSION" >> "$GITHUB_OUTPUT" generate: 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: ${{ needs.resolve-speakeasy-version.outputs.version }} - target: mistralai-sdk - feature_branch: speakeasy-sdk-regen-${{ github.run_id }} - secrets: - github_access_token: ${{ secrets.CLIENT_PIPELINE }} - pypi_token: ${{ secrets.PYPI_TOKEN }} - speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} + runs-on: ubuntu-24.04 + environment: publish + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + fetch-depth: 0 + token: ${{ secrets.CLIENT_PIPELINE }} + + - name: Install Speakeasy CLI + env: + VERSION: ${{ needs.resolve-speakeasy-version.outputs.version }} + run: | + curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/07977787cc394cb30b418a591b3332e40e209be1/install.sh | sh + speakeasy --version + + - name: Run SDK generation + env: + INPUT_GITHUB_ACCESS_TOKEN: ${{ secrets.CLIENT_PIPELINE }} + SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }} + INPUT_MODE: pr + INPUT_FORCE: ${{ github.event.inputs.force }} + INPUT_TARGET: mistralai-sdk + INPUT_SET_VERSION: ${{ github.event.inputs.set_version }} + INPUT_FEATURE_BRANCH: ${{ format('speakeasy/mistralai-sdk-{0}-{1}', github.run_id, github.run_attempt) }} + INPUT_CLI_ENVIRONMENT_VARIABLES: | + NODE_OPTIONS=--max-old-space-size=4096 + run: speakeasy ci generate align-version: needs: generate - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 + environment: publish steps: - - name: Find PR branch - id: find-pr + - name: Compute expected PR branch + id: branch + run: | + BRANCH="${{ format('speakeasy/mistralai-sdk-{0}-{1}', github.run_id, github.run_attempt) }}" + echo "name=$BRANCH" >> "$GITHUB_OUTPUT" + + - name: Check PR branch exists + id: branch-exists 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" + if git ls-remote --heads "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" "${{ steps.branch.outputs.name }}" | grep -q .; then + echo "exists=true" >> "$GITHUB_OUTPUT" + else + echo "exists=false" >> "$GITHUB_OUTPUT" + echo "Branch not found: ${{ steps.branch.outputs.name }}. Skipping alignment." + fi - name: Checkout PR branch - if: steps.find-pr.outputs.branch != '' + if: steps.branch-exists.outputs.exists == 'true' uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: - ref: ${{ steps.find-pr.outputs.branch }} + ref: ${{ steps.branch.outputs.name }} token: ${{ secrets.CLIENT_PIPELINE }} - name: Install uv - if: steps.find-pr.outputs.branch != '' + if: steps.branch-exists.outputs.exists == 'true' uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 - name: Align version using uv - if: steps.find-pr.outputs.branch != '' + if: steps.branch-exists.outputs.exists == 'true' run: | set -euo pipefail @@ -98,7 +125,7 @@ jobs: uv version "$VERSION" - name: Commit and push - if: steps.find-pr.outputs.branch != '' + if: steps.branch-exists.outputs.exists == 'true' run: | git config user.email "action@github.com" git config user.name "GitHub Action" diff --git a/.github/workflows/sdk_publish_mistralai_sdk.yaml b/.github/workflows/sdk_publish_mistralai_sdk.yaml index 3fa424df..f845e8b1 100644 --- a/.github/workflows/sdk_publish_mistralai_sdk.yaml +++ b/.github/workflows/sdk_publish_mistralai_sdk.yaml @@ -1,9 +1,7 @@ name: Publish MISTRALAI-SDK permissions: - checks: write - contents: write - pull-requests: write - statuses: write + contents: read + id-token: write "on": workflow_dispatch: inputs: @@ -16,15 +14,65 @@ permissions: - main paths: - RELEASES.md - - "*/RELEASES.md" jobs: publish: + name: Publish Python SDKs to PyPI # 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.CLIENT_PIPELINE }} - pypi_token: ${{ secrets.PYPI_TOKEN }} - speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} + runs-on: ubuntu-24.04 + environment: + name: publish + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Set up Python + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + with: + python-version: "3.12" + + - name: Install uv + uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 + + - name: Build mistralai + run: | + python scripts/prepare_readme.py + uv build --sdist --wheel --out-dir dist/mistralai + + - name: Publish mistralai to PyPI + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13 + with: + packages-dir: dist/mistralai/ + print-hash: true + verbose: true + skip-existing: true + + - name: Build mistralai-azure + working-directory: packages/azure + run: | + python scripts/prepare_readme.py + uv build --sdist --wheel --out-dir ../../dist/mistralai-azure + + - name: Publish mistralai-azure to PyPI + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13 + with: + packages-dir: dist/mistralai-azure/ + print-hash: true + verbose: true + skip-existing: true + + - name: Build mistralai-gcp + working-directory: packages/gcp + run: | + python scripts/prepare_readme.py + uv build --sdist --wheel --out-dir ../../dist/mistralai-gcp + + - name: Publish mistralai-gcp to PyPI + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13 + with: + packages-dir: dist/mistralai-gcp/ + print-hash: true + verbose: true + skip-existing: true diff --git a/.github/workflows/update_speakeasy.yaml b/.github/workflows/update_speakeasy.yaml index f0179686..e7244c67 100644 --- a/.github/workflows/update_speakeasy.yaml +++ b/.github/workflows/update_speakeasy.yaml @@ -24,6 +24,7 @@ on: jobs: update-sdks: runs-on: ubuntu-latest + environment: publish steps: - name: Checkout repository uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 5587955b..2b90cdb5 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 2d045ec7-2ebb-4f4d-ad25-40953b132161 management: - docChecksum: a0fa9ebdce4c9ca7549f9dce826a2169 + docChecksum: 96c7f58782c479be9d01e672f4e1896e docVersion: 1.0.0 - speakeasyVersion: 1.761.1 - generationVersion: 2.879.6 - releaseVersion: 2.4.5 - configChecksum: f6852fb59e3bcc9a7750210521f2c2d4 + speakeasyVersion: 1.763.6 + generationVersion: 2.884.13 + releaseVersion: 2.4.7 + configChecksum: c43f0f203b291067c934034351c7f55b 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 + generation_id: 20a111e0-4460-4e9f-a244-c024f0db9cd1 + pristine_commit_hash: 8b079c23ee4d603974156f6cf7568878c39a4cb9 + pristine_tree_hash: c20b64fba0f8471688502f9d39a78f2b6c60eeb8 features: python: acceptHeaders: 3.0.0 @@ -21,15 +21,15 @@ features: additionalProperties: 1.0.1 configurableModuleName: 0.2.0 constsAndDefaults: 1.0.7 - core: 6.0.21 - customCodeRegions: 0.1.1 + core: 6.0.22 + customCodeRegions: 0.1.2 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 downloadStreams: 1.0.1 enumUnions: 0.1.1 - envVarSecurityUsage: 0.3.2 - errors: 3.3.5 - examples: 3.0.3 + envVarSecurityUsage: 0.3.3 + errors: 3.3.6 + examples: 3.0.4 flatRequests: 1.0.1 flattening: 3.1.1 globalSecurity: 3.0.7 @@ -43,14 +43,14 @@ features: nullables: 1.0.2 openEnums: 1.0.4 operationTimeout: 0.3.1 - pagination: 3.0.9 + pagination: 3.0.10 responseFormat: 1.1.0 - retries: 3.0.4 + retries: 3.0.5 sdkHooks: 1.2.1 serverEvents: 1.0.15 serverEventsSentinels: 0.1.0 serverIDs: 3.0.0 - unions: 3.1.4 + unions: 3.1.5 uploadStreams: 1.0.0 trackedFiles: .gitattributes: @@ -64,7 +64,7 @@ trackedFiles: deleted: true USAGE.md: id: 3aed33ce6e6f - last_write_checksum: sha1:d172deb3ee1630f16b279de22aec1f8f68d7565f + last_write_checksum: sha1:a301895a264e69dc11007de5f8c7c2e675cbdf5b pristine_git_object: 9d32240a60c8885479c95388bb81c8024b5604ff docs/errors/httpvalidationerror.md: id: 7fe2e5327e07 @@ -340,8 +340,8 @@ trackedFiles: pristine_git_object: d0784e66112b8f79036d1acff2a7fc242058e4a0 docs/models/authenticationconfiguration.md: id: b470496ac0ad - last_write_checksum: sha1:650e1e889d037f79a87c8ab0a679e245c2ddbb4b - pristine_git_object: 6644875efdc48b462a98193b391dc23e1f31b2c3 + last_write_checksum: sha1:0ea76a9e5fb98d46a27be52d95a0195fa9ee2df0 + pristine_git_object: cdd1e55fed41e8bc8914e90f912d9cc4a04920f1 docs/models/authorization.md: id: dec4d9809e25 last_write_checksum: sha1:6bf766a7b49ca2b706bb4eb88ba2d56406e06e1e @@ -440,7 +440,7 @@ trackedFiles: pristine_git_object: 5bcec6a085b8fe921efb44ab5f040faf99cff7a3 docs/models/chatcompletionrequest.md: id: adffe90369d0 - last_write_checksum: sha1:3e240059856e4445d9b76934806b172021174889 + last_write_checksum: sha1:09207e72df2645b7923b375778ddc7273e44af07 pristine_git_object: ad1b3d3912f04750172ebb0c5776215b716b96f9 docs/models/chatcompletionrequestmessage.md: id: 3f5e170d418c @@ -464,7 +464,7 @@ trackedFiles: pristine_git_object: a0465ffbfc5558628953e03fbc53b80bbdc8649b docs/models/chatcompletionstreamrequest.md: id: cf8f29558a68 - last_write_checksum: sha1:0d243eb67aa8e905e88463d9b745bda2030d415c + last_write_checksum: sha1:c93c7401cedf4030f38002cef2c89515a6441d64 pristine_git_object: 7288c818d03f0c672d99a2c61ea19cce4fd39654 docs/models/chatcompletionstreamrequestmessage.md: id: 053a98476cd2 @@ -562,6 +562,18 @@ trackedFiles: id: 9370e1ccd3d5 last_write_checksum: sha1:31a490471292a397e7e7526f2f724fcb743e65d1 pristine_git_object: 6c6da1bd74aa8c67cc40307a88ffac1db1957f3a + docs/models/clientcapabilities.md: + id: e1f291b21fc8 + last_write_checksum: sha1:4647f66510f48e7c2199a8c3c50f7e664fbbb485 + pristine_git_object: 236bb0c43de9d7de80cc85e48b1f1fe9b13daaec + docs/models/clienttaskscapability.md: + id: addb004fe61a + last_write_checksum: sha1:0e28bfef73308db54d12e8ce6e6f4a82a8513990 + pristine_git_object: 9008ba6146d9d870f151453b4fa8dc007177b1b4 + docs/models/clienttasksrequestscapability.md: + id: ee000ce4eb5e + last_write_checksum: sha1:1bf8b73e26543deb358fd8b3395858d902312953 + pristine_git_object: 8dac48a4c3041a3c7c84fe0edecde794a81ebbb6 docs/models/codeinterpretertool.md: id: f009740c6e54 last_write_checksum: sha1:a2114d61a98a48b4365a77c0c75c06ca834367ad @@ -638,14 +650,34 @@ trackedFiles: id: 19b9e48a3c2e last_write_checksum: sha1:6e199c756ce35e2bff3b67df5d97b4520518b271 pristine_git_object: c87093846ca27940a08318fb090c60ce56a00651 + docs/models/connectionconfigtype.md: + id: 3b346ef828ff + last_write_checksum: sha1:e3077c8da9145cce4b4b92688308c97aa9a05a19 + pristine_git_object: 8db3ea6401a0ff1ee19824726704ec21c3953b85 docs/models/connectioncredentials.md: id: 1aa13b29ae25 last_write_checksum: sha1:1fbc7ca6daa21f093853cda8385fd63b031bb653 pristine_git_object: 7e89239996c86952aa3ddf7520c0a73858b31725 + docs/models/connectionpreference.md: + id: be469697273b + last_write_checksum: sha1:f59d85167c69837a67f05e190a8efdd2feaa723f + pristine_git_object: e069233ff9f42a6b13e356985e3bc3819128b970 docs/models/connector.md: id: cbf7c2c53983 - last_write_checksum: sha1:933fcdfbded00c65d36e46d6b2e18e56540802fe - pristine_git_object: 29f8ad0771bf8da6999345b78322001c3821a6ca + last_write_checksum: sha1:7694fec24017b429b23d5b42f29a2d66d6f8aa50 + pristine_git_object: 45aafa1e2d539276d23688d6b36c503650ecb454 + docs/models/connectoractivatefororganizationv1request.md: + id: 3a15b69f7e51 + last_write_checksum: sha1:ae29bb24fdf11ccf8c08e2a1a2909d55d4cbaf6c + pristine_git_object: 40469996995ac4e446584780ac77981a0a5c67bc + docs/models/connectoractivateforuserv1request.md: + id: a4645ace44a1 + last_write_checksum: sha1:c4302c00ee924529d626c75ecb9374b416bcb028 + pristine_git_object: bdf73b8aca4293b69ef96f3c72f0acbf5d7546b7 + docs/models/connectoractivateforworkspacev1request.md: + id: da9da37e67ba + last_write_checksum: sha1:c7b677341c095afaac4adaeacd9e7337307e3174 + pristine_git_object: e4dbaf1dbf5632919eb3cc8fac7aa67ceee01e1c docs/models/connectorauthenticationheader.md: id: bb5e842caa63 last_write_checksum: sha1:7c721f916ed1ce2d4155734bb8190e11de6bf4ac @@ -670,6 +702,18 @@ trackedFiles: id: 10c159720bae last_write_checksum: sha1:e86b1952360e4f41550603b9dc16fddeff6127e7 pristine_git_object: 310cdcde0039e9fdb4faa53644265a6a614d9b20 + docs/models/connectordeactivatefororganizationv1request.md: + id: c4310041f3ab + last_write_checksum: sha1:a1ae31f8e5b836d9300ff4e64ecc2a11c9db7a7f + pristine_git_object: 1fd64004b3bd61e1ff3f789566bc3e587f2e2cf8 + docs/models/connectordeactivateforuserv1request.md: + id: 72bcb9fcabe5 + last_write_checksum: sha1:02be33e6a0ed87d60d7e8130c80e85426b2f1db7 + pristine_git_object: 992603b0f86d60714acded1498c661d170b0e40a + docs/models/connectordeactivateforworkspacev1request.md: + id: 42c92923f1ae + last_write_checksum: sha1:f4f8dbfde3ca68ae68028ddce150dc9761bf3a24 + pristine_git_object: 15033f293dcbb35daef48119419bedd779d8f06a docs/models/connectordeleteorganizationcredentialsv1request.md: id: 922f5267f2c0 last_write_checksum: sha1:23af2d809a20c093ece79bcd1e6ebc551be4b368 @@ -696,8 +740,8 @@ trackedFiles: pristine_git_object: 7d6b94ff09be0d4bf2f062fa039551ab0735fc13 docs/models/connectorgetv1request.md: id: 844c1f489684 - last_write_checksum: sha1:e36ac8ff28ee258340868f8aa4f3172ed3b82ef3 - pristine_git_object: c45148b97aad128744e0e6ccebb00bf22d400eff + last_write_checksum: sha1:446e9132766caec5d1ab49c2654696c571deef53 + pristine_git_object: 35a6f39334ffa87c7ada3ce89e7fe7b9ee612d3d docs/models/connectorlistorganizationcredentialsv1request.md: id: cc1870566c72 last_write_checksum: sha1:633bb13df6fa25f746a9aa905da3f3beb75ff91a @@ -718,10 +762,18 @@ trackedFiles: id: c7f5827917c6 last_write_checksum: sha1:dfe772567d14a0552eec2e53ebf9c1ed6c39ab3e pristine_git_object: 573869b2483b15da829b25e1863652680deb6a36 + docs/models/connectorlocale.md: + id: fe553a89ff06 + last_write_checksum: sha1:3bddb7128d7cf99124a07054d3a6e8c90d22755b + pristine_git_object: c2e7cf5b57f2c7d764e46633eeeebb73a9329422 + docs/models/connectorprotocol.md: + id: a140d41a5740 + last_write_checksum: sha1:e856a50288aefdb1adc2c803a3a6d280b31892ed + pristine_git_object: 77d2845854756c3025aabef138c2a160758e0816 docs/models/connectorsqueryfilters.md: id: d6fb981cad1e - last_write_checksum: sha1:3a33088e1e9332318aff437fba7d01239d417d84 - pristine_git_object: aea47e14f02b61dbbd726bc11f6197b6854bb358 + last_write_checksum: sha1:01782d52446d8e7e53c72094b2ff86b6fe600ee4 + pristine_git_object: 37c19e7a9d2c4bb41a77a8c13936024c9d218d08 docs/models/connectortool.md: id: 1c640bab9aeb last_write_checksum: sha1:ab4ad137330bda6699043da2337aea477c33241e @@ -750,6 +802,10 @@ trackedFiles: id: fdbeb5fee83e last_write_checksum: sha1:9082d8f0cfe9f950d129971b152d37f936f7aaea pristine_git_object: db9cc9b4c4379865ad15292c5385dce864b5935b + docs/models/consumertype.md: + id: d7e5c7974261 + last_write_checksum: sha1:4012cffe5553431d50539a9e4663a935b5cb00cb + pristine_git_object: 9ac4df3f4993e81c99ddfcb91c0b32b04730da7f docs/models/contentchunk.md: id: d2d3a32080cd last_write_checksum: sha1:b253e4b802adb5b66d896bfc6245ac4d21a0c67c @@ -888,8 +944,8 @@ trackedFiles: pristine_git_object: 2e81d26d19950ef6c1bc7186b8497e1f739e8f0b docs/models/createconnectorrequest.md: id: 7a0ef9d82658 - last_write_checksum: sha1:f28eb17d562ab9b881f4c0c640f0b16163ada6dc - pristine_git_object: 111c460a711c1d971a300afda6afe4da608e6d21 + last_write_checksum: sha1:fbc8c1928dfbd1a63792caa0e790685b99643b21 + pristine_git_object: eb14f58529e50cb58388f0d8b8b0f438640d7145 docs/models/createdatasetrecordrequest.md: id: e2c8a858a8e6 last_write_checksum: sha1:6848c7398d763f7a046dbb41cda8bc33cbb98230 @@ -936,8 +992,28 @@ trackedFiles: pristine_git_object: a72676719b90a7b840a2b21d043c61bdf83ce294 docs/models/createlibraryrequest.md: id: 8935b2ed9d13 - last_write_checksum: sha1:14480a2eb03a9e5076a866a21bff0dfd80bb585d - pristine_git_object: 07ff97d0cbaf4f3e260cce4b80fcbd637cc6b488 + last_write_checksum: sha1:1bc8b8f3827425b63bf25b6662d959274f266679 + pristine_git_object: fd94c1caf6dbe31da9b0494879027cba9dbbb6c3 + docs/models/createsearchindexinforequest.md: + id: 886f7c48f467 + last_write_checksum: sha1:b36cd8692b7b93f54560de1bc1cb323e466365b1 + pristine_git_object: 64b22aa43173f98dd98cafb7e26c6b63b12a117c + docs/models/createsearchindexinforequestindex.md: + id: 846e92f3d7f2 + last_write_checksum: sha1:abb7ce51a4a6f86ab5b5e7e6cf484b4061fa7022 + pristine_git_object: 42d99fcb5ef07be40f6d7f34dd08dd56165a69ca + docs/models/createsearchindexinforequeststatus.md: + id: 79a895401c56 + last_write_checksum: sha1:8388b45338b7744a8da74f019c0552eb1172cdaa + pristine_git_object: 1e477acc2610b127f09ced4748e72d5886812b3e + docs/models/createvespaschemarequest.md: + id: 5d582f9abac3 + last_write_checksum: sha1:f760192840beb2436d5505ea2d095501956a08be + pristine_git_object: 3098a2b9dc2ca9c592fce287daae7e5b6a6ed974 + docs/models/createvespasearchindexinforequest.md: + id: a34bf5ca3f0b + last_write_checksum: sha1:562b8ae886bafa4ae587b724007ff3a6205dd20b + pristine_git_object: 0bd47c383aa7df413c1a63dfaeec09582b7bd8d6 docs/models/credentialscreateorupdate.md: id: b2a0e87b0a91 last_write_checksum: sha1:6b778120a84c08601b4f2fbba368d3454204d939 @@ -1084,8 +1160,8 @@ trackedFiles: pristine_git_object: afdcca834da74cc33711b1aa229f5ccf66eceefd docs/models/document.md: id: cd1d2a444370 - last_write_checksum: sha1:c10641b02547bedcc982b8997097083dfc562598 - pristine_git_object: 42c639a6a9b235ab4c754286486fa7e8872a0e7e + last_write_checksum: sha1:7aeb84c1a0efa2b3bf15808714405fe29b930296 + pristine_git_object: ff0238ea7afcba3ef690a303574f74744ba31ecd docs/models/documentlibrarytool.md: id: 68083b0ef8f3 last_write_checksum: sha1:76b9f47c399915a338abe929cb10c1b37282eadf @@ -1106,6 +1182,10 @@ trackedFiles: id: 48437d297408 last_write_checksum: sha1:5f9294355929d66834c52c67990ba36a7f81387d pristine_git_object: 9dbfbe5074de81b9fcf6f5bae8a0423fb2c82f71 + docs/models/elicitationcapability.md: + id: bc87da9c6248 + last_write_checksum: sha1:8654e0b4df9d2fb9cbf283b3dc519317337fe5b2 + pristine_git_object: c2f8fab6ac866c2e1f9cd4f51c1255b95a0e24b3 docs/models/embeddedresource.md: id: f7ea3888f520 last_write_checksum: sha1:8f0869b4403767c45c464cdd7b6c640994c65ab9 @@ -1138,6 +1218,10 @@ trackedFiles: id: 066e154e4d43 last_write_checksum: sha1:cc98abdb803d374146f58a6811c9e3f2b58ff5f3 pristine_git_object: 8bc9e8c6bd3fdc8bd5a28edb381c662e74c86e72 + docs/models/encryptedpatchvalue.md: + id: 8fdf9deac4d8 + last_write_checksum: sha1:e13686983658d34b32ecd1111e8c974cd1ed0944 + pristine_git_object: 1d5988b426d619813a1b34e19b2654b6a1593492 docs/models/entitytype.md: id: 130a2f7038b0 last_write_checksum: sha1:506be1dd51ec1f429246390757cbc0676677bd82 @@ -1182,6 +1266,10 @@ trackedFiles: id: 16660f92d7d1 last_write_checksum: sha1:fa22e53a929291e6b057283482ca7871fb6d2062 pristine_git_object: efe4bbb058c168ad531be27cc135f09464d0da13 + docs/models/expression.md: + id: 84d49a7056b1 + last_write_checksum: sha1:8f871b9f64754b138edaabbd8f64895376694881 + pristine_git_object: d7de83a9d4fad318d2e30f7718bf9b529a367158 docs/models/failure.md: id: 3f79c7d64eac last_write_checksum: sha1:344f1cea9b786a399a0dd974d4df010714031b2a @@ -1434,6 +1522,22 @@ trackedFiles: id: ac9de7c67a5f last_write_checksum: sha1:40fa492321f18e77792d49cb9142b0293be7ffe3 pristine_git_object: 6b03369064e2bb2fedffa606d8bff20d9fceae00 + docs/models/getschedulesv1workflowsschedulesgetrequest.md: + id: ee97a7eb1a05 + last_write_checksum: sha1:07207cb74124d3e2085d26c5c609f0bef3b6ad54 + pristine_git_object: d510c27db9c7b0b495a578c0caee3428a3794e1a + docs/models/getschedulesv1workflowsschedulesgetresponse.md: + id: b6b4b4eebe6e + last_write_checksum: sha1:07a546ef6090188411e55380341fa6fc6377c752 + pristine_git_object: 20adb3c0077a2a281efa4f44701eb6572f61760a + docs/models/getschedulesv1workflowsschedulesgetstatus.md: + id: a6a5de21aca0 + last_write_checksum: sha1:62ce31cbd6d3ad06ee26ad32def445ed6b2dad89 + pristine_git_object: 312db2cd5d8796e2b899a9fd5dac38841e1b0383 + docs/models/getschedulev1workflowsschedulesscheduleidgetrequest.md: + id: 52b58a6705e8 + last_write_checksum: sha1:d4af59b2276baf70a151680d2276c71a6944fe43 + pristine_git_object: e681e674a011fcd31373c4885c862717a04a6b6f docs/models/getsignedurlresponse.md: id: 5539e5d7c3d4 last_write_checksum: sha1:7198474f48bfba6d47326cd436e4a00a8ba70ce3 @@ -1664,8 +1768,12 @@ trackedFiles: pristine_git_object: 2a091c8ac8bfb57bfada1ce173c75543c9431fd0 docs/models/jsonpatchappend.md: id: 5d68c9614b70 - last_write_checksum: sha1:c1d5ac89195b6712b8a4b61450450a4f9b0e910e - pristine_git_object: 684cc896b4ba80ba1bbc278e119fc9fc1dbbf924 + last_write_checksum: sha1:e6e0a45d6be613281a10b369fc686e8e0d56ff9f + pristine_git_object: 903d6c71854e89340b7508c735fe2251720cd364 + docs/models/jsonpatchappendvalue.md: + id: a822d0b58ec8 + last_write_checksum: sha1:832c839f2cb2e065c731efddf86112bb7efdb6e5 + pristine_git_object: 551cafe15bd959b9d4db9a809b9c7393ae134c65 docs/models/jsonpatchpayloadresponse.md: id: fb6daf532ebb last_write_checksum: sha1:b896fa130e63bfc0831bb8067669df89a8342314 @@ -1776,8 +1884,12 @@ trackedFiles: pristine_git_object: 6febc058425bb38857c391ee4c40d600858e6058 docs/models/librariesdocumentslistv1request.md: id: 7b5756e50d64 - last_write_checksum: sha1:2605b7972a3d7b4f73ab8052be4bf740f44f6f6f - pristine_git_object: 44f6300115853053214639982516a60b3268e778 + last_write_checksum: sha1:b01fbfcbdb622ba35e52cfd0884d75d7ef5a192b + pristine_git_object: 6149336fc296c6ff3c61e4f61f36fe4c33c8c465 + docs/models/librariesdocumentspatchv1request.md: + id: 2815453b5023 + last_write_checksum: sha1:0ded124e8b094e78b404d1a1cdc1e7b5cffef555 + pristine_git_object: 511aee46a2ed2db98101c10d69288732807b0132 docs/models/librariesdocumentsreprocessv1request.md: id: 1b8bf57b3f0a last_write_checksum: sha1:8528785c1b4ae18d6ec6f261d29d5daac0d420a3 @@ -1796,8 +1908,12 @@ trackedFiles: pristine_git_object: 6e1e04c39c15a85d96710f8d3a8ed11a22412816 docs/models/librarieslistv1request.md: id: eb6047c126d3 - last_write_checksum: sha1:7bd4a00dfe54162bd3c315ca0ab2990133969390 - pristine_git_object: 37352ee1277aa9576da968ce44b0ffda772715f7 + last_write_checksum: sha1:dd42520f540d9e5c1820d517be4e4a894475ece1 + pristine_git_object: 5efdb897a19d6ad920a031472ba88098c4f80630 + docs/models/librariespatchv1request.md: + id: a5c8a22e9d7c + last_write_checksum: sha1:fc18a3c812d877f8bd47f6a34bbc3d29e5420519 + pristine_git_object: 4764808653f0d841f87e58ca71ec9549f2c1af1f docs/models/librariessharecreatev1request.md: id: 99e7bb8f7fed last_write_checksum: sha1:f37578c7882eab83cca3cb2aaf1ac17b9a21934c @@ -1816,8 +1932,8 @@ trackedFiles: pristine_git_object: c5c142db7aaa49990135c21eabde43b8c0fdf756 docs/models/library.md: id: e8ec114dd107 - last_write_checksum: sha1:5434149d101255cb5135f8726acdcfb29c4381bd - pristine_git_object: a07d3afac18faccb504c51f1a54cf5addc3faab3 + last_write_checksum: sha1:9331e004d3587e261e9f7496525dc698db37db3f + pristine_git_object: 5b9aa658712ffad94a9c2b7f1595d1c232868870 docs/models/listbatchjobsresponse.md: id: e03025d58630 last_write_checksum: sha1:de42c9396546fc8487d0bd6ed15b4076599fa83f @@ -1918,22 +2034,62 @@ trackedFiles: id: e25e2392c4c9 last_write_checksum: sha1:647413204680efd677ce7746101b74e2ad7d59d5 pristine_git_object: 6daecdd1eb31ad2d80400b4eb9032f635f0bc889 + docs/models/logicalexpression.md: + id: f222e869e12b + last_write_checksum: sha1:cec26b10026b2245d92356fbe81cece3645de577 + pristine_git_object: 675368e79b0723713a27064cc56814c951d91616 + docs/models/logicalexpressiontype.md: + id: 61eee1af8d4c + last_write_checksum: sha1:7e78778f1a304d226f752ebb6d023654ced7866b + pristine_git_object: 0d3c1f78c1c8cc90a466d876b2d54f156d8ba7d9 + docs/models/mcpprompt.md: + id: c6eeb6a6a719 + last_write_checksum: sha1:321ce6a140536a8582632d937f498b2fd8006a7b + pristine_git_object: b68d0046a0c236a5471f03e5edb892c8dde2c2a0 + docs/models/mcpresource.md: + id: 643d9dfa9a7b + last_write_checksum: sha1:44be038071e200307677b355dfe5b54d574a6ece + pristine_git_object: ac3d92a8fbdeb583d38d7da18ed839235452219a + docs/models/mcpserverauthenticationrequirement.md: + id: 7540ae50c0bb + last_write_checksum: sha1:37c7585e48212e64bc1794f6f853b1ce5071c09e + pristine_git_object: a3824be670aba370256208b6f4f0faf95af40ece + docs/models/mcpservercard.md: + id: ff9347d08f2f + last_write_checksum: sha1:36600ab72bc9050bccc4c5999ce4add9df67526d + pristine_git_object: ebc72b07a50aef53b94c6df9e643d673368db54d + docs/models/mcpservercardmeta.md: + id: c2f4503daa2f + last_write_checksum: sha1:4ec024c2276b28ce39e7345a414726bdcddd72b4 + pristine_git_object: 52345bcfc5cdff0d1c81609a0ade92f34c27526a docs/models/mcpservericon.md: id: 0b20f03adab8 last_write_checksum: sha1:d66113a4b0486f144b1f73f423559360ec751631 pristine_git_object: b0ae7da069119f7477ffa5ad756f353f56f213f1 + docs/models/mcpserverremote.md: + id: 56a47d36028f + last_write_checksum: sha1:36df87e25d5f271cf3602e91a8b5279ddfeda66d + pristine_git_object: 1c7c4de3ccfbe7f5b1f576ae1090362bab2f1e8a + docs/models/mcpserverremoteheader.md: + id: 23d6af542948 + last_write_checksum: sha1:640a69c9758c7d3b5fbe1a1563fa80a0fe978982 + pristine_git_object: a3966a54fe6f51dff8cf85bf501ecd6c4ef47c69 + docs/models/mcpserverremotetype.md: + id: 1347827838d3 + last_write_checksum: sha1:2d1f8c2455bf84877adbcd6807ec3e06e6bb1f99 + pristine_git_object: ea4585b6aa78fb82a8abbce90caec84cee2a08d9 + docs/models/mcpserverrepository.md: + id: 5440c78d09c6 + last_write_checksum: sha1:e5979de6f7ebdeb6f3b539ea952f6c415cb9a1b5 + pristine_git_object: 16fbdd189465350a09846ab3e84699d181faffed 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 + last_write_checksum: sha1:6734ae688b3c505c94d7b78753085ff18b7aab22 + pristine_git_object: 723f40b1d16eefd324872a0837aa805e1a7dc930 docs/models/messageentries.md: id: 9af3a27b862b last_write_checksum: sha1:a3eb6e37b780644313738f84e6c5ac653b4686bc @@ -2166,6 +2322,10 @@ trackedFiles: id: 592cf80526b8 last_write_checksum: sha1:e72a2238fe984cc4fa0d2522b462aa9ad247af78 pristine_git_object: 7ed17a697771f10febe2b893f092865b09dc04c7 + docs/models/partialscheduledefinition.md: + id: f5bb5dc0cf18 + last_write_checksum: sha1:a0a8d6c43c0231c0e2061de78f5b6e9e233e7c23 + pristine_git_object: e66ee671440d90abcd15860144e6826f5835110b docs/models/pauseschedulev1workflowsschedulesscheduleidpausepostrequest.md: id: 56f6ceab8262 last_write_checksum: sha1:3b5c8e341c685a7f4b2789a9d051eef54ff8cfda @@ -2200,12 +2360,24 @@ trackedFiles: pristine_git_object: fae3c1ca4ba2c2ddb3b7de401ecdc8d56dcc7740 docs/models/processingstatus.md: id: 06047222d2ff - last_write_checksum: sha1:fd2f5d605c6e5f8aa86461e8442c50db3fbea07d - pristine_git_object: 514caa50e524ae5afab802b8394cb27189b2bfbe + last_write_checksum: sha1:81a11724ad214bab81874167854e6cbcb55a6cc0 + pristine_git_object: 1d472b881d684f47ac76edff663ab5fc84581e10 docs/models/processstatus.md: id: "336054835357" last_write_checksum: sha1:43253d2ef4badf3a5e8e5981becfb558c934359a pristine_git_object: 68313743c4d926b2cb29037d0e59a2f9d8d25f1c + docs/models/promptargument.md: + id: 5e744dafa422 + last_write_checksum: sha1:4b7a10005ef27e91c191ab71e76c8ba0eff789aa + pristine_git_object: a8dfdb05a8c424e1e8eee8f44c088de33e8e733c + docs/models/prompts.md: + id: 012697edbda4 + last_write_checksum: sha1:23f02f4461cdaf64ef729ef7dc0395d40f9f5020 + pristine_git_object: 9fe855977ada9474260e8d81d3258faf17393f4b + docs/models/promptscapability.md: + id: a100a874f118 + last_write_checksum: sha1:0f3a7d98fff0ae0b7ddfaedeaa5116cad73c0115 + pristine_git_object: 50ffae2b2ae976f4b21c67eefef9ea1bb1d8fcd9 docs/models/prompttokensdetails.md: id: 1391892fce0a last_write_checksum: sha1:4a82fc483f090e4fc09d19a3f2c0f2a2e022cf3f @@ -2214,6 +2386,10 @@ trackedFiles: id: abfb51fdf794 last_write_checksum: sha1:9be30607f8c895958f33b5be25fc1b8b4cb3d328 pristine_git_object: 59de7076ce05ff71ba4bd5f22112459f4500bf4d + docs/models/publicconnectionconfig.md: + id: e05a024f162c + last_write_checksum: sha1:ab9dd73817a606e22c4d526910771158070e0e4e + pristine_git_object: 56c9ee8ea7ec86a54854cb4f3513646f182b58d0 docs/models/querydefinition.md: id: 4831b7e558f9 last_write_checksum: sha1:f4983c0963906b3eda13c69e2852b08d662dd744 @@ -2294,6 +2470,10 @@ trackedFiles: id: 8857ab6025c4 last_write_checksum: sha1:5634447d01c483713dad3d6d39df182007e6181b pristine_git_object: b710cc1f394e04ecc93c9fc6daddddec366254ad + docs/models/requiresconfirmation.md: + id: 68573b1b41ed + last_write_checksum: sha1:2d0a6d67c74253551cccf3015d599b9557ba5ad1 + pristine_git_object: e7f1e4a653cd7dc5d7f9d9ee4a8661867bea3368 docs/models/resetinvocationbody.md: id: 4063ca65ac51 last_write_checksum: sha1:94c7cd498cba13d4da784c4be76ddbb5b1b64cd9 @@ -2310,6 +2490,18 @@ trackedFiles: id: 1086204e8a19 last_write_checksum: sha1:f1a1c228a16e8e99cd5ff04622455e080418dd6d pristine_git_object: 074c573e64e98cbaf177fde279364f26df04a2bf + docs/models/resources.md: + id: 322aa690f06f + last_write_checksum: sha1:2e0ea1407b59e79451a8521a39ccc06bd5414ce4 + pristine_git_object: cf19612e7e17a683f426678b095b18767e292034 + docs/models/resourcescapability.md: + id: 1efecd9117de + last_write_checksum: sha1:a12afb871ba44408288f3f2ce67428747236286e + pristine_git_object: bbd256d08f16e9a966c107f8eccd762eae70e3b9 + docs/models/resourcetype.md: + id: 4607729e43a1 + last_write_checksum: sha1:241a059f01662088222612170681caed2c01d812 + pristine_git_object: 047f96bb17bfabb811b0315c71c03f373fcc2bfa docs/models/resourcevisibility.md: id: 891d464e9c47 last_write_checksum: sha1:cb0eaebe4e984ab4d999745a142868d2359ab8e4 @@ -2374,10 +2566,18 @@ trackedFiles: id: 2af79e204ed6 last_write_checksum: sha1:10354a9bcbe03a498848de9874b3163cde0fcc05 pristine_git_object: d722e7654427a013da70deb45f1bdb65b55add30 + docs/models/rootscapability.md: + id: 7cc1a16f90b4 + last_write_checksum: sha1:65f29860fb46023e6feb61ed5775d4fef4774a92 + pristine_git_object: f025431df291c6ab11241b2adfd33e5b915488c5 docs/models/sampletype.md: id: 0e09775cd9d3 last_write_checksum: sha1:b77964a7b39ec1b74f70925a39c30b23fad6ac43 pristine_git_object: 31f26c3c2869a453306fff5b062b40e95aa5f19a + docs/models/samplingcapability.md: + id: 79e8183fdc88 + last_write_checksum: sha1:47d5699c46cf60ba3bee396002f1cedfd6f6a9b3 + pristine_git_object: b05fb678df66c767211f42e2d2afeaee72396ac6 docs/models/scalarmetric.md: id: e23b9b990914 last_write_checksum: sha1:272bcac17d958e6d045be0e78ad80aa710d35bb7 @@ -2392,8 +2592,8 @@ trackedFiles: pristine_git_object: 4166bef5ded04c323f5644b80305ed5bb4159fb4 docs/models/scheduledefinition.md: id: 5a795fa1c041 - last_write_checksum: sha1:cbe6e2f2ebaf6bb52be56ffbca6b9d966fdbc2e3 - pristine_git_object: 7d0509f6263ae04d3eb99b65cef0b85adf71aeae + last_write_checksum: sha1:75666aa609a516ed239cfc0f76d8e87df9ebcb5b + pristine_git_object: 93c587409c628018888caa634db7117d86f56c37 docs/models/scheduledefinitionoutput.md: id: e5f8d9d43716 last_write_checksum: sha1:a41e2d99be8b57984e9db632fb17af0212b51e60 @@ -2442,26 +2642,54 @@ trackedFiles: id: e7cb0de862bc last_write_checksum: sha1:d8e860c666fe6b152d3944e9182e90be539c3ce2 pristine_git_object: 9474c1109d62fc5f7ff0bae32d386d54951d7fa2 + docs/models/searchindexresponse.md: + id: 37a2b2687f02 + last_write_checksum: sha1:909f3b19d495ee5e42aa6d7863058496bc58d589 + pristine_git_object: ce6087ec22b4569314dd2d2b596d08c3a183bfd9 + docs/models/searchindexresponseindex.md: + id: 328fcf6e4d24 + last_write_checksum: sha1:2665208de61f9db51eff5018a2a987d2dcc23b9b + pristine_git_object: 3093f4d48f8e527a37a7875bf91356ebaa6cc0b3 + docs/models/searchindexresponsestatus.md: + id: 78dbf9d2a629 + last_write_checksum: sha1:794e6f89be8778c11490fa69bdca3925819e4862 + pristine_git_object: c2200101050e96907f3b4b0d4ea8128ba36328d1 docs/models/security.md: id: 452e4d4eb67a last_write_checksum: sha1:45b7b8881a6560a468153662d61b99605a492edf pristine_git_object: 2e0839d06f821dd97780dc22f202dedf23e4efe1 + docs/models/servercapabilities.md: + id: b798bbcef1a4 + last_write_checksum: sha1:47016476abe0ff79522675df70d5983e354d0b0f + pristine_git_object: 4faca72ea83255c4a31423588a83aa8a183f2b39 + docs/models/serverlocale.md: + id: ea9d0dfa3104 + last_write_checksum: sha1:dd9c7f8896f6085cfbdc127e8fea40d592d748cd + pristine_git_object: a26fcf11b8de7e49375108d2cd775a2b8524440f + docs/models/servertaskscapability.md: + id: 6868e7f8ea87 + last_write_checksum: sha1:817dea2b0064c094f794d1b5ae0d64bbea8c02e9 + pristine_git_object: 9554996dc3f83f1ad3602c12812c4d451e798645 + docs/models/servertasksrequestscapability.md: + id: e4a1bc46b776 + last_write_checksum: sha1:4b65e7809ee82055dc1fedb6885eff2469cd0092 + pristine_git_object: 65c8593c38a0bf6a435223d352e848ea0f88e83a 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 + last_write_checksum: sha1:723c9e8222979149c54d86e1f5bb2c07b5d2963a + pristine_git_object: 922506d31484d7ff3dbd24a696191452222054df docs/models/sharingdelete.md: id: 165cac179416 - last_write_checksum: sha1:1a0b3c95f4b56173510e234d7a76df85c593f360 - pristine_git_object: 1dcec0950c7fcd264ea9369c24244b54ba2bcfbf + last_write_checksum: sha1:ea12c9bfd1f065b9afd882d067d6b50f673c34ae + pristine_git_object: e6e0732bbb1b31e53ea7c4ccd4dad3aa80ccbc19 docs/models/sharingrequest.md: id: cd53ce3913a5 - last_write_checksum: sha1:380d0621a0a8ec9cd4be2b53a6e326b8c9c3d201 - pristine_git_object: 21b8ec1f74c1f903aa087cd3b4d13918c0ea9dad + last_write_checksum: sha1:90a59e17eba146ddc5ccceedc76b65df8235ee31 + pristine_git_object: e92318f812f8fbe66f9a258b68daa38cd1819bbf docs/models/signaldefinition.md: id: 4627d2840cb7 last_write_checksum: sha1:3606a41b67a27350c22aa2bf234d8a8696b23404 @@ -2486,6 +2714,10 @@ trackedFiles: id: 38c985ca6ede last_write_checksum: sha1:f82ac07d517e89bfa8044eebff6f9f7aa56f6c77 pristine_git_object: f65d7924388b842863deddb0e52d4376f2e28925 + docs/models/skipconfirmation.md: + id: 1bf623cd7bb3 + last_write_checksum: sha1:e514f325543c209b0d86b9a445f2c8696f171cfd + pristine_git_object: 48eade7acba08e0189f7405636d67dd0284b8ab6 docs/models/source.md: id: 6541ef7b41e7 last_write_checksum: sha1:00d43797d0155945ec39d4aff068a3ac7bad5ad5 @@ -2570,6 +2802,18 @@ trackedFiles: id: d8cd08c55c3c last_write_checksum: sha1:3ef23d504527602f2d0789d2cfb1a6629115f41a pristine_git_object: 8321a3090910115b586be900bcf23da5baf4c245 + docs/models/taskselicitationcapability.md: + id: e17695a516ab + last_write_checksum: sha1:fc3c19832d82da18d181fbd3a4a519bf4d49e003 + pristine_git_object: f2f3ef81a6731774e867a760c8e9993363c49e57 + docs/models/taskssamplingcapability.md: + id: 93ab84d49981 + last_write_checksum: sha1:cf477e6505da76a158f5c618c7a11fd29439f493 + pristine_git_object: 805d857462acba218480633e4092373f692ae1c2 + docs/models/taskstoolscapability.md: + id: f22fb61bcf93 + last_write_checksum: sha1:7ce2f2029c59001775b44be264b09866e2019569 + pristine_git_object: cd60fe49ca0eaa9e68ff6f75af94953f454a1da1 docs/models/tasksupport.md: id: 58be1f1aef25 last_write_checksum: sha1:2005c0e15f36bd315c17688daa4dd9a8c260b009 @@ -2710,6 +2954,10 @@ trackedFiles: id: 0c47c08eaa46 last_write_checksum: sha1:1af09b39f042e21e47ac09f73301ca9bbb521029 pristine_git_object: 8d385132baca782d1a7ec0d586136a29751f6ec8 + docs/models/toolexecutionconfiguration.md: + id: 24c733cfd29b + last_write_checksum: sha1:41b2d1a96b02852ee366092e9d78194370ed0881 + pristine_git_object: 04981b892381cddd436a5392569a22e2f089b1bf docs/models/toolexecutiondeltaevent.md: id: f2fc876ef7c6 last_write_checksum: sha1:ae1462a9b5cb56002b41f477ce262cb64ccf2f4e @@ -2758,6 +3006,10 @@ trackedFiles: id: f0522d2d3c93 last_write_checksum: sha1:783769c0200baa1b6751327aa3e009fa83da72ee pristine_git_object: 5c76091fbd2c8e0d768921fab19c7b761df73411 + docs/models/toolproperties.md: + id: 02fc3247a741 + last_write_checksum: sha1:9e9d42579412eecb812839ce507788c80ce17533 + pristine_git_object: d85fd8214553575469384250e546e766c9c9aa9c docs/models/toolreferencechunk.md: id: 10414b39b7b3 last_write_checksum: sha1:ea3bdfc83177c6b7183ad51fddb2d15aee0f0729 @@ -2766,10 +3018,14 @@ trackedFiles: 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/tools.md: + id: b78ed2931856 + last_write_checksum: sha1:93076309072b74f5653721c2d66a6acaab093c47 + pristine_git_object: 2f9decd63f1b3ffb8aeb13afe92858ca1a9931ec + docs/models/toolscapability.md: + id: 959506df839b + last_write_checksum: sha1:dd4e8ecca8e44f2f57a12c74a8ecdeb1de34081e + pristine_git_object: 7bde4735f551fb52bf8a6321dc070417cbb9a96a docs/models/trainingfile.md: id: 4039958e8930 last_write_checksum: sha1:d02543c2d1446e56501f2ac358a09669b0077648 @@ -2810,14 +3066,10 @@ trackedFiles: 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/turbinemeta.md: + id: 1f7f944fef63 + last_write_checksum: sha1:38dd2a9a68f8b938dbf6c3c43470e5986204bf08 + pristine_git_object: d5e48e38eaa3c247c6e09b25c9d4a15790937715 docs/models/unarchivemodelresponse.md: id: a690f43df567 last_write_checksum: sha1:5c9d4b78c92d30bb4835cb724d1ea22a19bf5327 @@ -2840,8 +3092,8 @@ trackedFiles: pristine_git_object: cf590a2fc7f58707855eb0bda2d4b8460bfea800 docs/models/updateconnectorrequest.md: id: 40e38d9c7c2a - last_write_checksum: sha1:03a8cd1c8d6415b26cdf592534ba09c022a5414e - pristine_git_object: 335588eac79ddbd851ead9950f3681f7dda90ee3 + last_write_checksum: sha1:5c78fcc8ea7aff991588911d5f9bd7e568d77495 + pristine_git_object: 7a267df3d91de7d9cd97c3d53b6fae75509cf8c8 docs/models/updatedatasetrecordpayloadrequest.md: id: ada11a6c544f last_write_checksum: sha1:220ce1184c9f6b6c6d1e5cdf2dc18197778f7af2 @@ -2872,8 +3124,8 @@ trackedFiles: pristine_git_object: 8cf62617303949d2633773af0268447befb04af2 docs/models/updatedocumentrequest.md: id: ee4e094a6aa7 - last_write_checksum: sha1:09171d42fdac0060276af58c5f036cb5714709d3 - pristine_git_object: dd06dd4b43b72ee73faf0bb2d39edf22889c0780 + last_write_checksum: sha1:33a21ce8b03db36d05ec02f7f3fdc5d5ab95f344 + pristine_git_object: 5a3c93afc4a894134e45c2b333b23d6c3a30207b docs/models/updateinvocationbody.md: id: d8b3b9cca5ae last_write_checksum: sha1:0fed6d77626ec76d3584e8d38b97ee228218a390 @@ -2910,6 +3162,10 @@ trackedFiles: id: fef8641b24c8 last_write_checksum: sha1:4c9532d96f40fc0b406e3c8e34b40d2b457963bf pristine_git_object: c675adeffe4da132426b8002b45d4c290bdd97bc + docs/models/updateschedulev1workflowsschedulesscheduleidpatchrequest.md: + id: 0146d71cfe07 + last_write_checksum: sha1:944b765fd6ed75e9939cf93cc3947d130cd55f91 + pristine_git_object: 68ffe15a622ad79f1581a52624efffb33fc0d5ba docs/models/updatevoicev1audiovoicesvoiceidpatchrequest.md: id: 0b7dfc68573f last_write_checksum: sha1:53d5d07d53d184d68b57185d251c8d68ff3cf4d4 @@ -2950,26 +3206,34 @@ trackedFiles: 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/vespaschemaresponse.md: + id: 989810d8633d + last_write_checksum: sha1:96ff3c52987ca630d03822936dfa792f928473c4 + pristine_git_object: 1cb7277be00681b0f1fbe6bc2e83317242d56152 + docs/models/vespasearchindexinforesponse.md: + id: 4e902564cfe0 + last_write_checksum: sha1:8744908c4282bb2be98b8eb3ac92a86d10587f7c + pristine_git_object: 16272fce2395ef0834eabb12fdb661fb72ca7d2e + docs/models/voiceappearance.md: + id: e481147d8fb2 + last_write_checksum: sha1:f8c3f4bcd91547d767c4b22fb85099c2fe97ac6f + pristine_git_object: b77de4c82ba355cb414c7f7f2e0ed641ddd74035 docs/models/voicecreaterequest.md: id: 1014a6e8d549 - last_write_checksum: sha1:2eba4e618f2767df9ca52b8b352e3060e9d0f04e - pristine_git_object: e9a3b3a14963b63e3b5555912bfe2c2f5ad6c67b + last_write_checksum: sha1:7592cabbf9ad8e0a8bbe1d69b4537dc82a7f7e37 + pristine_git_object: 775da22b80af35b840c127f1843790b135887a8e 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 + last_write_checksum: sha1:becedca881e793f4d0b0768ef6d4f22a99628f61 + pristine_git_object: a907372e03797206112f04c3faac9b586effd4a6 docs/models/voiceupdaterequest.md: id: 7fbbdd315066 - last_write_checksum: sha1:8a1883407eff51f9e81fa3024af0d9fab016b2ca - pristine_git_object: 924b5f477dd97f8fe417de63b5d7b744616b2fc4 + last_write_checksum: sha1:19026b7852f3382a6dc9ed22ad7411e6ed53624a + pristine_git_object: ec2913dd40628817196c911acaa5558b3efd0314 docs/models/wandbintegration.md: id: ba1f7fe1b1a3 last_write_checksum: sha1:ef35648cec304e58ccd804eafaebe9547d78ddcf @@ -2998,6 +3262,26 @@ trackedFiles: id: a88b03086ce2 last_write_checksum: sha1:7046dd6a11770b56c36e22af07552e28c6cf36f0 pristine_git_object: a534ad34da32c4d8eb93f055e1bbf128c5df7e8a + docs/models/workflowbulkarchiverequest.md: + id: 149f8cc52a93 + last_write_checksum: sha1:429200327e31c36c2524bb9952577548d8cbe4b3 + pristine_git_object: 2c9b934189dc8f4fd1748c6a8e4c0dc4bcc1e8fa + docs/models/workflowbulkarchiveresponse.md: + id: 5d83f540f3bf + last_write_checksum: sha1:d967e75915950b95cc0cc7938ebb79f9d9bfeb61 + pristine_git_object: ce1999f3d2fb7f0ef7cdf5b6d9e326ae7deb71fc + docs/models/workflowbulkerror.md: + id: 616c78c4a5ba + last_write_checksum: sha1:c55cf5e9350a7aee18c06707f2ce0b332b8c5397 + pristine_git_object: d8e34f4e593067e4b9cb7b8b22ba1be589d667dd + docs/models/workflowbulkunarchiverequest.md: + id: 976175ec8e9a + last_write_checksum: sha1:bc1aa33c225ff70f46b0ac86251ca5a983eebdd1 + pristine_git_object: 0e5342cf3d28ae5804931aa242e3b8c9335f29d4 + docs/models/workflowbulkunarchiveresponse.md: + id: bb49d41e85a0 + last_write_checksum: sha1:d773d6bdc784ac4a1b61775ae64cea77d3c86aa1 + pristine_git_object: 8b139b752d94dc52594e12465e15797244cbb4df docs/models/workflowcodedefinition.md: id: 16ce7d540f36 last_write_checksum: sha1:96703471ed4249c118cd0d2563182f9300e3bfc9 @@ -3136,8 +3420,8 @@ trackedFiles: pristine_git_object: f85563cedae6cb209614fc97ecf6dd94ef810172 docs/models/workflowschedulelistresponse.md: id: 4c425808aa60 - last_write_checksum: sha1:d8e8aad7a91d7f8e398f7716109d436df6c4fc86 - pristine_git_object: 7142185b8081d076cb3b8fcd592234d49e3e0e5a + last_write_checksum: sha1:76a8376715ccad83ebe039f64b757617229d65c0 + pristine_git_object: b642854646f5ac2e7a0f680de8387f504a9374ab docs/models/workflowschedulepauserequest.md: id: 3a6d7adc379a last_write_checksum: sha1:97b3dc2321f62497cea5f13b54c5b1d049d855d1 @@ -3150,6 +3434,10 @@ trackedFiles: id: ef0b813976ad last_write_checksum: sha1:2da7d2a8519fe915554fdcebc25915ad11fbb203 pristine_git_object: 96d7ced717099cc1bbff4ac38d60e7552e9c6204 + docs/models/workflowscheduleupdaterequest.md: + id: 0eed547c9a4b + last_write_checksum: sha1:d71e300642a6ef23687318f53c8fe32b38320a0f + pristine_git_object: 24357f65c73cc9ace2a51eb549434c40333dea9c docs/models/workflowtaskfailedattributes.md: id: 7f329c44d7fb last_write_checksum: sha1:432c70ec990e81e2de79c14efbbb6161b60e1b3e @@ -3188,11 +3476,11 @@ trackedFiles: pristine_git_object: daa637fafd39b03b9d6c0b627047be1142f060cc docs/sdks/accesses/README.md: id: 2ea167c2eff2 - last_write_checksum: sha1:663516c8c94ca324b938a5d5bd1196663cb1de88 - pristine_git_object: 51051e2f8def9bfd6032617530ba9bead989404f + last_write_checksum: sha1:c9daf160ffc706a9be9e2e86855d97227fc25373 + pristine_git_object: 3acf0566daa202fbc8c3c182ff9405d9812a38bd docs/sdks/agents/README.md: id: 5965d8232fd8 - last_write_checksum: sha1:962df50ddc8aa1f501ad596313ee590ba704ff8a + last_write_checksum: sha1:2081b3728e940846431a2cc28b6090d87a786e87 pristine_git_object: f02ea6cd7f7405763edb09dcece22e65028e8fbb docs/sdks/batchjobs/README.md: id: a3b8043c6336 @@ -3200,7 +3488,7 @@ trackedFiles: pristine_git_object: b9655075680d5046d4b10d10de77d6b7b2ccea23 docs/sdks/betaagents/README.md: id: 5df79b1612d8 - last_write_checksum: sha1:6d14ffeace9a068f45ed9c62ee6663dc3768239f + last_write_checksum: sha1:40233bb8dbec401f8ce02c054b60640cabd400f7 pristine_git_object: b936538c54d38e52a67ffdb8c65ec35999197a3a docs/sdks/campaigns/README.md: id: 18dcc3c717ca @@ -3208,7 +3496,7 @@ trackedFiles: pristine_git_object: d5d7e4d4681811419874f58c294cb59688e595aa docs/sdks/chat/README.md: id: 393193527c2c - last_write_checksum: sha1:839bc022bed585cd691c403333f68ed8b68d1a8c + last_write_checksum: sha1:428f1bd7d271cd6b7edd6251295a5f240e648c5b pristine_git_object: 54b9f02913409dd73b0a0f36f7eab4f7fbcf5791 docs/sdks/chatcompletionevents/README.md: id: 6965539e0525 @@ -3220,11 +3508,11 @@ trackedFiles: pristine_git_object: dc0f4984380b5b137266421e87a1505af5260e89 docs/sdks/connectors/README.md: id: 7633a87d946d - last_write_checksum: sha1:f4c8a2ee577cae1b8b1e9551bb873bf34fe0f403 - pristine_git_object: 753c1cf3974ff3be77dc3b401d27ec5c0ef8bced + last_write_checksum: sha1:6eeacf2ed1c525cf329bb03ad4d3de1404de7398 + pristine_git_object: 4a0d8a935163a762071352b0d731ed0272018ddc docs/sdks/conversations/README.md: id: e22a9d2c5424 - last_write_checksum: sha1:d0a4e55b1f1c9acc6e9b7cf5925faf930a911d26 + last_write_checksum: sha1:68ede193fd35a89ab226aa92a92edaecf1eebb1a pristine_git_object: 63cd80a4a655a5c139be79239b0787c3f90cdea9 docs/sdks/datasets/README.md: id: deb5d90f4faf @@ -3236,8 +3524,8 @@ trackedFiles: pristine_git_object: 941b5538a57b3b693914d6b0d2acad2e8bb47611 docs/sdks/documents/README.md: id: 9758e88a0a9d - last_write_checksum: sha1:c3ee7c987ddaa856fa0a2f1040a2592edb0b82f1 - pristine_git_object: 2efbc3488ec4b4b6bc5d30d9ae1b5a344a0fe79b + last_write_checksum: sha1:7f1540110547b0ddb1350dc24422bb94bdf3bdd8 + pristine_git_object: 2a4787d0bb340be626208900ab7d72c2232792eb docs/sdks/embeddings/README.md: id: 15b5b04486c1 last_write_checksum: sha1:4a279bf9bcd84a9878ef979c78b8b75af3d52f02 @@ -3256,11 +3544,11 @@ trackedFiles: pristine_git_object: 3c8424419bae5c7e6e47b4cb23e35064531a8345 docs/sdks/files/README.md: id: e576d7a117f0 - last_write_checksum: sha1:45265e774720742cde1c76c8be294983bf4fc77a + last_write_checksum: sha1:ca90e32b21837a12b2e0f248b2e6160864e01d21 pristine_git_object: 246707073e9dee115d30b20a01bf728dcb43efd7 docs/sdks/fim/README.md: id: 499b227bf6ca - last_write_checksum: sha1:be2db0822c83cec2cfe2b5424d4b08db06d1c63c + last_write_checksum: sha1:b4aa3bc3243a20f339c9f9aab0365ed0456d7808 pristine_git_object: 7bf8908378c764c58cca2eddc6a4a97574c3709f docs/sdks/finetuningjobs/README.md: id: 03d609f6ebdd @@ -3276,8 +3564,8 @@ trackedFiles: pristine_git_object: 34d167398ac81ce78d50c1498c01f4c74917ce7f docs/sdks/libraries/README.md: id: df9a982905a3 - last_write_checksum: sha1:3cd3aef0294fb5b421a2b64baa7a53cfc1ad4f31 - pristine_git_object: 08606189680228ca4f4d30b6fc626c2d0c4b9287 + last_write_checksum: sha1:99d5c4e9c4c2689385bedf9da1930df89649c995 + pristine_git_object: 863cb9f410ff082cd09bb04bc52b0e2628804289 docs/sdks/metrics/README.md: id: a8545d964e21 last_write_checksum: sha1:0c559bd570e162c994c6125058f3712e24bc576b @@ -3300,24 +3588,28 @@ trackedFiles: pristine_git_object: 7ed914205115222f7ade5a656541af0dba64ff28 docs/sdks/schedules/README.md: id: 2f28c809a225 - last_write_checksum: sha1:cb4f7d988d25d87b8c18443c6cf64b5cb31146df - pristine_git_object: 7bf59931141869fc2797586fb6cdcb8adb9f0b7b + last_write_checksum: sha1:310601597370d883f38db8901ffbf99fd0875caa + pristine_git_object: 6b0e5f0e31f7de2eb5ac105c6406abb5d59e1cb6 + docs/sdks/searchindexes/README.md: + id: b58e7a6ab4f1 + last_write_checksum: sha1:129ef4c1ef14a615ee58a2d8c313b02cc0f0993e + pristine_git_object: 471bba59a2e12f24b8bad96850b25b566cba29da 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 + last_write_checksum: sha1:548786cb29e8500574afaaa771a5184c81fe2ebc pristine_git_object: 97703c9b4dc942385ee04ae96cbd100c3f632a17 docs/sdks/voices/README.md: id: 4f1a657c8f68 - last_write_checksum: sha1:88be1b4df915b0c4f50f2a54f2c7e93ffd5a5263 - pristine_git_object: 49b8533f85e2c6bf70ff1ea296136f4d18cb8348 + last_write_checksum: sha1:4f1b6512c334d5d43b30cba4438550508290c780 + pristine_git_object: da59de379ecf8390439ebd64ab7b2d6dfa1f25df docs/sdks/workflows/README.md: id: 80c76ce944c0 - last_write_checksum: sha1:807551c827dd5936819393e88ff2160839bd01fc - pristine_git_object: 4575977672501a047dcd701dc471e2694d13d294 + last_write_checksum: sha1:f6f15706b9b4ac1b4f88fba3cac7396d69151691 + pristine_git_object: 0fcb9b8b8a15f262abc31e031a16f8da09ad95f2 docs/sdks/workflowsevents/README.md: id: 514b42269280 last_write_checksum: sha1:34971ab6eef89b115d78375a85142f3d2612f431 @@ -3348,80 +3640,80 @@ trackedFiles: pristine_git_object: 036d44b8cfc51599873bd5c401a6aed30450536c src/mistralai/client/_version.py: id: cc807b30de19 - last_write_checksum: sha1:6b2772cd63b60cddf4ea95d94cfc44f81a878a73 - pristine_git_object: 9f9ae8c6224af17b3e22410b33f5a5ad37389e33 + last_write_checksum: sha1:f490e14fedec9dd2bab194b7f29af94a779d9b08 + pristine_git_object: 1a977e80189b69ec4cd5fc17f2bf384da665fba2 src/mistralai/client/accesses.py: id: 76fc53bfcf59 - last_write_checksum: sha1:de197fbbfea8bc95f44b4e7ee1b39e68fdde8bc7 - pristine_git_object: 5d859a399cb62144f5e47ae879407907427d56fc + last_write_checksum: sha1:5f1fbb7eb973dd8bcbe33bf0b303d4df3bf2ad36 + pristine_git_object: 90aef2e7e73f5880ec4f55fa054cf6b5d3cc082b src/mistralai/client/agents.py: id: e946546e3eaa - last_write_checksum: sha1:02f7e2c669dba9f1d29f41bc6427357e9d04be5c - pristine_git_object: 1bcd8c54f685630c8248243b7dbf0ad5a8aa6082 + last_write_checksum: sha1:9f2793ced88646b66736d46e98f004cbd4c57224 + pristine_git_object: 86c31b3ec549caadbf9c1576e09a0205f6374934 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 + last_write_checksum: sha1:0544004f28ec429df8ab994c361f384b6159740d + pristine_git_object: b305e63e3a40f1b9ba5833f0d7d692c090f9eea2 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 + last_write_checksum: sha1:ea2bb05997e8dd9e7bf487afa563da93ac813c29 + pristine_git_object: 456e285bb0c318c8d1023cc7c5d2f4d3d296c25a 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 + last_write_checksum: sha1:152f183dc93b2069b570ce75bba970a9771a7c0b + pristine_git_object: 3c0661b6e85979ebf8f2ae7c399f13877eb4732d src/mistralai/client/campaigns.py: id: 9e64fcf4e60e - last_write_checksum: sha1:8d4471059539934a69b9fa1f98b4cf35f1db61ab - pristine_git_object: c9f28794e32130e6ef92127316815772c6a04c71 + last_write_checksum: sha1:f75467fa874163b43ee118b29202c6e00c683d9a + pristine_git_object: 460b0b5a958748cc3e3662783e9cb8d64542aee0 src/mistralai/client/chat.py: id: 7eba0f088d47 - last_write_checksum: sha1:e8b8b2e745117b6d78402148121c9f5229694066 - pristine_git_object: 9deff9a0d2091c706146eb903834a354c5432ec8 + last_write_checksum: sha1:1a257686a6a246b8d39fba8cf44650a9ebb36567 + pristine_git_object: 74a9221a6f16ff66282bc59ff3b2349b384bc1de src/mistralai/client/chat_completion_events.py: id: 1813f339625b - last_write_checksum: sha1:785474540b9ddc3d3e9c7ec5011e2f25519bc8c2 - pristine_git_object: af4124f0c3e71e3f335f4c0b54d36a0b2dddcbb6 + last_write_checksum: sha1:4ecfd5b487a648345908ffffe746cc21447bc0ab + pristine_git_object: ef737912cebee0cc9d39ea3f18f4a28dadfb3bfb src/mistralai/client/classifiers.py: id: 26e773725732 - last_write_checksum: sha1:d057b735d057147e1341953dd696fbc7110611ec - pristine_git_object: ddb2d0b1abaff5f267320779bf9ae64d5ae0adf3 + last_write_checksum: sha1:d635ba5307bb64ade27134a1ae979e610a6d2f80 + pristine_git_object: 36329ea6180905b8ea4607d5a5aa83e297a7bdee src/mistralai/client/connectors.py: id: 39da03126050 - last_write_checksum: sha1:16a6fe8ffbf14828b1b930d7dda7a001d4780ea4 - pristine_git_object: 793c9f8ae726f86fc82de044e8a09b6931bb2592 + last_write_checksum: sha1:44bf2225202d7e5b7d95b62fa1d4f072ed9e2efb + pristine_git_object: dc8df3e853ded5dc3f4c51daefb00a8a6723344f src/mistralai/client/conversations.py: id: 40692a878064 - last_write_checksum: sha1:501da7474cc0bc6fd627150f15870dd3acf70235 - pristine_git_object: a30f8b05f9735464ac53b612cdfe139e5469b8b4 + last_write_checksum: sha1:c6f4ab6903aa74f88d267552c01d79b4ca08534d + pristine_git_object: 8f61fbfad9d79ea0ea4dafc4187c2212adacf154 src/mistralai/client/datasets.py: id: e5a6ae2a2d85 - last_write_checksum: sha1:fdd59e77aa9d19e64ab31cb949ea3565392c3113 - pristine_git_object: 437b42fdc5354378e822b38172bb5ee769355425 + last_write_checksum: sha1:7c4c9dfda1e50a003f9fb857fd96904d0e49a778 + pristine_git_object: 078bb18baa9ace9066204d5c554d647ecd4ce420 src/mistralai/client/deployments.py: id: a874b267fcb9 - last_write_checksum: sha1:5b62dd6436ce4914de7fbf0abc0819734eb08136 - pristine_git_object: 26e9c5658068de85878942b444538e0e58f706f5 + last_write_checksum: sha1:0291107482b2d9c2a3bf0a7e0933d1fc43b1f3fe + pristine_git_object: 086e95a2162256db07d919c98a8dc5029627a17c src/mistralai/client/documents.py: id: bcc17286c31c - last_write_checksum: sha1:27beb1104b009c5237d37f11e11b589fadf3838b - pristine_git_object: 2a555d3e3d34afe673de231bd1fcadb8fc36b59b + last_write_checksum: sha1:a436f5d0055f4ab5b29f4b8c2e8222f9e697c63e + pristine_git_object: a3c8b07bd32689a8cf5d092d0964f3839937f8ac src/mistralai/client/embeddings.py: id: f9c17258207e - last_write_checksum: sha1:737e09a794867ea7242fb7c9e09cdff5f837fbf4 - pristine_git_object: 64337b4f3f56f084ed47a3f1f17a999a868db2c3 + last_write_checksum: sha1:8dcf1cbbc7233bd6e0c3fd10decb2d88ccaa046b + pristine_git_object: 17eb9a57bb170bee55f26f11c54b8c9a4255ede2 src/mistralai/client/errors/__init__.py: id: 0b2db51246df last_write_checksum: sha1:0032f4eb3501c71fafb8f68113a8c80e677311a4 @@ -3452,56 +3744,56 @@ trackedFiles: pristine_git_object: 25b87255a51021079f8ba5cc60b43509e12f9a4d src/mistralai/client/events.py: id: ac9b961cc70d - last_write_checksum: sha1:b250b6454555bb436cbc194e732c72982af23d94 - pristine_git_object: 3a4c47224be925a5701c88f9cf363e61bc1afd7f + last_write_checksum: sha1:ec68974ad398b02201aa10ca5e10443196aa33ca + pristine_git_object: 4ebb6505f0c8aa342f6daad6eaf73c92cff300fe src/mistralai/client/executions.py: id: 974004d347a2 - last_write_checksum: sha1:bc0b48a037c85cc0411dc16f59da9481510c0469 - pristine_git_object: e4b9f90b0d985710715421cf68320a8dd0585a19 + last_write_checksum: sha1:b9558bb68c97db073706f9a2c53afbbc8049990c + pristine_git_object: aa22f09ebdc95526314bf5ba0c86cb9e48ed9f42 src/mistralai/client/fields.py: id: 862335210b20 - last_write_checksum: sha1:c200568ed4ad334849643bd85f19edc258877ff2 - pristine_git_object: 17441ca699fd8fb22701a0e59411d3ebd292f049 + last_write_checksum: sha1:1af13d8200df61b54b0e1f0a679feb76484c6bd0 + pristine_git_object: 5e701da99d523c222454a291e64f47ada989f0e0 src/mistralai/client/files.py: id: f12df4b2ce43 - last_write_checksum: sha1:076c1f6435398d29491e1dcdaecab760e9f4a0a1 - pristine_git_object: e4549c75f5b5c21e8025383cce66737e0b1a96f6 + last_write_checksum: sha1:bcb7a967ddb7bb16896e8b0ef0af56c39f1d3ff9 + pristine_git_object: 5f8396f5d8c37b638bcd8a7be1c97b85bc1b2f95 src/mistralai/client/fim.py: id: 217bea5d701d - last_write_checksum: sha1:4fdaa4ccd058e700e510c63a5397e5c28fa4e923 - pristine_git_object: d25f79b193237ef5d3b55921837882c8dd9dd30f + last_write_checksum: sha1:b4c816932351b1b0bafbc453dd838192b2d7a515 + pristine_git_object: d868bcff5dc5b90f0468dd097f60b1bb90e9a95c 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 + last_write_checksum: sha1:b42ebedc6f7461b0a74393aa907f6d9a94ca91e1 + pristine_git_object: 708cc5371593055fc8410fabd933249f309acdfe 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 + last_write_checksum: sha1:5eff8e1b8dbfd396ff87e48c2af4b2c7a79d9814 + pristine_git_object: dfd139bab111a55b24b508feaf64ee67a564204b src/mistralai/client/judges.py: id: b6024a41ecb4 - last_write_checksum: sha1:a5c33a8bc46f6f3d435827a2a701016a428cc83c - pristine_git_object: 52c8899eb8c8ec092be454aca929012a62fec337 + last_write_checksum: sha1:a4f3d12d778a58e8d10a41753c4a992c20bdd86b + pristine_git_object: 187eed0d36bc641177fa077aa529c4ec51422e78 src/mistralai/client/libraries.py: id: d43a5f78045f - last_write_checksum: sha1:db5cab2f824979cfe953e31f465c30fa322a4cff - pristine_git_object: 928c1ea8a79f1f838a6ea4c7a23826f5bdb82445 + last_write_checksum: sha1:555755528cb5283aa561c7eee818102b4ef75dbe + pristine_git_object: 3076d09c7582f18d197208178a88520e4bc9220e src/mistralai/client/metrics.py: id: 937cb03f8130 - last_write_checksum: sha1:491be33059fb0bbccff73b2a3bb0a66fb7a5ba9b - pristine_git_object: 60597c40f00705b4758827fb7d119f33ae2ad1b9 + last_write_checksum: sha1:0a529a333e416df4907837b24006bca6f462de9c + pristine_git_object: d3814d6b3d2fd548b9ae7f97a1f4d27592ca97bf src/mistralai/client/models/__init__.py: id: e0e8dad92725 - last_write_checksum: sha1:c072eedd54264d94cc39317fd40433adf40f6fa9 - pristine_git_object: ab36240c66a1da2d58318b7155af6a803e2e1e13 + last_write_checksum: sha1:faadf02f5775b34350ab65f02e0b5ae349caecc8 + pristine_git_object: 6121091ffd2225c3180502e373308c810e465ba5 src/mistralai/client/models/activitytaskcompletedattributesresponse.py: id: 8174941767cc last_write_checksum: sha1:b5246e203765ba0532a6a65d391bdd237ab2c891 @@ -3696,8 +3988,8 @@ trackedFiles: pristine_git_object: fb8b79723f3f0f4485c0c6bb1c52b0a5db2fa1fe src/mistralai/client/models/authenticationconfiguration.py: id: 97b5056c29fb - last_write_checksum: sha1:95b12ce07e5656f40d1fcf4566af5336f5279cf3 - pristine_git_object: 84f665915ad716ce97cd9219f59ffa9cefc68bbd + last_write_checksum: sha1:e8465381456454f427238fc42a60305b3e5f55d9 + pristine_git_object: 79c6964176ebff18657b02abd16985737e6eef35 src/mistralai/client/models/authurlresponse.py: id: a2b468c87a8a last_write_checksum: sha1:8ffc0c770c51d7b0cb49770e6829486d0cb82741 @@ -3834,6 +4126,18 @@ trackedFiles: id: 4000b05e3b8d last_write_checksum: sha1:1d639da446bf3e2df7576f4320b0d0e2dbdfff8d pristine_git_object: 5d1d1f8f3adad438f83619f61e3e396aa3b65d15 + src/mistralai/client/models/clientcapabilities.py: + id: b2ad660c5c9b + last_write_checksum: sha1:9e9ab4cfed5487f3ba336de7465efcbe7891fdcb + pristine_git_object: 772711601752ec07d571befea5b51a30abed1650 + src/mistralai/client/models/clienttaskscapability.py: + id: 83aeca444b21 + last_write_checksum: sha1:1aac7c99f18f0449acbe46ab38e0012f7a4b1862 + pristine_git_object: 5256c3d502a7de1b6509031ee8c0ceea2df53479 + src/mistralai/client/models/clienttasksrequestscapability.py: + id: 26148da505a0 + last_write_checksum: sha1:ecdb0a3954e6cd3ddd4dd49ba1d3844cf2ff54e2 + pristine_git_object: 38b9d6b12e9cc278fa882c95b25bd1de848c7fae src/mistralai/client/models/codeinterpretertool.py: id: 950cd8f4ad49 last_write_checksum: sha1:248d6e6c1906303f03eb4f29429227a7d39679a2 @@ -3874,14 +4178,34 @@ trackedFiles: id: be202ea0d5a6 last_write_checksum: sha1:fe9420a42d598d1a6ae15ff0d35bbfad4f56e7b8 pristine_git_object: 3b99a69322ac18cfda3df0d4726d218063092ae0 + src/mistralai/client/models/connectionconfigtype.py: + id: 52923bfd57d3 + last_write_checksum: sha1:c515a281111d65a4acf890c2683a891d352a652c + pristine_git_object: 9ad1bee185be3830d587d428b83f2bdd626ac341 src/mistralai/client/models/connectioncredentials.py: id: 2f4a79b452fb last_write_checksum: sha1:2183abeb08ce54a985d531baac5f67b84f42417d pristine_git_object: de461057f967b4dbd746cc82321fbed4afbdf145 + src/mistralai/client/models/connectionpreference.py: + id: 6b9389ac91e6 + last_write_checksum: sha1:94c03c3e8ac45245baec8db480cfa162794b0dd8 + pristine_git_object: 953ef17cbecfa6983a722b151b966c72f74cf476 src/mistralai/client/models/connector.py: id: 1a4facac922d - last_write_checksum: sha1:dc5989fda6b4a5f49e2e5febae8ebf8ddfc5b33a - pristine_git_object: 9d8b600032db4f260a96140433bce3f7e4c21f3a + last_write_checksum: sha1:5b8d7f5c6f97a2f8478ddfdd093a74b60d53da34 + pristine_git_object: ce9e083744d2682451378528aafd90c439748bfd + src/mistralai/client/models/connector_activate_for_organization_v1op.py: + id: 9b35397dd5cc + last_write_checksum: sha1:310d5c74ef6b89e604e94bec61efa51f853e7c88 + pristine_git_object: 1b0ec3b0bda16c406d70a8a8e97cbb92ee427f51 + src/mistralai/client/models/connector_activate_for_user_v1op.py: + id: 6bf45c78cfea + last_write_checksum: sha1:a821db048f3e675f4593d0355c1e361c49311e42 + pristine_git_object: e30126d48d593fc5c240fd58b98fbf6aba314caf + src/mistralai/client/models/connector_activate_for_workspace_v1op.py: + id: b6392712ddaf + last_write_checksum: sha1:b361b01a898a446d2ed9a953c8cfc95812341a9e + pristine_git_object: 00fe6699d18db79d9943dc55775eb337b3ad2846 src/mistralai/client/models/connector_call_tool_v1op.py: id: 7948899b3068 last_write_checksum: sha1:c4388ac1594641c36f97daaedcf42b0e94753be7 @@ -3898,6 +4222,18 @@ trackedFiles: id: 7795b085704b last_write_checksum: sha1:70bffd65c359d4c295b0f4a419d5a783d50e03ea pristine_git_object: 43b3c1dc6576d9d9260a220097f52b51029e205a + src/mistralai/client/models/connector_deactivate_for_organization_v1op.py: + id: 850bece829b0 + last_write_checksum: sha1:b9dc305c9bc09d5979d650b5734d86eb416e23fd + pristine_git_object: 4c5c5458e79a3fcabf1b608895364e5aee21a536 + src/mistralai/client/models/connector_deactivate_for_user_v1op.py: + id: 1df4227a54f7 + last_write_checksum: sha1:8d2b440ae4983f8b43b9dd7fed5c97a5cd9c17a5 + pristine_git_object: 5d998877241cc05f2e67e6b28b8a349f18d866ef + src/mistralai/client/models/connector_deactivate_for_workspace_v1op.py: + id: d82c1a5321cc + last_write_checksum: sha1:5edfc695ffd5acfc57f2a08af655b609ffbdb05d + pristine_git_object: 9f02d887f7be47f64fdbb0d00f7e2d3be2f23517 src/mistralai/client/models/connector_delete_organization_credentials_v1op.py: id: aab3a70dbbc5 last_write_checksum: sha1:a53123b18f8dd5a33e777741ab44aac0d5ed64ee @@ -3924,8 +4260,8 @@ trackedFiles: pristine_git_object: e0c4146d4621eec51f6961f85de95088e7480c08 src/mistralai/client/models/connector_get_v1op.py: id: 73ca3a446dcc - last_write_checksum: sha1:74ce85c377be5d7f86506d8a8d97249708c246b8 - pristine_git_object: 780afac9281bf78c4263c7bd32faa04a718695d2 + last_write_checksum: sha1:7afd047c7e74eb418365d79a25c79ec566e72992 + pristine_git_object: beb27872de7204b10e5a28789f817b2cdb629a77 src/mistralai/client/models/connector_list_organization_credentials_v1op.py: id: a52ee058feab last_write_checksum: sha1:2abf099d7a6ea68134d38c3a95dfec08d37e9ed9 @@ -3958,10 +4294,18 @@ trackedFiles: id: 7dc7ec295301 last_write_checksum: sha1:8af4bd44caa8ad09180139e7e8a68052c16dce11 pristine_git_object: 85366bb6acaa0724a907803c689a2caeb431bf7b + src/mistralai/client/models/connectorlocale.py: + id: f987f5207d2e + last_write_checksum: sha1:650dd62ffecf5940c5b9c43e561059244ae1e09d + pristine_git_object: 373e9e848b4df211f646c289b864b3a3d66b4954 + src/mistralai/client/models/connectorprotocol.py: + id: c35853b1b79f + last_write_checksum: sha1:96327799b7a691122ca8f742afb5bb85574ff580 + pristine_git_object: 042f23524ba8f38cf01956945611158deeb8937a src/mistralai/client/models/connectorsqueryfilters.py: id: 3b9fc81aa726 - last_write_checksum: sha1:399567eb362a40f1225f7d8adb820aabc6b9df99 - pristine_git_object: f10d689771d50077bc35193a39a94672a9f09ac2 + last_write_checksum: sha1:ab7df6cf281f7bea870663783924d113309348fa + pristine_git_object: 860caf43e0a61363933058d72819e03f4be86477 src/mistralai/client/models/connectortool.py: id: 41ca596b44f8 last_write_checksum: sha1:0306b9a607d59afe042aac018df6e2bc0cff0d8a @@ -3982,6 +4326,10 @@ trackedFiles: id: 86730e16aa67 last_write_checksum: sha1:fae6e84b040a1c8bcb25b94041f990525529472a pristine_git_object: 8c92f2f8d4c25eac7f3c95e0ae425942829390d0 + src/mistralai/client/models/consumertype.py: + id: d18230da2fdd + last_write_checksum: sha1:4fc648452051b1dc9ef496b54e75d18396807158 + pristine_git_object: ac091e5e905d0985ce7286389f46c308c53ebb82 src/mistralai/client/models/contentchunk.py: id: c007f5ee0325 last_write_checksum: sha1:b921b03b4c1e300b0e3f51ea9eadd4d7c4b7a0ea @@ -4060,8 +4408,8 @@ trackedFiles: pristine_git_object: b3957df9ef369ecc1746ee3efd1b463bc10b4be7 src/mistralai/client/models/createconnectorrequest.py: id: 3da192d6491a - last_write_checksum: sha1:21ab6824e52ffb3bd2f97a97b4521188d6725f02 - pristine_git_object: 18060ca33206509d6443e306b8e505c9698ea9c6 + last_write_checksum: sha1:dcee72a62388e53c2f924f50f90bad947a757591 + pristine_git_object: ac732104d885e1658bd729d1732a2ca12b027cd7 src/mistralai/client/models/createdatasetrecordrequest.py: id: 9455e38a8c31 last_write_checksum: sha1:df3e8d7425500f23101c25267738e617eeb2d467 @@ -4092,8 +4440,20 @@ trackedFiles: pristine_git_object: 7c30aa5ffde4e23ce9ebcb0d67a0e1a3c875c698 src/mistralai/client/models/createlibraryrequest.py: id: 1c489bec2f53 - last_write_checksum: sha1:0d98f058dc61560790d2bde49026dd631845218b - pristine_git_object: e0357e9252a4911292e5dce370c808350b6da0ec + last_write_checksum: sha1:ebee21e3ac561b490513d6ebcb79efea070e1597 + pristine_git_object: 2bbb1e18c3ee495db44df95e47046b6f1285e54e + src/mistralai/client/models/createsearchindexinforequest.py: + id: 3f424a7063b0 + last_write_checksum: sha1:84c436749a4f6268ac8cbb4d52879e33f4052859 + pristine_git_object: f527f72dfeaa0e4374f64e9aad1ed4a786c68f63 + src/mistralai/client/models/createvespaschemarequest.py: + id: d44c0c466535 + last_write_checksum: sha1:048cbca6e8aad11561e9a42a5a8b0a31f50a0ca6 + pristine_git_object: cac99bc3735d8be742a5aa12a65cf40a7ba974d3 + src/mistralai/client/models/createvespasearchindexinforequest.py: + id: "866143560866" + last_write_checksum: sha1:553b15776ecaf0d3a58f0c99459429f60a51215e + pristine_git_object: 50006d38bb822c1cb5eb90ed8e8f577184dc2cc2 src/mistralai/client/models/credentialscreateorupdate.py: id: 9927546f2487 last_write_checksum: sha1:e31d3c7fc19e2a7fb49d07cb6f85c5ea73aabb98 @@ -4236,8 +4596,8 @@ trackedFiles: pristine_git_object: 2955dc485bbf1017a728cb0562baf948083e1b13 src/mistralai/client/models/document.py: id: fbbf7428328c - last_write_checksum: sha1:bc290f10562aaf9c24bd14ab3d2a31e62f535042 - pristine_git_object: 8d1aea883e579ff1677949573f43dddc362bd35d + last_write_checksum: sha1:3cdd40229b126132d3eb60505cd1d635325a8372 + pristine_git_object: c04512c130ee295c80548a2215b0f6bb428667bc src/mistralai/client/models/documentlibrarytool.py: id: 3eb3c218f457 last_write_checksum: sha1:a84295aba7b9e7f70b68f279934d1a5ca0817f77 @@ -4250,6 +4610,10 @@ trackedFiles: id: 4309807f6048 last_write_checksum: sha1:f45ecef78fb4412dc76ce54478fe536df0259048 pristine_git_object: f7a99ff81ee01d256052920405ca4788d3a47f75 + src/mistralai/client/models/elicitationcapability.py: + id: 63a9b5cfa2f2 + last_write_checksum: sha1:dc5d41705df6540b421fe0bacb10a11696d6a526 + pristine_git_object: 128084365172f50fc5b4f3f2f6453a1b216d9731 src/mistralai/client/models/embeddedresource.py: id: 94a23f656f72 last_write_checksum: sha1:50375363269d68edd3ea1c0a31ba08c8bf9bd160 @@ -4278,6 +4642,10 @@ trackedFiles: id: b51ec296cc92 last_write_checksum: sha1:ea907f86b00323d99df37f7ff45d582aace798e7 pristine_git_object: 4a39d0295f9069ae9f749cf21dab450eaf145d19 + src/mistralai/client/models/encryptedpatchvalue.py: + id: 311803d1f28e + last_write_checksum: sha1:bd3ab363a2924b69a7f1efd03a10d0d0f6b4f31b + pristine_git_object: 970bd59b8458d0f30fb2826cf3ee027a1e4237dd src/mistralai/client/models/entitytype.py: id: 62d6a6a13288 last_write_checksum: sha1:015e2db9e8e5a3e4ce58442ccedaf86c66239dde @@ -4400,8 +4768,8 @@ trackedFiles: pristine_git_object: fe62d6ddc1187e1177ac834a85bd4e1b6a86ee52 src/mistralai/client/models/filtergroup.py: id: dbc0c34fbc2f - last_write_checksum: sha1:f900312cfcea2b2a341d83e95ca2fce3e467fa03 - pristine_git_object: 4e9815b7387904b071645a9a4682a4ffbf23d488 + last_write_checksum: sha1:73aaf6de90f9be6913af8379535bc5ad999ab878 + pristine_git_object: 3439df66779c46b66a48f4c3792c51af16f958c7 src/mistralai/client/models/filterpayload.py: id: 56757b849f7a last_write_checksum: sha1:1d9a513f9c5a33c5ae249fb4926dd70eeb5e02e5 @@ -4542,6 +4910,14 @@ trackedFiles: id: 60463c59ff01 last_write_checksum: sha1:a851312a3e0c91273ad444c6e2cc81c8c541c9cd pristine_git_object: d9b6758f1622c76ad41092f4dbb9c6cf392b299c + src/mistralai/client/models/get_schedule_v1_workflows_schedules_schedule_id_getop.py: + id: cb775bc63ffd + last_write_checksum: sha1:29edc18fcca86b478702fa9ab632c93e63868a11 + pristine_git_object: d22d0515070d71858367cacdca0e2b83ee2a4cc0 + src/mistralai/client/models/get_schedules_v1_workflows_schedules_getop.py: + id: b5f0210eca23 + last_write_checksum: sha1:cf881ab5d08e4f97c4482522949059251406d4a8 + pristine_git_object: 62f8ece293aa947f86bc09938bbcd1ff6429edb9 ? 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 @@ -4736,8 +5112,8 @@ trackedFiles: pristine_git_object: d4242f11b063f795b8d677abdd8c19ab0419a0b7 src/mistralai/client/models/jsonpatchappend.py: id: 61801f21f4b0 - last_write_checksum: sha1:f0400cf42fa6c776042487285cf18c1970e17ad6 - pristine_git_object: 7181ddac1956f1c29b815231f30c3405d4f50754 + last_write_checksum: sha1:6418ac32a97e99eea86df63204f560a0926f17e7 + pristine_git_object: 185f7bb72350361dbf9817a9480824720f5ee339 src/mistralai/client/models/jsonpatchpayloadresponse.py: id: 1b39f46f529f last_write_checksum: sha1:1d2a8b1039cef824f0e030804a72a0325c413a10 @@ -4844,8 +5220,12 @@ trackedFiles: pristine_git_object: 857dfbe60c57af8b0fa6655a049ed336d70fb941 src/mistralai/client/models/libraries_documents_list_v1op.py: id: 756f26de3cbe - last_write_checksum: sha1:565872ef17a53cc9751fa2c8fc1267dac2d01e76 - pristine_git_object: afc474cbe6c571ac36fe0800d4c1e5ffd07eb207 + last_write_checksum: sha1:3c0fc8976932ac7c537a7a0183e87a6505a84336 + pristine_git_object: 57e2736b9994d071455b95bfe349c3bef60eac87 + src/mistralai/client/models/libraries_documents_patch_v1op.py: + id: 31b2201bbfe2 + last_write_checksum: sha1:625739e50a05c7164436063994869e725ab48972 + pristine_git_object: 0ae4efaf7cc7a05f1150a266b8d10d52341ef32a src/mistralai/client/models/libraries_documents_reprocess_v1op.py: id: dbbeb02fc336 last_write_checksum: sha1:bd5013cb1581dd13642ce7edf1e701f5b0c967c4 @@ -4864,8 +5244,12 @@ trackedFiles: pristine_git_object: 7a51d6053aa2cf2e6524a80487fe9549eec3dfa1 src/mistralai/client/models/libraries_list_v1op.py: id: 2d9b1b4deeb0 - last_write_checksum: sha1:1c99dd9165c57ca19d94daf81f31c378125d280b - pristine_git_object: cac06dadbb33c7bf28b276b4c51f569a885ac44e + last_write_checksum: sha1:0c0958ecc928ba180cc265c4b0558eb62db3edb3 + pristine_git_object: 328ac72c2e09158a7e31a445370a4dc2ccc46aef + src/mistralai/client/models/libraries_patch_v1op.py: + id: 2b189be3c57a + last_write_checksum: sha1:6df3bb4ff0c163061963bbf1db9a8c239bfbaa68 + pristine_git_object: 2fbaea6755cad1b0106320a9a058fb02c48edcc6 src/mistralai/client/models/libraries_share_create_v1op.py: id: feaacfd46dd3 last_write_checksum: sha1:cdb7e60f1aceb2c7aa54fe2b9ba5dafc2bb70995 @@ -4884,8 +5268,8 @@ trackedFiles: pristine_git_object: 54b0ab708c665ccb841b1c8d0f2748c390850506 src/mistralai/client/models/library.py: id: 028a34b08f9c - last_write_checksum: sha1:82eb895302f95f3f1a1adf85070027e22ab22350 - pristine_git_object: 0e09cfaa14040397a37ac72810521fb14fe6562f + last_write_checksum: sha1:b15f423354d9f938b6f39cc8ab19095f3203d74f + pristine_git_object: 4ec8604c50da4154796b4267bb639cc4d377f6e6 src/mistralai/client/models/list_deployments_v1_workflows_deployments_getop.py: id: 0c6586ffcab0 last_write_checksum: sha1:c7d7be66560be5bb813316f958a3fecdf7813156 @@ -4962,22 +5346,54 @@ trackedFiles: id: 72a73946b20e last_write_checksum: sha1:18a2d1aeb07ed9d84a1854bb7186e5d32783cb58 pristine_git_object: 4e2ff2f6869517202f4f0c435ce4a6435c5cc571 + src/mistralai/client/models/logicalexpression.py: + id: 48d46c10b453 + last_write_checksum: sha1:4be5e5411b84d61ed53b72140e2914b94902995f + pristine_git_object: 1b87693c0db77be8767af91cc72e80d58a342dab + src/mistralai/client/models/mcpprompt.py: + id: eac4133413b2 + last_write_checksum: sha1:003b0a3bf0f7af4db962697e1604510710709983 + pristine_git_object: fd5fb0d87df899d59d59aa60b2d8becd8a76610b + src/mistralai/client/models/mcpresource.py: + id: 4922063d1d29 + last_write_checksum: sha1:0544a1c3fd247ea67bbc7924700ce9255252dffe + pristine_git_object: 77df58571236b984cc69580f930ac646af44f8dd + src/mistralai/client/models/mcpserverauthenticationrequirement.py: + id: 688772457c1d + last_write_checksum: sha1:befc1fa9206fa19cd320977a89eba6d96ef7bf54 + pristine_git_object: 280315a719d6f5a8183db03b7235871437b467f9 + src/mistralai/client/models/mcpservercard.py: + id: 3d8e787f97f3 + last_write_checksum: sha1:1a947e8f9af8d234f3fae2be377b71b19a819f81 + pristine_git_object: 3e66b9540418cfd6987e4da70f1252b90d1c5382 + src/mistralai/client/models/mcpservercardmeta.py: + id: 0f095765c6aa + last_write_checksum: sha1:34c452143cdda5cfc07b165f6c00bc055c308eb6 + pristine_git_object: daf592f9dc9bece6cefc5a5d3cb2ca5b82bbecae src/mistralai/client/models/mcpservericon.py: id: a5b508a322d7 last_write_checksum: sha1:0dd9bac0684864bf6264ddded7f27c8c88b804f5 pristine_git_object: 293ab37505a1098241631dd83435a0e91d073551 + src/mistralai/client/models/mcpserverremote.py: + id: b20e4512dbe2 + last_write_checksum: sha1:93a620a8c955a788e554453a19bbbcdbfcc7f7d0 + pristine_git_object: 9099207c8e71c1b643641599e2a135a21ba4017a + src/mistralai/client/models/mcpserverremoteheader.py: + id: adaf8d89cbcb + last_write_checksum: sha1:5bf69acdb3aedc19f151d898579d951129c252ca + pristine_git_object: efd1c1fd6c8e896c617ef73d06379a5cafd9aca9 + src/mistralai/client/models/mcpserverrepository.py: + id: 431ce897e113 + last_write_checksum: sha1:670c22c827a6ade10a46f69a21efa01b96cf1b25 + pristine_git_object: eb564992db641642325f55c68cce7355c393d58d 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 + last_write_checksum: sha1:f47fde183bd997563b1e522125220b31317aba7a + pristine_git_object: ddd7771b2cea71e052b47fec85644f67ce3ce16c src/mistralai/client/models/messageentries.py: id: e13f9009902b last_write_checksum: sha1:43aebdc9eaecc8341298dc6b281d0d57edf4e9e6 @@ -5158,6 +5574,10 @@ trackedFiles: id: d64678967bf0 last_write_checksum: sha1:693e9b575e0da721b15363db1e381d19f8766efb pristine_git_object: a60640aae96b54f7f8e7561029fda45a165007c4 + src/mistralai/client/models/partialscheduledefinition.py: + id: ce1ded792ff5 + last_write_checksum: sha1:e4f50d9cb285dade8dc732547f03908e0b1a9834 + pristine_git_object: 1120dd141a1f7ddadcf0cbe578078496c9287236 src/mistralai/client/models/pause_schedule_v1_workflows_schedules_schedule_id_pause_postop.py: id: "53799174e259" last_write_checksum: sha1:0d12062b4884937e8100490414a29842da524c5f @@ -5188,12 +5608,20 @@ trackedFiles: pristine_git_object: 614f481174e58eb7ba28cae5238b532d1d66ef9c src/mistralai/client/models/processingstatus.py: id: 28146eaecfcf - last_write_checksum: sha1:a3e3ebeae169441cf430c302c9fe278de79ce215 - pristine_git_object: 7e93308f4cf6af8f968e93f20765c41694b8fad9 + last_write_checksum: sha1:4c053b54f4e154e016b1592dfe1de70bfd3699c3 + pristine_git_object: 73308b4658b84ad4a064b3ce18fd96eaeccdd918 src/mistralai/client/models/processstatus.py: id: "0205512146e6" last_write_checksum: sha1:22ad3d5fc80fbf3f83db61512e7bc79295c5fc91 pristine_git_object: 15bdce2056f2f642096fbbdb2ac32ce1e5b8c9cf + src/mistralai/client/models/promptargument.py: + id: 52e5c885f761 + last_write_checksum: sha1:a71c2398080cb96acf20772e3c9436910c5a5b22 + pristine_git_object: 1f73b59f3e5cd74b8b87f70017c3b6704adaa1a2 + src/mistralai/client/models/promptscapability.py: + id: 15c552f53adf + last_write_checksum: sha1:c10ebeb4958239272315cb603e6039182875419a + pristine_git_object: f4ddf63ed454b2c10120b958bda8e859e8909a83 src/mistralai/client/models/prompttokensdetails.py: id: e6be33f2cd2d last_write_checksum: sha1:aa71bf6de6316b8754fb18f897b30051a2d4c70e @@ -5202,6 +5630,10 @@ trackedFiles: id: 545ab7f24523 last_write_checksum: sha1:5256ee8833f1e44717f19b6d2ee3aeff6dbe2dc4 pristine_git_object: 42e943a6f63dcfcfcfc3e994080e318c21a5e619 + src/mistralai/client/models/publicconnectionconfig.py: + id: 03c2460e04ac + last_write_checksum: sha1:faea37686e78fd3cc8a74371a3004d59ca57f4e9 + pristine_git_object: 94fd670836c95c432fd71f1f7dfc16323b50ee24 src/mistralai/client/models/query_workflow_execution_v1_workflows_executions_execution_id_queries_postop.py: id: 73826dbd3f5b last_write_checksum: sha1:5105618697e031bae45cf9f6d7c5227d9c08f155 @@ -5282,6 +5714,14 @@ trackedFiles: id: 4251cc3c7797 last_write_checksum: sha1:fad9dd6a100450397ee358842a31804c3552ca06 pristine_git_object: 890c5be1de611379c12d1525d596bc284e0e197d + src/mistralai/client/models/resourcescapability.py: + id: d109cd5fe17d + last_write_checksum: sha1:b7ebd5ed1b64ee944b0d8534ce1e1bffb3b545fd + pristine_git_object: 39bd1a0b7b48462199d1a7e3cc5351679a78295a + src/mistralai/client/models/resourcetype.py: + id: 58cbbc423f90 + last_write_checksum: sha1:05bedc14374e61522f42d1e655017ecffd6bc9ad + pristine_git_object: 435c917c25e30c6c329dc41a6ee8d7c731fa06f2 src/mistralai/client/models/resourcevisibility.py: id: b5819dd5f981 last_write_checksum: sha1:3c7e91baa8c8a0bb2ba55a6b7c14db04350278d7 @@ -5318,10 +5758,18 @@ trackedFiles: id: e41c04cf7422 last_write_checksum: sha1:e953cc08f43a7a4b8f143830e5308eb26d44f8ac pristine_git_object: ff36ebd72389228752297c1c9ec80deb7557430d + src/mistralai/client/models/rootscapability.py: + id: f1514b6dd416 + last_write_checksum: sha1:55eaee162031944b1a3d334cd2084ca39261de9f + pristine_git_object: 37b25d65f2bff9c8018bce9f82f9e918fd6bca76 src/mistralai/client/models/sampletype.py: id: a9309422fed7 last_write_checksum: sha1:86a61340a647696f6c35a82d945509b1c85aa6f7 pristine_git_object: dfec7cce1e22ab607b6a9e947fa940284426086d + src/mistralai/client/models/samplingcapability.py: + id: 0a7af0cc3968 + last_write_checksum: sha1:dc1c3d442c31adb176fd0d12a5963c850594eb15 + pristine_git_object: 46aa3be5192d2e9ea8cd81c5f078fc90f0d522a6 src/mistralai/client/models/scalarmetric.py: id: ae8eb1017da6 last_write_checksum: sha1:c85c3825e8f60eac8776e912425ed4f43b387ad6 @@ -5332,8 +5780,8 @@ trackedFiles: pristine_git_object: 2cb179eb22e9ac10e820ed276187cd863fc7a440 src/mistralai/client/models/scheduledefinition.py: id: 6ea58a356f77 - last_write_checksum: sha1:a394dee8c49c4a6c6ede7e27ca256a3c376e137b - pristine_git_object: 5810229349e4b84c88458fa729b4b1bce4d761cc + last_write_checksum: sha1:4102a73a034dc19c4ea209104a5531ab4bba9b11 + pristine_git_object: 3c018552dc5b883cc92ced39d4646fc6f13a1da2 src/mistralai/client/models/scheduledefinitionoutput.py: id: 69dc15b9a0d6 last_write_checksum: sha1:4dd8612486768de992731c044cb13b4c52f4622a @@ -5378,26 +5826,46 @@ trackedFiles: id: f96acbcd45f7 last_write_checksum: sha1:539caf622ef9e7579fdc82e7986dcc3a2aedae53 pristine_git_object: 8b9b10b51fe76de43895168df11e5bbcdfc29a62 + src/mistralai/client/models/searchindexresponse.py: + id: 054688d20a3b + last_write_checksum: sha1:6da75c25bd5104344915f4a3ab62ec1eb80e2a5e + pristine_git_object: 0e62aa32470e5f4d4b7fe892a8017a0d6a573e7c src/mistralai/client/models/security.py: id: c2ca0e2a36b7 last_write_checksum: sha1:28496d4ff921e8c2186072aad170c65836a4b8f8 pristine_git_object: 36b129533187283e4fdf53a67019b379b1e251fa + src/mistralai/client/models/servercapabilities.py: + id: 9e5832ea005a + last_write_checksum: sha1:88d632a3dc3e8fd328633278be15d0338f275559 + pristine_git_object: ccfbf932fc59fbd6289b78135114386a476e12e2 + src/mistralai/client/models/serverlocale.py: + id: 5b70fcb88050 + last_write_checksum: sha1:0e6898c0280308f4f17845826dbc110ff7e83f10 + pristine_git_object: 1b73a7494ee64f538c4374998a4e9de0825664e2 + src/mistralai/client/models/servertaskscapability.py: + id: fff9567cb403 + last_write_checksum: sha1:48c88c31c5b7928c7be018155863c0576db1b4c5 + pristine_git_object: 7d2c2927401f5c3c2fdca2980c00c174c1e94741 + src/mistralai/client/models/servertasksrequestscapability.py: + id: 23cc8415f619 + last_write_checksum: sha1:a57769f03d442fc70e5f448ee65876d1a2fff093 + pristine_git_object: 2568507f11f1450dd4419e5dca7d38c9a6ebfcd9 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 + last_write_checksum: sha1:287adc1c670f242ce722c20bd182f6313fa2b372 + pristine_git_object: 4260f1751826195f574a6b84bfdbd4d55b0a617f src/mistralai/client/models/sharingdelete.py: id: f5ecce372e06 - last_write_checksum: sha1:f993f4cc819a14985a70a31af7896115ee80af8a - pristine_git_object: 3472a50637d4582fa8945ec70b57ed12de88b99d + last_write_checksum: sha1:87b3c6e270147260b011eb3d705f84b0fbac1938 + pristine_git_object: 67399831d1f1ff7d7173ea5bf120b114caba6a06 src/mistralai/client/models/sharingrequest.py: id: 2439b732dfae - last_write_checksum: sha1:05e36cba36203bcc579a3b02538aed570cf22352 - pristine_git_object: 7c2d435c363bcd98aba97e120954ec1357524e34 + last_write_checksum: sha1:7439e7d30b6cb676f1edfa86148e4b5e3a8065a6 + pristine_git_object: 94de31c1d2072adfc838e0684cb3573d93df6f8a src/mistralai/client/models/signal_workflow_execution_v1_workflows_executions_execution_id_signals_postop.py: id: 16c54f54e60f last_write_checksum: sha1:57437b8a9d284f7e77459c319908ad0b8db33720 @@ -5466,6 +5934,18 @@ trackedFiles: id: 297e8905d5af last_write_checksum: sha1:e5695ca0ebdb0f02f3a0c527015df154a0c52b7f pristine_git_object: d480a219e935aaea91adc320de0003b562c0bbb5 + src/mistralai/client/models/taskselicitationcapability.py: + id: 19504f19f5f3 + last_write_checksum: sha1:2905488ab1c27912fda77ae08f649956ad8d442e + pristine_git_object: 768f36f1ac7497218c45f823de2662af399cd3db + src/mistralai/client/models/taskssamplingcapability.py: + id: fe3e6aaee007 + last_write_checksum: sha1:e6450ffcec733c2969b3de8873515fe74673576a + pristine_git_object: e051fd75ee3e87be6da8f51a30d0eee12b3b5814 + src/mistralai/client/models/taskstoolscapability.py: + id: ac9448f661ce + last_write_checksum: sha1:e7dd4fcefdd9f89bc7d093d2ded222f0b9e45c99 + pristine_git_object: 88d799c114d3e64e8628c8be43d68934a1b68754 src/mistralai/client/models/tempogettraceresponse.py: id: 8bb3c013aa76 last_write_checksum: sha1:ff35ba718f008554d79defc41dc02af5115c7ab0 @@ -5586,6 +6066,10 @@ trackedFiles: id: 69fcb691327a last_write_checksum: sha1:85bcd4a5d30aab54425bccec9c2374137fad6736 pristine_git_object: 9c55e7bb9db0be106d30b9bf37153aaf8d7b61ff + src/mistralai/client/models/toolexecutionconfiguration.py: + id: 1c9369616b21 + last_write_checksum: sha1:b802788ceb7246914638b2b26f5b053d33913306 + pristine_git_object: ce65ad31408abe1b8bbaa042b176b8555dbf8480 src/mistralai/client/models/toolexecutiondeltaevent.py: id: df8f17cf3e07 last_write_checksum: sha1:77da4c0bca920d4ea77a64faa039fb3c07df46ed @@ -5610,14 +6094,18 @@ trackedFiles: id: 15f1af161031 last_write_checksum: sha1:9557c9f6b7be4b6ac94d3316eb605e42aa8dc03c pristine_git_object: 0dc9e92f5dd27ff93d6de62a6879699ace4300a8 + src/mistralai/client/models/toolproperties.py: + id: 3a33561f76fc + last_write_checksum: sha1:b2059b8c5d6a619f4e637b2395a54a281178282b + pristine_git_object: d3bf9789b77b305a669833ba873fb70231c4c690 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/toolscapability.py: + id: 2feda23ea584 + last_write_checksum: sha1:56c273d54611752761b1e70f209001a6f9559347 + pristine_git_object: 94e5ddc80669d5c06c713c6e422d59a01009dd2f src/mistralai/client/models/trainingfile.py: id: 2edf9bce227d last_write_checksum: sha1:f72468d666e903a966c12273be5a64048dcd59a0 @@ -5654,14 +6142,10 @@ trackedFiles: 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/turbinemeta.py: + id: 084d588caa1e + last_write_checksum: sha1:4a0ffc6cecc9ad674ab4eab0b3bb017682beddc2 + pristine_git_object: 5084c05f7090f46e35bb63e6fd70c495df3c2044 src/mistralai/client/models/unarchive_workflow_v1_workflows_workflow_identifier_unarchive_putop.py: id: 9df426343c2c last_write_checksum: sha1:12d529f6703695653004ac5692f13daab13bf060 @@ -5694,6 +6178,10 @@ trackedFiles: id: 2a14ebf4ef57 last_write_checksum: sha1:dc63747af5ef650f6d5f5a99e447bebc41450e46 pristine_git_object: 6b7d24d465d34289f97aeb83dc036501883c9c7e + src/mistralai/client/models/update_schedule_v1_workflows_schedules_schedule_id_patchop.py: + id: 6aaa918af7f4 + last_write_checksum: sha1:7bb83c6f98e4314061724c7793e979a47b3f5af7 + pristine_git_object: 5e3a1be42867c2ca00f4c5103ac318dcd5909e44 src/mistralai/client/models/update_voice_v1_audio_voices_voice_id_patchop.py: id: 399da05bd75e last_write_checksum: sha1:aca7b6539571a8111e8f1abb7f90dde1e461d4bc @@ -5712,8 +6200,8 @@ trackedFiles: pristine_git_object: 7bb9686b9b542c47ac25fb6780017b5739829b1e src/mistralai/client/models/updateconnectorrequest.py: id: a761cd154109 - last_write_checksum: sha1:1a943da5e32a0eec70de5a15b56de278082bbc25 - pristine_git_object: 145091d4ce119383e611d845f52dbb4489b78ddf + last_write_checksum: sha1:cff0bc420926e5798c7d9a4dbc6055cf99db32c8 + pristine_git_object: 81f09ea9a124d773de786310c25aa1415fe09da1 src/mistralai/client/models/updatedatasetrecordpayloadrequest.py: id: bd45f357a538 last_write_checksum: sha1:774ba70d9f417e84b546b9f4c5c85eb2876dd56d @@ -5732,8 +6220,8 @@ trackedFiles: pristine_git_object: e878c8764774e4420a85145196cfb93c32d108fa src/mistralai/client/models/updatedocumentrequest.py: id: a8cfda07d337 - last_write_checksum: sha1:612b16cee373b0e395f51eb03b3dff70d7988148 - pristine_git_object: 5f67ea697ac8d4449c76863a8e4f42e0bd197908 + last_write_checksum: sha1:f282948c29e5ef5bdb598e02923a44c0c4215e7a + pristine_git_object: 07c6f5e36119b84fab821967d0b054572fd9d45c src/mistralai/client/models/updateinvocationbody.py: id: b8558eff0be0 last_write_checksum: sha1:ea486ca10c1165b9f3dd40c005cc98bc6b0e937f @@ -5774,22 +6262,34 @@ trackedFiles: id: 15df3c7368ab last_write_checksum: sha1:4acbbd9e47cf9b351336d552488d617270d37758 pristine_git_object: 5fe796db923badd9fb85dc4080a30496ed2b419b + src/mistralai/client/models/vespaschemaresponse.py: + id: fbab188e672e + last_write_checksum: sha1:ad669056fa9c61f0ef7f33430a643fd09a41a788 + pristine_git_object: 440967d1aa77338d7526df06a7322d07fcfaf45d + src/mistralai/client/models/vespasearchindexinforesponse.py: + id: ee7484f75a7c + last_write_checksum: sha1:08714193f3bca9099c051dc3799e04fef2a03b52 + pristine_git_object: a3cce35408346525219693f6b19ae706b20fd743 + src/mistralai/client/models/voiceappearance.py: + id: 945a81bc2582 + last_write_checksum: sha1:c2370a4dfc294932987817b7e4093c7526a53d27 + pristine_git_object: a9d4f2a820ed8b309988cc2221e3f63295094225 src/mistralai/client/models/voicecreaterequest.py: id: 9a1752117dec - last_write_checksum: sha1:6ddd5af32737a8b0597f3fff476f151dbd039e50 - pristine_git_object: 99df178d594f4c5b029dd9dc027e5e1afc3f8dec + last_write_checksum: sha1:f361c10ac84b2696eae0c3d13e3789fa53ee8b20 + pristine_git_object: ec94523f54d9dd0083b685cc0531e27bc251757e 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 + last_write_checksum: sha1:695a243563d99456c7b660cc16001d19ec6e672f + pristine_git_object: 818bd2578aa49060e889eaa815de1f851dcb2088 src/mistralai/client/models/voiceupdaterequest.py: id: 798f8ff225de - last_write_checksum: sha1:1e4345add08618310635c7b79a8bf3991df98d99 - pristine_git_object: 717316b0033706f1f5fc8fccf3f0159bbc82e8a0 + last_write_checksum: sha1:d4165da1079fe5cfb9cacd8fb1a6837c2ec23119 + pristine_git_object: 4239d01699c4147d752c8c3448a3619ff6a8ff3a src/mistralai/client/models/wandbintegration.py: id: 4823c1e80942 last_write_checksum: sha1:b836b2c829f16a00221354c44f55b672eefc3aa0 @@ -5818,6 +6318,26 @@ trackedFiles: id: 34623036478d last_write_checksum: sha1:0516152c52c443b8b94c830f81f591798f08ac92 pristine_git_object: d2f3db1fb851353d21ce5bbec5e8d2d4b9afabfa + src/mistralai/client/models/workflowbulkarchiverequest.py: + id: 0e0bf7feeede + last_write_checksum: sha1:4d1c8a767f73778f6f2efb1e4d7992df62f872f5 + pristine_git_object: fb2089192ca567a095b48f56f429df288ac750dd + src/mistralai/client/models/workflowbulkarchiveresponse.py: + id: 132f69064b86 + last_write_checksum: sha1:bdb96ed85fd2579c0a41407f9a4795f38e63dedc + pristine_git_object: 506724b3fec8383ef7b7cd8dc7b16e01380e0b78 + src/mistralai/client/models/workflowbulkerror.py: + id: 61b9b62c7fd6 + last_write_checksum: sha1:dd0bed42db7b7ba32c06c3609163681073ee3bb9 + pristine_git_object: 076c938a5223fa19e4929afbb4e2784f3a678745 + src/mistralai/client/models/workflowbulkunarchiverequest.py: + id: b04414883bed + last_write_checksum: sha1:3219afc9903f4f9b7c4eb7e426a74a24ff990c0d + pristine_git_object: 6ffecd91dd3271d311370a6fb07f3539f55eb267 + src/mistralai/client/models/workflowbulkunarchiveresponse.py: + id: 34554c6df2e3 + last_write_checksum: sha1:dc1d73453a4e59deef573a211ccb7e69c5e55cb8 + pristine_git_object: f2ab37272302e036bfdc4e11bd4d76096b4f2c90 src/mistralai/client/models/workflowcodedefinition.py: id: 36fd5b898ddd last_write_checksum: sha1:bd77f4a5e5b32892f806278bcd6dc2d951f10629 @@ -5952,8 +6472,8 @@ trackedFiles: pristine_git_object: 62c379d91f6f8e0b2842b11208513635160a0c02 src/mistralai/client/models/workflowschedulelistresponse.py: id: e5247c5183bb - last_write_checksum: sha1:37cea2f0f3220331105f9454169f1ea49ed1b51a - pristine_git_object: 3c9eb3d7f445a0ec010340aeae788cf47e034628 + last_write_checksum: sha1:10d416a4157ccfd9f60479ea0cd8e4daaaa49cc3 + pristine_git_object: 21341ecad5cb574436d8d2e8beab695f3e637eb0 src/mistralai/client/models/workflowschedulepauserequest.py: id: da7b9a522bcb last_write_checksum: sha1:079663a44a62694c48dd839ef1d3b4cd6fb7429b @@ -5966,6 +6486,10 @@ trackedFiles: id: c77172c4a9f6 last_write_checksum: sha1:dd347319557279367f8ccde9158dec6c4586f528 pristine_git_object: d74ba1dae81bccffa812df2a64babad0a61af787 + src/mistralai/client/models/workflowscheduleupdaterequest.py: + id: 72ca0f5e6c08 + last_write_checksum: sha1:ad25f903339edb6d9d018ba280a39789b81ffb28 + pristine_git_object: b43dc96f32704b4821936189a3f6a8bdcbd77799 src/mistralai/client/models/workflowtaskfailedattributes.py: id: c4c09c4d5ea7 last_write_checksum: sha1:b1faee3ed43b88829ca68f5cd642f24d8f1fe9f5 @@ -6004,52 +6528,56 @@ trackedFiles: pristine_git_object: 81030e21fe08c8ac1401ac6fb0a105f985985cf0 src/mistralai/client/models_.py: id: 1d277958a843 - last_write_checksum: sha1:a5e45504b21a4126a41b59c52be2050cd8215cff - pristine_git_object: 2a00325f9205bec7b5ca6ff8df2915593d12bd0e + last_write_checksum: sha1:13c8bd4907bf201957c2a9da00616618ca13e0db + pristine_git_object: 6263ead9a2934b431111fe1a80d1ba2eccc48f42 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 + last_write_checksum: sha1:8d503853c2571bde3cc8bc205b86fe519788a331 + pristine_git_object: e0bc4e0efc94f3ae143b5a1baf1c2968b3e2967b 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 + last_write_checksum: sha1:77d6bd45daba9879a753768896dac249eb645996 + pristine_git_object: 934b2374571b475a573d38e59c8fdf40aa5ba3b8 src/mistralai/client/records.py: id: 10f90c990bd8 - last_write_checksum: sha1:3b54fb25751ef4d12a8263bc6f29999a42ac4f61 - pristine_git_object: 2ac04c2fcc4277af7abd42a2a0cacdbba741dd4d + last_write_checksum: sha1:6401ec613de8f53368ca49cbed9a59b9204f8b5b + pristine_git_object: 5a4c3c8463a8245dc5de73c2cf93ba85f870ff5e src/mistralai/client/runs.py: id: 4297d58aeb21 - last_write_checksum: sha1:65b82f507ef945cd17f5f4fc2767d6dab3e6909b - pristine_git_object: d1a242fb2bd517b27656e2f60eef07421418cb6e + last_write_checksum: sha1:70aa67885af67c0a01c91028dad0a7beb4151f44 + pristine_git_object: 01507e33e8b1fb37fbd778fcad8abf3a5f1e8d7e src/mistralai/client/schedules.py: id: d3b4fe452390 - last_write_checksum: sha1:946fac6872a9994efbea349a91c0fd14485859b0 - pristine_git_object: 9b013acdc092797cd78e9be3f50666f4a8203fd9 + last_write_checksum: sha1:573ca09239d46817b60637a6348e02bebb5ca617 + pristine_git_object: c56e497365a765be6d3bc794aab67d63fa9f7cd2 src/mistralai/client/sdk.py: id: 48edbcb38d7e - last_write_checksum: sha1:a606046063cd946633918efa1662846c987c9b7e - pristine_git_object: 03338f46bd3d32f1770ed9b6e4d30f9d707867df + last_write_checksum: sha1:6194b5d4e8259276a5a4a581ef478e35948a59df + pristine_git_object: 86de8dd9f4f2dbd54bc84aec74ae3e44cb1d81b7 src/mistralai/client/sdkconfiguration.py: id: b7dd68a0235e last_write_checksum: sha1:c6944f12c6fdc992d43db943b24c8c90854cde5e pristine_git_object: 712e92e05c7fd3016431ec62ecb7b7789c8b7071 + src/mistralai/client/search_indexes.py: + id: c5a0a7df993a + last_write_checksum: sha1:6e0fcf67162312f3ccba44d1e1f2983bd5635ae8 + pristine_git_object: 522ae338029948d81686f2481287d4745f9737ce src/mistralai/client/speech.py: id: 5c1f1109aa5e - last_write_checksum: sha1:3cbd55d0df062a0de6e93c32816dd6e805018150 - pristine_git_object: 4893684b70781a097845f48c4b0a09b4fcb38dd5 + last_write_checksum: sha1:22ce4e2c43162a21f01dd43e66c3d92945560e72 + pristine_git_object: 42cb1bbb47ac7daf68103b9934d8067f1fda6292 src/mistralai/client/transcriptions.py: id: 75b45780c978 - last_write_checksum: sha1:c72a2c07abd80bc78554669e549ded4ec2b027e7 - pristine_git_object: d84b59f8efbe0adaff62dd4a95a9c7d9bb117d10 + last_write_checksum: sha1:897eee298c4d342650ef73a7c7bcfd640752bba6 + pristine_git_object: b63fd5d0d4c528f9df71c7772ed8e0af08e8ae74 src/mistralai/client/types/__init__.py: id: 000b943f821c last_write_checksum: sha1:12a4ace69cbc63f1125eeddf901afed7cdf378b0 @@ -6136,16 +6664,16 @@ trackedFiles: pristine_git_object: 2469a9f310a37a7170b54853715274f13d38901c src/mistralai/client/voices.py: id: ab76b1377d79 - last_write_checksum: sha1:a8009497c11da1e145fcc462ca5d6e7dcfd6e0f1 - pristine_git_object: e19d5d5a184d08110592147ba04c570cbb2b291a + last_write_checksum: sha1:d106cddf60390d93ae4d2f410a5f1f0e4ce0d0de + pristine_git_object: 2810b922fbc967bba982127ce5bc5f086640e7fd src/mistralai/client/workflows.py: id: e2a0381191f6 - last_write_checksum: sha1:b0644f87b63f179114350f2d90a2ec646cd72931 - pristine_git_object: 2693b05b7716298daafffbc76c7358feb49923c6 + last_write_checksum: sha1:4389be2822f4bd5f439cd752a2b91a7744c72b10 + pristine_git_object: a601594656c0cd542a51a996c189b641a28c4965 src/mistralai/client/workflows_events.py: id: 6d4f674ce8ef - last_write_checksum: sha1:a6362c45808a5fac5bc0a8f58c29b4d9291b9a7d - pristine_git_object: 71e44ac74c571debabf7a8b811f8c244f2b7c30a + last_write_checksum: sha1:7ea1bf2efb7a2113a672a4655c97210d29b6ed29 + pristine_git_object: fbf5bc114974bdca07d59dd0c0a1c4f8a8e5e570 examples: list_models_v1_models_get: speakeasy-default-list-models-v1-models-get: @@ -7997,10 +8525,10 @@ examples: 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/"} + application/json: {"protocol": "mcp", "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"} + 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", "owner_type": 3, "visibility": "private", "private_tool_execution": true, "mistral": false} "422": application/json: {} connector_list_v1: @@ -8034,9 +8562,10 @@ examples: query: fetch_customer_data: false fetch_connection_secrets: false + fetch_user_data: false responses: "200": - 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"} + 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", "owner_type": 4, "visibility": "shared_org", "private_tool_execution": false, "mistral": false} "422": application/json: {} connector_update_v1: @@ -8048,7 +8577,7 @@ examples: application/json: {} responses: "200": - 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"} + 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", "owner_type": 3, "visibility": "shared_global", "private_tool_execution": false, "mistral": false} "422": application/json: {} connector_delete_v1: @@ -8473,6 +9002,8 @@ examples: responses: "200": application/json: {"schedules": []} + "422": + application/json: {} schedule_workflow_v1_workflows_schedules_post: speakeasy-default-schedule-workflow-v1-workflows-schedules-post: requestBody: @@ -8576,7 +9107,7 @@ examples: fetch_default: false responses: "200": - application/json: {"credentials": [{"name": "", "authentication_type": "oauth2", "is_default": false}]} + application/json: {"credentials": [{"name": "", "authentication_type": "oauth2", "scope": "workspace", "is_default": false}]} "422": application/json: {} connector_create_or_update_organization_credentials_v1: @@ -8714,16 +9245,147 @@ examples: responses: "422": application/json: {} + libraries_patch_v1: + speakeasy-default-libraries-patch-v1: + parameters: + path: + library_id: "74a30b7a-ba52-49f7-a8a3-7157e1adf565" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "29be96b0-9e62-49f2-ad68-ea214dda839a", "name": "", "created_at": "2025-01-03T19:54:12.078Z", "updated_at": "2025-08-14T09:50:03.685Z", "owner_id": "5d60a792-57b9-45a8-9099-d3a656c15c5e", "owner_type": "", "total_size": 102530, "nb_documents": 298019, "chunk_size": 87858} + "422": + application/json: {} + libraries_documents_patch_v1: + speakeasy-default-libraries-documents-patch-v1: + parameters: + path: + library_id: "2a41249e-52ca-4436-b755-25ce3a9bfb53" + document_id: "bc26fa54-e5d9-4269-bedf-86bed5471c7d" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "765f96ad-ca4d-443c-8614-0787ad1baedc", "library_id": "3ef9de21-c727-4a66-8495-9174b23092a7", "hash": "", "mime_type": "", "extension": null, "size": 756040, "name": "", "created_at": "2026-06-24T13:02:34.703Z", "process_status": "noop", "uploaded_by_id": "7048d94f-55be-4b1f-ab73-3f0f5a005ed9", "uploaded_by_type": "", "processing_status": "", "tokens_processing_total": 943369} + "422": + application/json: {} + connector_activate_for_organization_v1: + speakeasy-default-connector-activate-for-organization-v1: + parameters: + path: + connector_id: "a91bb4ec-caab-4cf2-be03-84b8343f4643" + responses: + "200": + application/json: {"message": ""} + "422": + application/json: {} + connector_deactivate_for_organization_v1: + speakeasy-default-connector-deactivate-for-organization-v1: + parameters: + path: + connector_id: "8f4c1089-2a37-44b3-a3c4-830ca7a0e439" + responses: + "200": + application/json: {"message": ""} + "422": + application/json: {} + connector_activate_for_workspace_v1: + speakeasy-default-connector-activate-for-workspace-v1: + parameters: + path: + connector_id: "2adfa8af-3618-41a9-8980-e5ea1486e58e" + responses: + "200": + application/json: {"message": ""} + "422": + application/json: {} + connector_deactivate_for_workspace_v1: + speakeasy-default-connector-deactivate-for-workspace-v1: + parameters: + path: + connector_id: "15b00e98-a9e7-4582-b0fc-87d28c3dac04" + responses: + "200": + application/json: {"message": ""} + "422": + application/json: {} + connector_activate_for_user_v1: + speakeasy-default-connector-activate-for-user-v1: + parameters: + path: + connector_id: "cd4fb4d2-de68-451f-8f2a-57fe39b33d96" + responses: + "200": + application/json: {"message": ""} + "422": + application/json: {} + connector_deactivate_for_user_v1: + speakeasy-default-connector-deactivate-for-user-v1: + parameters: + path: + connector_id: "99c6ed86-e6bb-40ed-b6ee-d22ba791a68f" + responses: + "200": + application/json: {"message": ""} + "422": + application/json: {} + get_search_indexes_v1_rag_search_index_get: + speakeasy-default-get-search-indexes-v1-rag-search-index-get: + responses: + "200": + application/json: [{"id": "07d38908-4a10-4d0f-96d0-001229ae40a6", "name": "", "creator_id": "", "document_count": 47250, "status": "online", "created_at": "2025-05-05T18:06:12.781Z", "modified_at": "2024-11-11T19:44:30.545Z", "index": {"type": "vespa", "k8s_cluster": "", "k8s_namespace": "", "vespa_instance_name": "", "schemas": []}}] + register_search_index_v1_rag_search_index_put: + speakeasy-default-register-search-index-v1-rag-search-index-put: + requestBody: + application/json: {"name": "", "status": "offline", "index": {"type": "vespa", "k8s_cluster": "", "k8s_namespace": "", "vespa_instance_name": "", "schemas": []}} + responses: + "200": + application/json: {"id": "aeab57c4-7bc2-4d90-b739-da6d58fffa60", "name": "", "creator_id": "", "document_count": 577632, "status": "offline", "created_at": "2024-12-18T16:38:29.006Z", "modified_at": "2025-12-02T12:13:54.773Z", "index": {"type": "vespa", "k8s_cluster": "", "k8s_namespace": "", "vespa_instance_name": "", "schemas": [{"name": "", "document_count": 745815}]}} + "422": + application/json: {} + bulk_archive_workflows_v1_workflows_archive_put: + speakeasy-default-bulk-archive-workflows-v1-workflows-archive-put: + requestBody: + application/json: {"workflow_ids": []} + responses: + "200": + application/json: {"archived": [{"id": "7d8a39b0-ac85-4a75-bc3c-a21d9d086958", "name": "", "display_name": "Dominic_Wisozk95", "type": "code", "customer_id": "85b3fb51-c815-4b9e-b51b-8d81a405b5e3", "workspace_id": "7dd61975-6390-409d-b7f3-839b110cbb97", "available_in_chat_assistant": false, "is_technical": false, "on_behalf_of": false, "archived": false}]} + "422": + application/json: {} + bulk_unarchive_workflows_v1_workflows_unarchive_put: + speakeasy-default-bulk-unarchive-workflows-v1-workflows-unarchive-put: + requestBody: + application/json: {"workflow_ids": []} + responses: + "200": + application/json: {"unarchived": []} + "422": + application/json: {} + get_schedule_v1_workflows_schedules__schedule_id__get: + speakeasy-default-get-schedule-v1-workflows-schedules-schedule-id-get: + parameters: + path: + schedule_id: "" + responses: + "200": + application/json: {"input": "", "schedule_id": "", "workflow_name": "", "paused": false} + "422": + application/json: {} + update_schedule_v1_workflows_schedules__schedule_id__patch: + speakeasy-default-update-schedule-v1-workflows-schedules-schedule-id-patch: + parameters: + path: + schedule_id: "" + requestBody: + application/json: {"schedule": {}} + responses: + "200": + application/json: {"schedule_id": ""} + "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 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index a246d5a7..86507823 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 2.4.5 + version: 2.4.7 additionalDependencies: dev: pytest: ^8.2.2 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index aa443ef1..f5b175a6 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,50 +1,51 @@ -speakeasyVersion: 1.761.1 +speakeasyVersion: 1.763.6 sources: mistral-azure-source: sourceNamespace: mistral-openapi-azure - sourceRevisionDigest: sha256:a6918148cb6fdd9108b7bef0ef41fe5c9e79b18c65c0b52fc4d2afecf6db2d4d - sourceBlobDigest: sha256:dded6b429a29c2889469b10d19aecd41be2db06cde1a8408510120c8abfd9553 + sourceRevisionDigest: sha256:faccd49c0a52252b8dfcc666a6a1ba3fa5c7eb36f93c58c9b49547c98a254918 + sourceBlobDigest: sha256:b6f756ef1d57d93defe29a9f6789c746bd0c3b09e3f9e5fa0344ddf9ca47e5d7 tags: - latest - - speakeasy-sdk-regen-1773084953 + - speakeasy-mistralai-azure-sdk-26292833044-1 mistral-google-cloud-source: sourceNamespace: mistral-openapi-google-cloud - sourceRevisionDigest: sha256:b2406e82ec4ce411afc0c307d5a037c7737388bcc696bbb41884fe54e22831c9 - sourceBlobDigest: sha256:795c0e010501e770b07cd28f1d0253cdb8f1419381e828b26575fdf149c022da + sourceRevisionDigest: sha256:34edde5edcaf43acc036c9635cf4c60ce4e86f49b3fa2bed8960b995454e8d7c + sourceBlobDigest: sha256:4e9e44f332073700612c1311c0d844241cc4b206140b82d5951879e1efdb0f2d tags: - latest - - speakeasy-sdk-regen-1773084660 + - speakeasy-mistralai-gcp-sdk-26292830187-1 mistral-openapi: sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:6b325264f8e8a60caa875776438b07d4eb5b56283da0796b283e9c5597810e22 - sourceBlobDigest: sha256:11d21b003c903f5539d5d7a79cf8fe17d1d284b48e47da0009eac3866ad58899 + sourceRevisionDigest: sha256:0e18f147a374ca3cc89ea5d05181e8e333f2724201da419e1cccf59192285a9e + sourceBlobDigest: sha256:e2a240443dcc2f25c798e66ba4ba17caec1e7fd80ccca52112e058d08e293e4d tags: - latest + - speakeasy-mistralai-sdk-26292816554-1 targets: mistralai-azure-sdk: source: mistral-azure-source sourceNamespace: mistral-openapi-azure - sourceRevisionDigest: sha256:a6918148cb6fdd9108b7bef0ef41fe5c9e79b18c65c0b52fc4d2afecf6db2d4d - sourceBlobDigest: sha256:dded6b429a29c2889469b10d19aecd41be2db06cde1a8408510120c8abfd9553 + sourceRevisionDigest: sha256:faccd49c0a52252b8dfcc666a6a1ba3fa5c7eb36f93c58c9b49547c98a254918 + sourceBlobDigest: sha256:b6f756ef1d57d93defe29a9f6789c746bd0c3b09e3f9e5fa0344ddf9ca47e5d7 codeSamplesNamespace: mistral-openapi-azure-code-samples - codeSamplesRevisionDigest: sha256:b7620f11d5669423730c5790ef4a72bba3ab46dd453e6685edf420053abbcb30 + codeSamplesRevisionDigest: sha256:aecd1edc929a931b5f9ce9013142d15163e9f4b9f6e11d96e96123177edd0d62 mistralai-gcp-sdk: source: mistral-google-cloud-source sourceNamespace: mistral-openapi-google-cloud - sourceRevisionDigest: sha256:b2406e82ec4ce411afc0c307d5a037c7737388bcc696bbb41884fe54e22831c9 - sourceBlobDigest: sha256:795c0e010501e770b07cd28f1d0253cdb8f1419381e828b26575fdf149c022da + sourceRevisionDigest: sha256:34edde5edcaf43acc036c9635cf4c60ce4e86f49b3fa2bed8960b995454e8d7c + sourceBlobDigest: sha256:4e9e44f332073700612c1311c0d844241cc4b206140b82d5951879e1efdb0f2d codeSamplesNamespace: mistral-openapi-google-cloud-code-samples - codeSamplesRevisionDigest: sha256:c5a968a0454378d7f03ace500b309c0c709ea0b88d79700091d9ca7ea82c55a2 + codeSamplesRevisionDigest: sha256:5da37f5c1b536a390868432838e6bcb81db4a4701a44b28f19c6ebb64c3c499f mistralai-sdk: source: mistral-openapi sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:6b325264f8e8a60caa875776438b07d4eb5b56283da0796b283e9c5597810e22 - sourceBlobDigest: sha256:11d21b003c903f5539d5d7a79cf8fe17d1d284b48e47da0009eac3866ad58899 + sourceRevisionDigest: sha256:0e18f147a374ca3cc89ea5d05181e8e333f2724201da419e1cccf59192285a9e + sourceBlobDigest: sha256:e2a240443dcc2f25c798e66ba4ba17caec1e7fd80ccca52112e058d08e293e4d codeSamplesNamespace: mistral-openapi-code-samples - codeSamplesRevisionDigest: sha256:95c443855a95966259bd108beec0cbdb8238f6f753dc4b021bf833d398e86c0c + codeSamplesRevisionDigest: sha256:33fc2a349a4e8dfc5211c638cc2c36585d844ba4bd7ebfb2fa17cbe5477a9d34 workflow: workflowVersion: 1.0.0 - speakeasyVersion: 1.761.1 + speakeasyVersion: 1.763.6 sources: mistral-azure-source: inputs: diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index 5e708727..d7039dba 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -1,5 +1,5 @@ workflowVersion: 1.0.0 -speakeasyVersion: 1.761.1 +speakeasyVersion: 1.763.6 sources: mistral-azure-source: inputs: diff --git a/README.md b/README.md index 2a3bedff..31e0eeb0 100644 --- a/README.md +++ b/README.md @@ -513,6 +513,12 @@ print(res.choices[0].message.content) * [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. +* [activate_for_organization](docs/sdks/connectors/README.md#activate_for_organization) - Activate a connector for an organization. +* [deactivate_for_organization](docs/sdks/connectors/README.md#deactivate_for_organization) - Deactivate a connector for an organization. +* [activate_for_workspace](docs/sdks/connectors/README.md#activate_for_workspace) - Activate a connector for a workspace. +* [deactivate_for_workspace](docs/sdks/connectors/README.md#deactivate_for_workspace) - Deactivate a connector for a workspace. +* [activate_for_user](docs/sdks/connectors/README.md#activate_for_user) - Activate a connector for the current user. +* [deactivate_for_user](docs/sdks/connectors/README.md#deactivate_for_user) - Deactivate a connector for the current user. * [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. @@ -550,6 +556,7 @@ print(res.choices[0].message.content) * [get](docs/sdks/libraries/README.md#get) - Detailed information about a specific Library. * [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. +* [~~libraries_update_v1~~](docs/sdks/libraries/README.md#libraries_update_v1) - Update a library. :warning: **Deprecated** #### [Beta.Libraries.Accesses](docs/sdks/accesses/README.md) @@ -563,6 +570,7 @@ print(res.choices[0].message.content) * [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. +* [~~libraries_documents_update_v1~~](docs/sdks/documents/README.md#libraries_documents_update_v1) - Update the metadata of a specific document. :warning: **Deprecated** * [delete](docs/sdks/documents/README.md#delete) - Delete a document. * [text_content](docs/sdks/documents/README.md#text_content) - Retrieve the text content of a specific document. * [status](docs/sdks/documents/README.md#status) - Retrieve the processing status of a specific document. @@ -635,6 +643,11 @@ print(res.choices[0].message.content) * [register](docs/sdks/ingestionpipelineconfigurations/README.md#register) - Register Config * [update_run_info](docs/sdks/ingestionpipelineconfigurations/README.md#update_run_info) - Update Run Info +### [Beta.Rag.SearchIndexes](docs/sdks/searchindexes/README.md) + +* [list](docs/sdks/searchindexes/README.md#list) - Get Search Indexes +* [register](docs/sdks/searchindexes/README.md#register) - Register Search Index + ### [Chat](docs/sdks/chat/README.md) * [complete](docs/sdks/chat/README.md#complete) - Chat Completion @@ -700,6 +713,8 @@ print(res.choices[0].message.content) * [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 +* [bulk_archive_workflows](docs/sdks/workflows/README.md#bulk_archive_workflows) - Bulk Archive Workflows +* [bulk_unarchive_workflows](docs/sdks/workflows/README.md#bulk_unarchive_workflows) - Bulk Unarchive Workflows * [archive_workflow](docs/sdks/workflows/README.md#archive_workflow) - Archive Workflow * [unarchive_workflow](docs/sdks/workflows/README.md#unarchive_workflow) - Unarchive Workflow @@ -744,7 +759,9 @@ print(res.choices[0].message.content) * [get_schedules](docs/sdks/schedules/README.md#get_schedules) - Get Schedules * [schedule_workflow](docs/sdks/schedules/README.md#schedule_workflow) - Schedule Workflow +* [get_schedule](docs/sdks/schedules/README.md#get_schedule) - Get Schedule * [unschedule_workflow](docs/sdks/schedules/README.md#unschedule_workflow) - Unschedule Workflow +* [update_schedule](docs/sdks/schedules/README.md#update_schedule) - Update Schedule * [pause_schedule](docs/sdks/schedules/README.md#pause_schedule) - Pause Schedule * [resume_schedule](docs/sdks/schedules/README.md#resume_schedule) - Resume Schedule @@ -958,8 +975,8 @@ with Mistral( **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.* +* [`HTTPValidationError`](./src/mistralai/client/errors/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 130 of 197 methods.* +* [`ObservabilityError`](./src/mistralai/client/errors/observabilityerror.py): Bad Request - Invalid request parameters or data. Applicable to 41 of 197 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. diff --git a/RELEASES.md b/RELEASES.md index 2f69eacf..f21a0dc2 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -638,4 +638,14 @@ Based on: ### Generated - [python v2.4.5] . ### Releases -- [PyPI v2.4.5] https://pypi.org/project/mistralai/2.4.5 - . \ No newline at end of file +- [PyPI v2.4.5] https://pypi.org/project/mistralai/2.4.5 - . + +## 2026-05-22 14:12:57 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.763.6 (2.884.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.4.7] . +### Releases +- [PyPI v2.4.7] https://pypi.org/project/mistralai/2.4.7 - . \ No newline at end of file diff --git a/docs/models/authenticationconfiguration.md b/docs/models/authenticationconfiguration.md index 6644875e..cdd1e55f 100644 --- a/docs/models/authenticationconfiguration.md +++ b/docs/models/authenticationconfiguration.md @@ -7,4 +7,5 @@ | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `name` | *str* | :heavy_check_mark: | N/A | | `authentication_type` | [models.OutboundAuthenticationType](../models/outboundauthenticationtype.md) | :heavy_check_mark: | N/A | +| `scope` | [models.ConsumerType](../models/consumertype.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/clientcapabilities.md b/docs/models/clientcapabilities.md new file mode 100644 index 00000000..236bb0c4 --- /dev/null +++ b/docs/models/clientcapabilities.md @@ -0,0 +1,15 @@ +# ClientCapabilities + +Capabilities a client may support. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `experimental` | Dict[str, Dict[str, *Any*]] | :heavy_minus_sign: | N/A | +| `sampling` | [OptionalNullable[models.SamplingCapability]](../models/samplingcapability.md) | :heavy_minus_sign: | N/A | +| `elicitation` | [OptionalNullable[models.ElicitationCapability]](../models/elicitationcapability.md) | :heavy_minus_sign: | N/A | +| `roots` | [OptionalNullable[models.RootsCapability]](../models/rootscapability.md) | :heavy_minus_sign: | N/A | +| `tasks` | [OptionalNullable[models.ClientTasksCapability]](../models/clienttaskscapability.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/clienttaskscapability.md b/docs/models/clienttaskscapability.md new file mode 100644 index 00000000..9008ba61 --- /dev/null +++ b/docs/models/clienttaskscapability.md @@ -0,0 +1,13 @@ +# ClientTasksCapability + +Capability for client tasks operations. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `list` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `cancel` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `requests` | [OptionalNullable[models.ClientTasksRequestsCapability]](../models/clienttasksrequestscapability.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/clienttasksrequestscapability.md b/docs/models/clienttasksrequestscapability.md new file mode 100644 index 00000000..8dac48a4 --- /dev/null +++ b/docs/models/clienttasksrequestscapability.md @@ -0,0 +1,12 @@ +# ClientTasksRequestsCapability + +Capability for tasks requests operations. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `sampling` | [OptionalNullable[models.TasksSamplingCapability]](../models/taskssamplingcapability.md) | :heavy_minus_sign: | N/A | +| `elicitation` | [OptionalNullable[models.TasksElicitationCapability]](../models/taskselicitationcapability.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/connectionconfigtype.md b/docs/models/connectionconfigtype.md new file mode 100644 index 00000000..8db3ea64 --- /dev/null +++ b/docs/models/connectionconfigtype.md @@ -0,0 +1,19 @@ +# ConnectionConfigType + +## Example Usage + +```python +from mistralai.client.models import ConnectionConfigType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ConnectionConfigType = "mcp" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"mcp"` +- `"turbine"` +- `"eolienne"` diff --git a/docs/models/turbinetoolmeta.md b/docs/models/connectionpreference.md similarity index 65% rename from docs/models/turbinetoolmeta.md rename to docs/models/connectionpreference.md index 2f61a2c4..e069233f 100644 --- a/docs/models/turbinetoolmeta.md +++ b/docs/models/connectionpreference.md @@ -1,11 +1,11 @@ -# TurbineToolMeta +# ConnectionPreference ## 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 +| `name` | *str* | :heavy_check_mark: | N/A | +| `tool_configuration` | [models.ToolExecutionConfiguration](../models/toolexecutionconfiguration.md) | :heavy_check_mark: | N/A | +| `is_default` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `consumer_type` | [OptionalNullable[models.ConsumerType]](../models/consumertype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connector.md b/docs/models/connector.md index 29f8ad07..45aafa1e 100644 --- a/docs/models/connector.md +++ b/docs/models/connector.md @@ -3,13 +3,30 @@ ## 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 +| 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 | +| `protocol` | [Optional[models.ConnectorProtocol]](../models/connectorprotocol.md) | :heavy_minus_sign: | N/A | +| `icon_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `server_card` | [OptionalNullable[models.MCPServerCard]](../models/mcpservercard.md) | :heavy_minus_sign: | N/A | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `owner_type` | [models.ResourceType](../models/resourcetype.md) | :heavy_check_mark: | N/A | +| `visibility` | [models.ResourceVisibility](../models/resourcevisibility.md) | :heavy_check_mark: | N/A | +| `locale` | [OptionalNullable[models.ConnectorLocale]](../models/connectorlocale.md) | :heavy_minus_sign: | N/A | +| `system_prompt` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `supported_auth_methods` | List[[models.PublicAuthenticationMethod](../models/publicauthenticationmethod.md)] | :heavy_minus_sign: | N/A | +| `connection_preferences` | List[[models.ConnectionPreference](../models/connectionpreference.md)] | :heavy_minus_sign: | N/A | +| `connection_credentials` | List[[models.AuthenticationConfiguration](../models/authenticationconfiguration.md)] | :heavy_minus_sign: | N/A | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `private_tool_execution` | *bool* | :heavy_check_mark: | N/A | +| `mistral` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `is_authenticated` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `tools` | List[[models.ConnectorTool](../models/connectortool.md)] | :heavy_minus_sign: | N/A | +| `system_prompt_route` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `connection_config` | [OptionalNullable[models.PublicConnectionConfig]](../models/publicconnectionconfig.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connectoractivatefororganizationv1request.md b/docs/models/connectoractivatefororganizationv1request.md new file mode 100644 index 00000000..40469996 --- /dev/null +++ b/docs/models/connectoractivatefororganizationv1request.md @@ -0,0 +1,9 @@ +# ConnectorActivateForOrganizationV1Request + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `connector_id` | *str* | :heavy_check_mark: | N/A | +| `tool_execution_configuration` | [OptionalNullable[models.ToolExecutionConfiguration]](../models/toolexecutionconfiguration.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connectoractivateforuserv1request.md b/docs/models/connectoractivateforuserv1request.md new file mode 100644 index 00000000..bdf73b8a --- /dev/null +++ b/docs/models/connectoractivateforuserv1request.md @@ -0,0 +1,9 @@ +# ConnectorActivateForUserV1Request + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `connector_id` | *str* | :heavy_check_mark: | N/A | +| `tool_execution_configuration` | [OptionalNullable[models.ToolExecutionConfiguration]](../models/toolexecutionconfiguration.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connectoractivateforworkspacev1request.md b/docs/models/connectoractivateforworkspacev1request.md new file mode 100644 index 00000000..e4dbaf1d --- /dev/null +++ b/docs/models/connectoractivateforworkspacev1request.md @@ -0,0 +1,9 @@ +# ConnectorActivateForWorkspaceV1Request + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `connector_id` | *str* | :heavy_check_mark: | N/A | +| `tool_execution_configuration` | [OptionalNullable[models.ToolExecutionConfiguration]](../models/toolexecutionconfiguration.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connectordeactivatefororganizationv1request.md b/docs/models/connectordeactivatefororganizationv1request.md new file mode 100644 index 00000000..1fd64004 --- /dev/null +++ b/docs/models/connectordeactivatefororganizationv1request.md @@ -0,0 +1,8 @@ +# ConnectorDeactivateForOrganizationV1Request + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `connector_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectordeactivateforuserv1request.md b/docs/models/connectordeactivateforuserv1request.md new file mode 100644 index 00000000..992603b0 --- /dev/null +++ b/docs/models/connectordeactivateforuserv1request.md @@ -0,0 +1,8 @@ +# ConnectorDeactivateForUserV1Request + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `connector_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectordeactivateforworkspacev1request.md b/docs/models/connectordeactivateforworkspacev1request.md new file mode 100644 index 00000000..15033f29 --- /dev/null +++ b/docs/models/connectordeactivateforworkspacev1request.md @@ -0,0 +1,8 @@ +# ConnectorDeactivateForWorkspaceV1Request + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `connector_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorgetv1request.md b/docs/models/connectorgetv1request.md index c45148b9..35a6f393 100644 --- a/docs/models/connectorgetv1request.md +++ b/docs/models/connectorgetv1request.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `fetch_user_data` | *Optional[bool]* | :heavy_minus_sign: | Fetch the user-level data associated with the connector (e.g. connection credentials). | | `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/connectorlocale.md b/docs/models/connectorlocale.md new file mode 100644 index 00000000..c2e7cf5b --- /dev/null +++ b/docs/models/connectorlocale.md @@ -0,0 +1,10 @@ +# ConnectorLocale + + +## 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/tooltype.md b/docs/models/connectorprotocol.md similarity index 56% rename from docs/models/tooltype.md rename to docs/models/connectorprotocol.md index 2a64e130..77d28458 100644 --- a/docs/models/tooltype.md +++ b/docs/models/connectorprotocol.md @@ -1,12 +1,12 @@ -# ToolType +# ConnectorProtocol ## Example Usage ```python -from mistralai.client.models import ToolType +from mistralai.client.models import ConnectorProtocol # Open enum: unrecognized values are captured as UnrecognizedStr -value: ToolType = "rag" +value: ConnectorProtocol = "mcp" ``` @@ -14,7 +14,6 @@ value: ToolType = "rag" This is an open enum. Unrecognized values will not fail type checks. -- `"rag"` -- `"image"` -- `"code"` -- `"event"` +- `"mcp"` +- `"http"` +- `"turbine"` diff --git a/docs/models/connectorsqueryfilters.md b/docs/models/connectorsqueryfilters.md index aea47e14..37c19e7a 100644 --- a/docs/models/connectorsqueryfilters.md +++ b/docs/models/connectorsqueryfilters.md @@ -5,5 +5,4 @@ | 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 +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter for active connectors for a given user, workspace and organization. | \ No newline at end of file diff --git a/docs/models/consumertype.md b/docs/models/consumertype.md new file mode 100644 index 00000000..9ac4df3f --- /dev/null +++ b/docs/models/consumertype.md @@ -0,0 +1,20 @@ +# ConsumerType + +## Example Usage + +```python +from mistralai.client.models import ConsumerType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ConsumerType = "user" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"user"` +- `"org"` +- `"workspace"` +- `"system"` diff --git a/docs/models/createconnectorrequest.md b/docs/models/createconnectorrequest.md index 111c460a..eb14f585 100644 --- a/docs/models/createconnectorrequest.md +++ b/docs/models/createconnectorrequest.md @@ -5,6 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `protocol` | *Optional[Literal["mcp"]]* | :heavy_minus_sign: | N/A | | `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. | diff --git a/docs/models/createlibraryrequest.md b/docs/models/createlibraryrequest.md index 07ff97d0..fd94c1ca 100644 --- a/docs/models/createlibraryrequest.md +++ b/docs/models/createlibraryrequest.md @@ -7,5 +7,5 @@ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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. | +| ~~`chunk_size`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

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/createsearchindexinforequest.md b/docs/models/createsearchindexinforequest.md new file mode 100644 index 00000000..64b22aa4 --- /dev/null +++ b/docs/models/createsearchindexinforequest.md @@ -0,0 +1,11 @@ +# CreateSearchIndexInfoRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | +| `document_count` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `status` | [Optional[models.CreateSearchIndexInfoRequestStatus]](../models/createsearchindexinforequeststatus.md) | :heavy_minus_sign: | N/A | +| `index` | [models.CreateSearchIndexInfoRequestIndex](../models/createsearchindexinforequestindex.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createsearchindexinforequestindex.md b/docs/models/createsearchindexinforequestindex.md new file mode 100644 index 00000000..42d99fcb --- /dev/null +++ b/docs/models/createsearchindexinforequestindex.md @@ -0,0 +1,11 @@ +# CreateSearchIndexInfoRequestIndex + + +## Supported Types + +### `models.CreateVespaSearchIndexInfoRequest` + +```python +value: models.CreateVespaSearchIndexInfoRequest = /* values here */ +``` + diff --git a/docs/models/createsearchindexinforequeststatus.md b/docs/models/createsearchindexinforequeststatus.md new file mode 100644 index 00000000..1e477acc --- /dev/null +++ b/docs/models/createsearchindexinforequeststatus.md @@ -0,0 +1,14 @@ +# CreateSearchIndexInfoRequestStatus + +## Example Usage + +```python +from mistralai.client.models import CreateSearchIndexInfoRequestStatus +value: CreateSearchIndexInfoRequestStatus = "online" +``` + + +## Values + +- `"online"` +- `"offline"` diff --git a/docs/models/createvespaschemarequest.md b/docs/models/createvespaschemarequest.md new file mode 100644 index 00000000..3098a2b9 --- /dev/null +++ b/docs/models/createvespaschemarequest.md @@ -0,0 +1,9 @@ +# CreateVespaSchemaRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `document_count` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/createvespasearchindexinforequest.md b/docs/models/createvespasearchindexinforequest.md new file mode 100644 index 00000000..0bd47c38 --- /dev/null +++ b/docs/models/createvespasearchindexinforequest.md @@ -0,0 +1,12 @@ +# CreateVespaSearchIndexInfoRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `type` | *Literal["vespa"]* | :heavy_check_mark: | N/A | +| `k8s_cluster` | *str* | :heavy_check_mark: | N/A | +| `k8s_namespace` | *str* | :heavy_check_mark: | N/A | +| `vespa_instance_name` | *str* | :heavy_check_mark: | N/A | +| `schemas` | List[[models.CreateVespaSchemaRequest](../models/createvespaschemarequest.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/document.md b/docs/models/document.md index 42c639a6..ff0238ea 100644 --- a/docs/models/document.md +++ b/docs/models/document.md @@ -3,25 +3,26 @@ ## 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 +| 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: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `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: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| ~~`tokens_processing_summary`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `attributes` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | If set, the document will be automatically deleted after this date. | +| ~~`processing_status`~~ | *str* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `tokens_processing_total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/elicitationcapability.md b/docs/models/elicitationcapability.md new file mode 100644 index 00000000..c2f8fab6 --- /dev/null +++ b/docs/models/elicitationcapability.md @@ -0,0 +1,14 @@ +# ElicitationCapability + +Capability for elicitation operations. + +Clients must support at least one mode (form or url). + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `form` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `url` | 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/encryptedpatchvalue.md b/docs/models/encryptedpatchvalue.md new file mode 100644 index 00000000..1d5988b4 --- /dev/null +++ b/docs/models/encryptedpatchvalue.md @@ -0,0 +1,16 @@ +# EncryptedPatchValue + +Wrapper for encrypted patch values in selective json_patch encryption. + +When partial encryption mode is enabled and a patch targets an EncryptedStrField, +the patch value is encrypted and wrapped in this structure. + +The type field acts as a discriminator to distinguish this from user data. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `type` | *Literal["__encrypted__"]* | :heavy_check_mark: | N/A | +| `value` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/expression.md b/docs/models/expression.md new file mode 100644 index 00000000..d7de83a9 --- /dev/null +++ b/docs/models/expression.md @@ -0,0 +1,23 @@ +# Expression + + +## Supported Types + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + +### `models.LogicalExpression` + +```python +value: models.LogicalExpression = /* values here */ +``` + +### `models.ToolProperties` + +```python +value: models.ToolProperties = /* values here */ +``` + diff --git a/docs/models/getschedulesv1workflowsschedulesgetrequest.md b/docs/models/getschedulesv1workflowsschedulesgetrequest.md new file mode 100644 index 00000000..d510c27d --- /dev/null +++ b/docs/models/getschedulesv1workflowsschedulesgetrequest.md @@ -0,0 +1,12 @@ +# GetSchedulesV1WorkflowsSchedulesGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `workflow_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by workflow name | +| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by user ID. Pass 'current' to resolve to the authenticated user's ID. | +| `status` | [OptionalNullable[models.GetSchedulesV1WorkflowsSchedulesGetStatus]](../models/getschedulesv1workflowsschedulesgetstatus.md) | :heavy_minus_sign: | Filter by schedule status: 'active' or 'paused' | +| `page_size` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of items per page. Omitting this parameter fetches all results at once (deprecated — pass page_size to use pagination). | +| `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/getschedulesv1workflowsschedulesgetresponse.md b/docs/models/getschedulesv1workflowsschedulesgetresponse.md new file mode 100644 index 00000000..20adb3c0 --- /dev/null +++ b/docs/models/getschedulesv1workflowsschedulesgetresponse.md @@ -0,0 +1,8 @@ +# GetSchedulesV1WorkflowsSchedulesGetResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `result` | [models.WorkflowScheduleListResponse](../models/workflowschedulelistresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getschedulesv1workflowsschedulesgetstatus.md b/docs/models/getschedulesv1workflowsschedulesgetstatus.md new file mode 100644 index 00000000..312db2cd --- /dev/null +++ b/docs/models/getschedulesv1workflowsschedulesgetstatus.md @@ -0,0 +1,16 @@ +# GetSchedulesV1WorkflowsSchedulesGetStatus + +Filter by schedule status: 'active' or 'paused' + +## Example Usage + +```python +from mistralai.client.models import GetSchedulesV1WorkflowsSchedulesGetStatus +value: GetSchedulesV1WorkflowsSchedulesGetStatus = "active" +``` + + +## Values + +- `"active"` +- `"paused"` diff --git a/docs/models/getschedulev1workflowsschedulesscheduleidgetrequest.md b/docs/models/getschedulev1workflowsschedulesscheduleidgetrequest.md new file mode 100644 index 00000000..e681e674 --- /dev/null +++ b/docs/models/getschedulev1workflowsschedulesscheduleidgetrequest.md @@ -0,0 +1,8 @@ +# GetScheduleV1WorkflowsSchedulesScheduleIDGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `schedule_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/jsonpatchappend.md b/docs/models/jsonpatchappend.md index 684cc896..903d6c71 100644 --- a/docs/models/jsonpatchappend.md +++ b/docs/models/jsonpatchappend.md @@ -6,5 +6,5 @@ | 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 | +| `value` | [models.JSONPatchAppendValue](../models/jsonpatchappendvalue.md) | :heavy_check_mark: | The value to use for the operation. A string to append to the existing value, or an EncryptedPatchValue wrapper when encryption is applied. | | `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/jsonpatchappendvalue.md b/docs/models/jsonpatchappendvalue.md new file mode 100644 index 00000000..551cafe1 --- /dev/null +++ b/docs/models/jsonpatchappendvalue.md @@ -0,0 +1,19 @@ +# JSONPatchAppendValue + +The value to use for the operation. A string to append to the existing value, or an EncryptedPatchValue wrapper when encryption is applied. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `models.EncryptedPatchValue` + +```python +value: models.EncryptedPatchValue = /* values here */ +``` + diff --git a/docs/models/librariesdocumentslistv1request.md b/docs/models/librariesdocumentslistv1request.md index 44f63001..6149336f 100644 --- a/docs/models/librariesdocumentslistv1request.md +++ b/docs/models/librariesdocumentslistv1request.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `library_id` | *str* | :heavy_check_mark: | N/A | -| `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 +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `library_id` | *str* | :heavy_check_mark: | N/A | +| `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: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated: this parameter will be removed in a future version. | +| `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/librariesdocumentspatchv1request.md b/docs/models/librariesdocumentspatchv1request.md new file mode 100644 index 00000000..511aee46 --- /dev/null +++ b/docs/models/librariesdocumentspatchv1request.md @@ -0,0 +1,10 @@ +# LibrariesDocumentsPatchV1Request + + +## Fields + +| 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/librarieslistv1request.md b/docs/models/librarieslistv1request.md index 37352ee1..5efdb897 100644 --- a/docs/models/librarieslistv1request.md +++ b/docs/models/librarieslistv1request.md @@ -3,9 +3,9 @@ ## 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 +| 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: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated: this parameter will be removed in a future version. | \ No newline at end of file diff --git a/docs/models/librariespatchv1request.md b/docs/models/librariespatchv1request.md new file mode 100644 index 00000000..47648086 --- /dev/null +++ b/docs/models/librariespatchv1request.md @@ -0,0 +1,9 @@ +# LibrariesPatchV1Request + + +## Fields + +| 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 index a07d3afa..5b9aa658 100644 --- a/docs/models/library.md +++ b/docs/models/library.md @@ -3,21 +3,21 @@ ## 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 +| 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: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| ~~`emoji`~~ | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| ~~`generated_description`~~ | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| ~~`explicit_user_members_count`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| ~~`explicit_workspace_members_count`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| ~~`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: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Generated Name | \ No newline at end of file diff --git a/docs/models/logicalexpression.md b/docs/models/logicalexpression.md new file mode 100644 index 00000000..675368e7 --- /dev/null +++ b/docs/models/logicalexpression.md @@ -0,0 +1,9 @@ +# LogicalExpression + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `type` | [models.LogicalExpressionType](../models/logicalexpressiontype.md) | :heavy_check_mark: | N/A | +| `expressions` | List[[models.Expression](../models/expression.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/visibility.md b/docs/models/logicalexpressiontype.md similarity index 56% rename from docs/models/visibility.md rename to docs/models/logicalexpressiontype.md index 924f2bdd..0d3c1f78 100644 --- a/docs/models/visibility.md +++ b/docs/models/logicalexpressiontype.md @@ -1,12 +1,12 @@ -# Visibility +# LogicalExpressionType ## Example Usage ```python -from mistralai.client.models import Visibility +from mistralai.client.models import LogicalExpressionType # Open enum: unrecognized values are captured as UnrecognizedStr -value: Visibility = "model" +value: LogicalExpressionType = "and" ``` @@ -14,5 +14,5 @@ value: Visibility = "model" This is an open enum. Unrecognized values will not fail type checks. -- `"model"` -- `"app"` +- `"and"` +- `"or"` diff --git a/docs/models/mcpprompt.md b/docs/models/mcpprompt.md new file mode 100644 index 00000000..b68d0046 --- /dev/null +++ b/docs/models/mcpprompt.md @@ -0,0 +1,14 @@ +# MCPPrompt + + +## 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 | +| `arguments` | List[[models.PromptArgument](../models/promptargument.md)] | :heavy_minus_sign: | N/A | +| `icons` | List[[models.MCPServerIcon](../models/mcpservericon.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/mcpresource.md b/docs/models/mcpresource.md new file mode 100644 index 00000000..ac3d92a8 --- /dev/null +++ b/docs/models/mcpresource.md @@ -0,0 +1,17 @@ +# MCPResource + + +## 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 | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/mcpserverauthenticationrequirement.md b/docs/models/mcpserverauthenticationrequirement.md new file mode 100644 index 00000000..a3824be6 --- /dev/null +++ b/docs/models/mcpserverauthenticationrequirement.md @@ -0,0 +1,11 @@ +# MCPServerAuthenticationRequirement + +Authentication requirements for a remote transport (SEP-2127). + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `required` | *bool* | :heavy_check_mark: | Whether authentication is mandatory | +| `schemes` | List[*str*] | :heavy_minus_sign: | Supported schemes (e.g. ['bearer', 'oauth2']) | \ No newline at end of file diff --git a/docs/models/mcpservercard.md b/docs/models/mcpservercard.md new file mode 100644 index 00000000..ebc72b07 --- /dev/null +++ b/docs/models/mcpservercard.md @@ -0,0 +1,23 @@ +# MCPServerCard + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `dollar_schema` | *OptionalNullable[str]* | :heavy_minus_sign: | URL to the JSON schema definition | +| `name` | *str* | :heavy_check_mark: | Server identifier in reverse-DNS format with exactly one / | +| `version` | *str* | :heavy_check_mark: | Server version (semantic versioning preferred) | +| `capabilities` | [Optional[models.ServerCapabilities]](../models/servercapabilities.md) | :heavy_minus_sign: | Capabilities that a server may support. | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `website_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `repository` | [OptionalNullable[models.MCPServerRepository]](../models/mcpserverrepository.md) | :heavy_minus_sign: | N/A | +| `icons` | List[[models.MCPServerIcon](../models/mcpservericon.md)] | :heavy_minus_sign: | N/A | +| `remotes` | List[[models.MCPServerRemote](../models/mcpserverremote.md)] | :heavy_minus_sign: | N/A | +| `requires` | [OptionalNullable[models.ClientCapabilities]](../models/clientcapabilities.md) | :heavy_minus_sign: | N/A | +| `resources` | [OptionalNullable[models.Resources]](../models/resources.md) | :heavy_minus_sign: | N/A | +| `tools` | [OptionalNullable[models.Tools]](../models/tools.md) | :heavy_minus_sign: | N/A | +| `prompts` | [OptionalNullable[models.Prompts]](../models/prompts.md) | :heavy_minus_sign: | N/A | +| `meta` | [OptionalNullable[models.MCPServerCardMeta]](../models/mcpservercardmeta.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/mcpservercardmeta.md b/docs/models/mcpservercardmeta.md new file mode 100644 index 00000000..52345bcf --- /dev/null +++ b/docs/models/mcpservercardmeta.md @@ -0,0 +1,13 @@ +# MCPServerCardMeta + +Typed _meta for MCP server cards. + +Only the 'turbine' field is typed. Other fields are allowed via extra="allow". + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `ai_mistral_turbine` | [OptionalNullable[models.TurbineMeta]](../models/turbinemeta.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/mcpserverremote.md b/docs/models/mcpserverremote.md new file mode 100644 index 00000000..1c7c4de3 --- /dev/null +++ b/docs/models/mcpserverremote.md @@ -0,0 +1,14 @@ +# MCPServerRemote + +Remote transport endpoint (SEP-2127). + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `type` | [models.MCPServerRemoteType](../models/mcpserverremotetype.md) | :heavy_check_mark: | Transport type | +| `url` | *str* | :heavy_check_mark: | Transport endpoint URL | +| `supported_protocol_versions` | List[*str*] | :heavy_minus_sign: | N/A | +| `headers` | List[[models.MCPServerRemoteHeader](../models/mcpserverremoteheader.md)] | :heavy_minus_sign: | N/A | +| `authentication` | [OptionalNullable[models.MCPServerAuthenticationRequirement]](../models/mcpserverauthenticationrequirement.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/mcpserverremoteheader.md b/docs/models/mcpserverremoteheader.md new file mode 100644 index 00000000..a3966a54 --- /dev/null +++ b/docs/models/mcpserverremoteheader.md @@ -0,0 +1,15 @@ +# MCPServerRemoteHeader + +Header definition for a remote transport (SEP-2127). + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Header name | +| `description` | *str* | :heavy_check_mark: | Human-readable description of the header | +| `is_required` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `is_secret` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `default` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `choices` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/mcpserverremotetype.md b/docs/models/mcpserverremotetype.md new file mode 100644 index 00000000..ea4585b6 --- /dev/null +++ b/docs/models/mcpserverremotetype.md @@ -0,0 +1,20 @@ +# MCPServerRemoteType + +Transport type + +## Example Usage + +```python +from mistralai.client.models import MCPServerRemoteType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: MCPServerRemoteType = "streamable-http" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"streamable-http"` +- `"sse"` diff --git a/docs/models/mcpserverrepository.md b/docs/models/mcpserverrepository.md new file mode 100644 index 00000000..16fbdd18 --- /dev/null +++ b/docs/models/mcpserverrepository.md @@ -0,0 +1,12 @@ +# MCPServerRepository + +Source repository information (SEP-2127). + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `url` | *str* | :heavy_check_mark: | Repository URL | +| `source` | *str* | :heavy_check_mark: | Source identifier (e.g. 'github') | +| `subfolder` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/mcptoolmeta.md b/docs/models/mcptoolmeta.md index 23e8b64c..723f40b1 100644 --- a/docs/models/mcptoolmeta.md +++ b/docs/models/mcptoolmeta.md @@ -1,14 +1,17 @@ # 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 | +| `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/mcpuitoolmeta.md b/docs/models/mcpuitoolmeta.md deleted file mode 100644 index c09b29ad..00000000 --- a/docs/models/mcpuitoolmeta.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/partialscheduledefinition.md b/docs/models/partialscheduledefinition.md new file mode 100644 index 00000000..e66ee671 --- /dev/null +++ b/docs/models/partialscheduledefinition.md @@ -0,0 +1,23 @@ +# PartialScheduleDefinition + +Schedule definition for partial updates. + +All fields are optional (inherited from _ScheduleRequestBase). Only explicitly-set +fields are applied during an update; unset fields preserve the existing schedule values. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | *Optional[Any]* | :heavy_minus_sign: | 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 | +| `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/processingstatus.md b/docs/models/processingstatus.md index 514caa50..1d472b88 100644 --- a/docs/models/processingstatus.md +++ b/docs/models/processingstatus.md @@ -3,8 +3,8 @@ ## 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 +| 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: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | \ No newline at end of file diff --git a/docs/models/promptargument.md b/docs/models/promptargument.md new file mode 100644 index 00000000..a8dfdb05 --- /dev/null +++ b/docs/models/promptargument.md @@ -0,0 +1,13 @@ +# PromptArgument + +An argument for a prompt template. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `required` | *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/prompts.md b/docs/models/prompts.md new file mode 100644 index 00000000..9fe85597 --- /dev/null +++ b/docs/models/prompts.md @@ -0,0 +1,17 @@ +# Prompts + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[models.MCPPrompt]` + +```python +value: List[models.MCPPrompt] = /* values here */ +``` + diff --git a/docs/models/promptscapability.md b/docs/models/promptscapability.md new file mode 100644 index 00000000..50ffae2b --- /dev/null +++ b/docs/models/promptscapability.md @@ -0,0 +1,11 @@ +# PromptsCapability + +Capability for prompts operations. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `list_changed` | *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/publicconnectionconfig.md b/docs/models/publicconnectionconfig.md new file mode 100644 index 00000000..56c9ee8e --- /dev/null +++ b/docs/models/publicconnectionconfig.md @@ -0,0 +1,11 @@ +# PublicConnectionConfig + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `type` | [Optional[models.ConnectionConfigType]](../models/connectionconfigtype.md) | :heavy_minus_sign: | N/A | +| `base_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `headers` | Dict[str, *str*] | :heavy_minus_sign: | N/A | +| `signed` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/requiresconfirmation.md b/docs/models/requiresconfirmation.md new file mode 100644 index 00000000..e7f1e4a6 --- /dev/null +++ b/docs/models/requiresconfirmation.md @@ -0,0 +1,23 @@ +# RequiresConfirmation + + +## Supported Types + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + +### `models.LogicalExpression` + +```python +value: models.LogicalExpression = /* values here */ +``` + +### `models.ToolProperties` + +```python +value: models.ToolProperties = /* values here */ +``` + diff --git a/docs/models/resources.md b/docs/models/resources.md new file mode 100644 index 00000000..cf19612e --- /dev/null +++ b/docs/models/resources.md @@ -0,0 +1,17 @@ +# Resources + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[models.MCPResource]` + +```python +value: List[models.MCPResource] = /* values here */ +``` + diff --git a/docs/models/resourcescapability.md b/docs/models/resourcescapability.md new file mode 100644 index 00000000..bbd256d0 --- /dev/null +++ b/docs/models/resourcescapability.md @@ -0,0 +1,12 @@ +# ResourcesCapability + +Capability for resources operations. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `subscribe` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `list_changed` | *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/resourcetype.md b/docs/models/resourcetype.md new file mode 100644 index 00000000..047f96bb --- /dev/null +++ b/docs/models/resourcetype.md @@ -0,0 +1,20 @@ +# ResourceType + +## Example Usage + +```python +from mistralai.client.models import ResourceType + +# Open enum: unrecognized values are captured as UnrecognizedInt +value: ResourceType = 1 +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `1` +- `2` +- `3` +- `4` diff --git a/docs/models/rootscapability.md b/docs/models/rootscapability.md new file mode 100644 index 00000000..f025431d --- /dev/null +++ b/docs/models/rootscapability.md @@ -0,0 +1,11 @@ +# RootsCapability + +Capability for root operations. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `list_changed` | *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/samplingcapability.md b/docs/models/samplingcapability.md new file mode 100644 index 00000000..b05fb678 --- /dev/null +++ b/docs/models/samplingcapability.md @@ -0,0 +1,12 @@ +# SamplingCapability + +Sampling capability structure, allowing fine-grained capability advertisement. + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `context` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `tools` | 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/scheduledefinition.md b/docs/models/scheduledefinition.md index 7d0509f6..93c58740 100644 --- a/docs/models/scheduledefinition.md +++ b/docs/models/scheduledefinition.md @@ -22,5 +22,5 @@ Used for input where schedule_id is optional (can be provided or auto-generated) | `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 +| `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. | +| `schedule_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for the schedule. | \ No newline at end of file diff --git a/docs/models/searchindexresponse.md b/docs/models/searchindexresponse.md new file mode 100644 index 00000000..ce6087ec --- /dev/null +++ b/docs/models/searchindexresponse.md @@ -0,0 +1,15 @@ +# SearchIndexResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `creator_id` | *str* | :heavy_check_mark: | N/A | +| `document_count` | *int* | :heavy_check_mark: | N/A | +| `status` | [models.SearchIndexResponseStatus](../models/searchindexresponsestatus.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 | +| `index` | [models.SearchIndexResponseIndex](../models/searchindexresponseindex.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/searchindexresponseindex.md b/docs/models/searchindexresponseindex.md new file mode 100644 index 00000000..3093f4d4 --- /dev/null +++ b/docs/models/searchindexresponseindex.md @@ -0,0 +1,11 @@ +# SearchIndexResponseIndex + + +## Supported Types + +### `models.VespaSearchIndexInfoResponse` + +```python +value: models.VespaSearchIndexInfoResponse = /* values here */ +``` + diff --git a/docs/models/searchindexresponsestatus.md b/docs/models/searchindexresponsestatus.md new file mode 100644 index 00000000..c2200101 --- /dev/null +++ b/docs/models/searchindexresponsestatus.md @@ -0,0 +1,18 @@ +# SearchIndexResponseStatus + +## Example Usage + +```python +from mistralai.client.models import SearchIndexResponseStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: SearchIndexResponseStatus = "online" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"online"` +- `"offline"` diff --git a/docs/models/servercapabilities.md b/docs/models/servercapabilities.md new file mode 100644 index 00000000..4faca72e --- /dev/null +++ b/docs/models/servercapabilities.md @@ -0,0 +1,17 @@ +# ServerCapabilities + +Capabilities that a server may support. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `experimental` | Dict[str, Dict[str, *Any*]] | :heavy_minus_sign: | N/A | +| `logging` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `prompts` | [OptionalNullable[models.PromptsCapability]](../models/promptscapability.md) | :heavy_minus_sign: | N/A | +| `resources` | [OptionalNullable[models.ResourcesCapability]](../models/resourcescapability.md) | :heavy_minus_sign: | N/A | +| `tools` | [OptionalNullable[models.ToolsCapability]](../models/toolscapability.md) | :heavy_minus_sign: | N/A | +| `completions` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `tasks` | [OptionalNullable[models.ServerTasksCapability]](../models/servertaskscapability.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/turbinetoollocale.md b/docs/models/serverlocale.md similarity index 97% rename from docs/models/turbinetoollocale.md rename to docs/models/serverlocale.md index 283dd339..a26fcf11 100644 --- a/docs/models/turbinetoollocale.md +++ b/docs/models/serverlocale.md @@ -1,4 +1,4 @@ -# TurbineToolLocale +# ServerLocale ## Fields diff --git a/docs/models/servertaskscapability.md b/docs/models/servertaskscapability.md new file mode 100644 index 00000000..9554996d --- /dev/null +++ b/docs/models/servertaskscapability.md @@ -0,0 +1,13 @@ +# ServerTasksCapability + +Capability for server tasks operations. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `list` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `cancel` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `requests` | [OptionalNullable[models.ServerTasksRequestsCapability]](../models/servertasksrequestscapability.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/servertasksrequestscapability.md b/docs/models/servertasksrequestscapability.md new file mode 100644 index 00000000..65c8593c --- /dev/null +++ b/docs/models/servertasksrequestscapability.md @@ -0,0 +1,11 @@ +# ServerTasksRequestsCapability + +Capability for tasks requests operations. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `tools` | [OptionalNullable[models.TasksToolsCapability]](../models/taskstoolscapability.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/sharing.md b/docs/models/sharing.md index fc718632..922506d3 100644 --- a/docs/models/sharing.md +++ b/docs/models/sharing.md @@ -3,11 +3,11 @@ ## 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 +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `library_id` | *str* | :heavy_check_mark: | N/A | +| ~~`user_id`~~ | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| ~~`org_id`~~ | *str* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `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 1dcec095..e6e0732b 100644 --- a/docs/models/sharingdelete.md +++ b/docs/models/sharingdelete.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `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 +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| ~~`org_id`~~ | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `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/sharingrequest.md b/docs/models/sharingrequest.md index 21b8ec1f..e92318f8 100644 --- a/docs/models/sharingrequest.md +++ b/docs/models/sharingrequest.md @@ -3,9 +3,9 @@ ## 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 +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| ~~`org_id`~~ | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `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/skipconfirmation.md b/docs/models/skipconfirmation.md new file mode 100644 index 00000000..48eade7a --- /dev/null +++ b/docs/models/skipconfirmation.md @@ -0,0 +1,23 @@ +# SkipConfirmation + + +## Supported Types + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + +### `models.LogicalExpression` + +```python +value: models.LogicalExpression = /* values here */ +``` + +### `models.ToolProperties` + +```python +value: models.ToolProperties = /* values here */ +``` + diff --git a/docs/models/taskselicitationcapability.md b/docs/models/taskselicitationcapability.md new file mode 100644 index 00000000..f2f3ef81 --- /dev/null +++ b/docs/models/taskselicitationcapability.md @@ -0,0 +1,11 @@ +# TasksElicitationCapability + +Capability for tasks elicitation operations. + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `create` | 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/taskssamplingcapability.md b/docs/models/taskssamplingcapability.md new file mode 100644 index 00000000..805d8574 --- /dev/null +++ b/docs/models/taskssamplingcapability.md @@ -0,0 +1,11 @@ +# TasksSamplingCapability + +Capability for tasks sampling operations. + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `create_message` | 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/taskstoolscapability.md b/docs/models/taskstoolscapability.md new file mode 100644 index 00000000..cd60fe49 --- /dev/null +++ b/docs/models/taskstoolscapability.md @@ -0,0 +1,11 @@ +# TasksToolsCapability + +Capability for tasks tools operations. + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `call` | 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/toolexecutionconfiguration.md b/docs/models/toolexecutionconfiguration.md new file mode 100644 index 00000000..04981b89 --- /dev/null +++ b/docs/models/toolexecutionconfiguration.md @@ -0,0 +1,11 @@ +# ToolExecutionConfiguration + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `requires_confirmation` | [OptionalNullable[models.RequiresConfirmation]](../models/requiresconfirmation.md) | :heavy_minus_sign: | N/A | +| `skip_confirmation` | [OptionalNullable[models.SkipConfirmation]](../models/skipconfirmation.md) | :heavy_minus_sign: | N/A | +| `include` | List[*str*] | :heavy_minus_sign: | N/A | +| `exclude` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolproperties.md b/docs/models/toolproperties.md new file mode 100644 index 00000000..d85fd821 --- /dev/null +++ b/docs/models/toolproperties.md @@ -0,0 +1,8 @@ +# ToolProperties + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `read_only` | *Nullable[bool]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/tools.md b/docs/models/tools.md new file mode 100644 index 00000000..2f9decd6 --- /dev/null +++ b/docs/models/tools.md @@ -0,0 +1,17 @@ +# Tools + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[models.MCPToolMeta]` + +```python +value: List[models.MCPToolMeta] = /* values here */ +``` + diff --git a/docs/models/toolscapability.md b/docs/models/toolscapability.md new file mode 100644 index 00000000..7bde4735 --- /dev/null +++ b/docs/models/toolscapability.md @@ -0,0 +1,11 @@ +# ToolsCapability + +Capability for tools operations. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `list_changed` | *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/turbinemeta.md b/docs/models/turbinemeta.md new file mode 100644 index 00000000..d5e48e38 --- /dev/null +++ b/docs/models/turbinemeta.md @@ -0,0 +1,9 @@ +# TurbineMeta + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `system_prompt_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `locale` | [OptionalNullable[models.ServerLocale]](../models/serverlocale.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/updateconnectorrequest.md b/docs/models/updateconnectorrequest.md index 335588ea..7a267df3 100644 --- a/docs/models/updateconnectorrequest.md +++ b/docs/models/updateconnectorrequest.md @@ -3,15 +3,16 @@ ## 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 +| 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. | +| `protocol` | [OptionalNullable[models.ConnectorProtocol]](../models/connectorprotocol.md) | :heavy_minus_sign: | Protocol of 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/updatedocumentrequest.md b/docs/models/updatedocumentrequest.md index dd06dd4b..5a3c93af 100644 --- a/docs/models/updatedocumentrequest.md +++ b/docs/models/updatedocumentrequest.md @@ -3,7 +3,8 @@ ## 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 +| 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 | +| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | If set, the document will be automatically deleted after this date. | \ No newline at end of file diff --git a/docs/models/updateschedulev1workflowsschedulesscheduleidpatchrequest.md b/docs/models/updateschedulev1workflowsschedulesscheduleidpatchrequest.md new file mode 100644 index 00000000..68ffe15a --- /dev/null +++ b/docs/models/updateschedulev1workflowsschedulesscheduleidpatchrequest.md @@ -0,0 +1,9 @@ +# UpdateScheduleV1WorkflowsSchedulesScheduleIDPatchRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `schedule_id` | *str* | :heavy_check_mark: | N/A | +| `workflow_schedule_update_request` | [models.WorkflowScheduleUpdateRequest](../models/workflowscheduleupdaterequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/vespaschemaresponse.md b/docs/models/vespaschemaresponse.md new file mode 100644 index 00000000..1cb7277b --- /dev/null +++ b/docs/models/vespaschemaresponse.md @@ -0,0 +1,9 @@ +# VespaSchemaResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | +| `document_count` | *Nullable[int]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/vespasearchindexinforesponse.md b/docs/models/vespasearchindexinforesponse.md new file mode 100644 index 00000000..16272fce --- /dev/null +++ b/docs/models/vespasearchindexinforesponse.md @@ -0,0 +1,12 @@ +# VespaSearchIndexInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `type` | *Literal["vespa"]* | :heavy_check_mark: | N/A | +| `k8s_cluster` | *str* | :heavy_check_mark: | N/A | +| `k8s_namespace` | *str* | :heavy_check_mark: | N/A | +| `vespa_instance_name` | *str* | :heavy_check_mark: | N/A | +| `schemas` | List[[models.VespaSchemaResponse](../models/vespaschemaresponse.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/voiceappearance.md b/docs/models/voiceappearance.md new file mode 100644 index 00000000..b77de4c8 --- /dev/null +++ b/docs/models/voiceappearance.md @@ -0,0 +1,11 @@ +# VoiceAppearance + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `skin_color` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `hair_color` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `background_color` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `avatar_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/voicecreaterequest.md b/docs/models/voicecreaterequest.md index e9a3b3a1..775da22b 100644 --- a/docs/models/voicecreaterequest.md +++ b/docs/models/voicecreaterequest.md @@ -5,15 +5,17 @@ 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 +| 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 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `appearance` | [OptionalNullable[models.VoiceAppearance]](../models/voiceappearance.md) | :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/voiceresponse.md b/docs/models/voiceresponse.md index 3ec6d540..a907372e 100644 --- a/docs/models/voiceresponse.md +++ b/docs/models/voiceresponse.md @@ -5,16 +5,18 @@ 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 +| 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 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `appearance` | [OptionalNullable[models.VoiceAppearance]](../models/voiceappearance.md) | :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 index 924b5f47..ec2913dd 100644 --- a/docs/models/voiceupdaterequest.md +++ b/docs/models/voiceupdaterequest.md @@ -5,10 +5,12 @@ 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 +| 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 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `appearance` | [OptionalNullable[models.VoiceAppearance]](../models/voiceappearance.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/workflowbulkarchiverequest.md b/docs/models/workflowbulkarchiverequest.md new file mode 100644 index 00000000..2c9b9341 --- /dev/null +++ b/docs/models/workflowbulkarchiverequest.md @@ -0,0 +1,8 @@ +# WorkflowBulkArchiveRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `workflow_ids` | List[*str*] | :heavy_check_mark: | List of workflow IDs to archive | \ No newline at end of file diff --git a/docs/models/workflowbulkarchiveresponse.md b/docs/models/workflowbulkarchiveresponse.md new file mode 100644 index 00000000..ce1999f3 --- /dev/null +++ b/docs/models/workflowbulkarchiveresponse.md @@ -0,0 +1,9 @@ +# WorkflowBulkArchiveResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `archived` | List[[models.Workflow](../models/workflow.md)] | :heavy_check_mark: | Workflows that were successfully archived or were already archived | +| `errored` | List[[models.WorkflowBulkError](../models/workflowbulkerror.md)] | :heavy_minus_sign: | Workflows that could not be archived and the corresponding error messages | \ No newline at end of file diff --git a/docs/models/workflowbulkerror.md b/docs/models/workflowbulkerror.md new file mode 100644 index 00000000..d8e34f4e --- /dev/null +++ b/docs/models/workflowbulkerror.md @@ -0,0 +1,10 @@ +# WorkflowBulkError + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `workflow_id` | *str* | :heavy_check_mark: | The requested workflow ID | +| `workflow` | [OptionalNullable[models.Workflow]](../models/workflow.md) | :heavy_minus_sign: | The workflow, if found | +| `message` | *str* | :heavy_check_mark: | Error message describing why the operation failed | \ No newline at end of file diff --git a/docs/models/workflowbulkunarchiverequest.md b/docs/models/workflowbulkunarchiverequest.md new file mode 100644 index 00000000..0e5342cf --- /dev/null +++ b/docs/models/workflowbulkunarchiverequest.md @@ -0,0 +1,8 @@ +# WorkflowBulkUnarchiveRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `workflow_ids` | List[*str*] | :heavy_check_mark: | List of workflow IDs to unarchive | \ No newline at end of file diff --git a/docs/models/workflowbulkunarchiveresponse.md b/docs/models/workflowbulkunarchiveresponse.md new file mode 100644 index 00000000..8b139b75 --- /dev/null +++ b/docs/models/workflowbulkunarchiveresponse.md @@ -0,0 +1,9 @@ +# WorkflowBulkUnarchiveResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `unarchived` | List[[models.Workflow](../models/workflow.md)] | :heavy_check_mark: | Workflows that were successfully unarchived or were already unarchived | +| `errored` | List[[models.WorkflowBulkError](../models/workflowbulkerror.md)] | :heavy_minus_sign: | Workflows that could not be unarchived and the corresponding error messages | \ No newline at end of file diff --git a/docs/models/workflowschedulelistresponse.md b/docs/models/workflowschedulelistresponse.md index 7142185b..b6428546 100644 --- a/docs/models/workflowschedulelistresponse.md +++ b/docs/models/workflowschedulelistresponse.md @@ -5,4 +5,5 @@ | 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 +| `schedules` | List[[models.ScheduleDefinitionOutput](../models/scheduledefinitionoutput.md)] | :heavy_check_mark: | A list of workflow schedules | +| `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/workflowscheduleupdaterequest.md b/docs/models/workflowscheduleupdaterequest.md new file mode 100644 index 00000000..24357f65 --- /dev/null +++ b/docs/models/workflowscheduleupdaterequest.md @@ -0,0 +1,8 @@ +# WorkflowScheduleUpdateRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `schedule` | [models.PartialScheduleDefinition](../models/partialscheduledefinition.md) | :heavy_check_mark: | Schedule definition for partial updates.

All fields are optional (inherited from _ScheduleRequestBase). Only explicitly-set
fields are applied during an update; unset fields preserve the existing schedule values. | \ No newline at end of file diff --git a/docs/sdks/accesses/README.md b/docs/sdks/accesses/README.md index 09515e0b..3acf0566 100644 --- a/docs/sdks/accesses/README.md +++ b/docs/sdks/accesses/README.md @@ -76,14 +76,14 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `library_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. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `library_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: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -98,7 +98,7 @@ with Mistral( ## delete -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. +Given a library id, you can delete the access level of an entity. An owner cannot delete their own access. You have to be the owner of the library to delete an access other than yours. Warning: the response will change from 200 (returning the deleted sharing) to 204 No Content in a future version. ### Example Usage @@ -121,13 +121,13 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `library_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. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `library_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: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/connectors/README.md b/docs/sdks/connectors/README.md index 753c1cf3..4a0d8a93 100644 --- a/docs/sdks/connectors/README.md +++ b/docs/sdks/connectors/README.md @@ -9,6 +9,12 @@ * [create](#create) - Create a new connector. * [list](#list) - List all connectors. * [get_auth_url](#get_auth_url) - Get the auth URL for a connector. +* [activate_for_organization](#activate_for_organization) - Activate a connector for an organization. +* [deactivate_for_organization](#deactivate_for_organization) - Deactivate a connector for an organization. +* [activate_for_workspace](#activate_for_workspace) - Activate a connector for a workspace. +* [deactivate_for_workspace](#deactivate_for_workspace) - Deactivate a connector for a workspace. +* [activate_for_user](#activate_for_user) - Activate a connector for the current user. +* [deactivate_for_user](#deactivate_for_user) - Deactivate a connector for the current user. * [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. @@ -160,6 +166,264 @@ with Mistral( | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | +## activate_for_organization + +Enable a connector at the organization level so all members can use it. + +### 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.activate_for_organization(connector_id="a91bb4ec-caab-4cf2-be03-84b8343f4643") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `connector_id` | *str* | :heavy_check_mark: | N/A | +| `requires_confirmation` | [OptionalNullable[models.RequiresConfirmation]](../../models/requiresconfirmation.md) | :heavy_minus_sign: | N/A | +| `skip_confirmation` | [OptionalNullable[models.SkipConfirmation]](../../models/skipconfirmation.md) | :heavy_minus_sign: | N/A | +| `include` | List[*str*] | :heavy_minus_sign: | N/A | +| `exclude` | 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.MessageResponse](../../models/messageresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## deactivate_for_organization + +Disable a connector at the organization level. + +### 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.deactivate_for_organization(connector_id="8f4c1089-2a37-44b3-a3c4-830ca7a0e439") + + # 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 | \*/\* | + +## activate_for_workspace + +Enable a connector at the workspace level so all members of the workspace can use it. + +### 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.activate_for_workspace(connector_id="2adfa8af-3618-41a9-8980-e5ea1486e58e") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `connector_id` | *str* | :heavy_check_mark: | N/A | +| `requires_confirmation` | [OptionalNullable[models.RequiresConfirmation]](../../models/requiresconfirmation.md) | :heavy_minus_sign: | N/A | +| `skip_confirmation` | [OptionalNullable[models.SkipConfirmation]](../../models/skipconfirmation.md) | :heavy_minus_sign: | N/A | +| `include` | List[*str*] | :heavy_minus_sign: | N/A | +| `exclude` | 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.MessageResponse](../../models/messageresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## deactivate_for_workspace + +Disable a connector at the workspace level. + +### 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.deactivate_for_workspace(connector_id="15b00e98-a9e7-4582-b0fc-87d28c3dac04") + + # 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 | \*/\* | + +## activate_for_user + +Enable a connector for the calling user only. + +### 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.activate_for_user(connector_id="cd4fb4d2-de68-451f-8f2a-57fe39b33d96") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `connector_id` | *str* | :heavy_check_mark: | N/A | +| `requires_confirmation` | [OptionalNullable[models.RequiresConfirmation]](../../models/requiresconfirmation.md) | :heavy_minus_sign: | N/A | +| `skip_confirmation` | [OptionalNullable[models.SkipConfirmation]](../../models/skipconfirmation.md) | :heavy_minus_sign: | N/A | +| `include` | List[*str*] | :heavy_minus_sign: | N/A | +| `exclude` | 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.MessageResponse](../../models/messageresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## deactivate_for_user + +Disable a connector for the calling user only. + +### 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.deactivate_for_user(connector_id="99c6ed86-e6bb-40ed-b6ee-d22ba791a68f") + + # 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 | \*/\* | + ## call_tool Call a tool on an MCP connector. @@ -693,7 +957,7 @@ 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) + res = mistral.beta.connectors.get(connector_id_or_name="", fetch_user_data=False, fetch_customer_data=False) # Handle response print(res) @@ -705,8 +969,8 @@ with Mistral( | Parameter | Type | Required | Description | | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | | `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `fetch_user_data` | *Optional[bool]* | :heavy_minus_sign: | Fetch the user-level data associated with the connector (e.g. connection credentials). | | `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 @@ -745,20 +1009,21 @@ with Mistral( ### 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. | +| 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. | +| `protocol` | [OptionalNullable[models.ConnectorProtocol]](../../models/connectorprotocol.md) | :heavy_minus_sign: | Protocol of 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 diff --git a/docs/sdks/documents/README.md b/docs/sdks/documents/README.md index eabe9976..e7c70307 100644 --- a/docs/sdks/documents/README.md +++ b/docs/sdks/documents/README.md @@ -10,6 +10,7 @@ * [upload](#upload) - Upload a new document. * [get](#get) - Retrieve the metadata of a specific document. * [update](#update) - Update the metadata of a specific document. +* [~~libraries_documents_update_v1~~](#libraries_documents_update_v1) - Update the metadata of a specific document. :warning: **Deprecated** * [delete](#delete) - Delete a document. * [text_content](#text_content) - Retrieve the text content of a specific document. * [status](#status) - Retrieve the processing status of a specific document. @@ -42,16 +43,16 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `library_id` | *str* | :heavy_check_mark: | N/A | -| `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. | +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `library_id` | *str* | :heavy_check_mark: | N/A | +| `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: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated: this parameter will be removed in a future version. | +| `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 @@ -153,8 +154,55 @@ with Mistral( ## update +Given a library and a document in that library, update the name and/or attributes of that document. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.libraries.documents.update(library_id="2a41249e-52ca-4436-b755-25ce3a9bfb53", document_id="bc26fa54-e5d9-4269-bedf-86bed5471c7d") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `library_id` | *str* | :heavy_check_mark: | N/A | +| `document_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `attributes` | Dict[str, [models.Attributes](../../models/attributes.md)] | :heavy_minus_sign: | N/A | +| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | If set, the document will be automatically deleted after this date. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Document](../../models/document.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## ~~libraries_documents_update_v1~~ + Given a library and a document in that library, update the name of that document. +> :warning: **DEPRECATED**: Use the PATCH method instead. This PUT endpoint will be removed in a future version.. + ### Example Usage @@ -167,7 +215,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.libraries.documents.update(library_id="3ddd8d93-dca5-4a6d-980d-173226c35742", document_id="2a25e44c-b160-40ca-b5c2-b65fb2fcae34") + res = mistral.beta.libraries.documents.libraries_documents_update_v1(library_id="3ddd8d93-dca5-4a6d-980d-173226c35742", document_id="2a25e44c-b160-40ca-b5c2-b65fb2fcae34") # Handle response print(res) @@ -176,13 +224,14 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `library_id` | *str* | :heavy_check_mark: | N/A | -| `document_id` | *str* | :heavy_check_mark: | 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. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `library_id` | *str* | :heavy_check_mark: | N/A | +| `document_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `attributes` | Dict[str, [models.Attributes](../../models/attributes.md)] | :heavy_minus_sign: | N/A | +| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | If set, the document will be automatically deleted after this date. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/libraries/README.md b/docs/sdks/libraries/README.md index d282f541..42c3323e 100644 --- a/docs/sdks/libraries/README.md +++ b/docs/sdks/libraries/README.md @@ -11,6 +11,7 @@ * [get](#get) - Detailed information about a specific Library. * [delete](#delete) - Delete a library and all of its documents. * [update](#update) - Update a library. +* [~~libraries_update_v1~~](#libraries_update_v1) - Update a library. :warning: **Deprecated** ## list @@ -37,13 +38,13 @@ with Mistral( ### Parameters -| 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. | +| 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: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated: this parameter will be removed in a future version. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -85,7 +86,7 @@ with Mistral( | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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. | +| `chunk_size` | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

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. | @@ -143,7 +144,7 @@ with Mistral( ## delete -Given a library id, deletes it together with all documents that have been uploaded to that library. +Given a library id, deletes it together with all documents that have been uploaded to that library. Warning: the response will change from 200 (returning the deleted library) to 204 No Content in a future version. ### Example Usage @@ -188,6 +189,51 @@ Given a library id, you can update the name and description. ### Example Usage + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.libraries.update(library_id="74a30b7a-ba52-49f7-a8a3-7157e1adf565") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `library_id` | *str* | :heavy_check_mark: | 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.Library](../../models/library.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## ~~libraries_update_v1~~ + +Given a library id, you can update the name and description. + +> :warning: **DEPRECATED**: Use the PATCH method instead. This PUT endpoint will be removed in a future version.. + +### Example Usage + ```python from mistralai.client import Mistral @@ -198,7 +244,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.libraries.update(library_id="e01880c3-d0b5-4a29-8b1b-abdb8ce917e4") + res = mistral.beta.libraries.libraries_update_v1(library_id="e01880c3-d0b5-4a29-8b1b-abdb8ce917e4") # Handle response print(res) diff --git a/docs/sdks/schedules/README.md b/docs/sdks/schedules/README.md index 7bf59931..6b0e5f0e 100644 --- a/docs/sdks/schedules/README.md +++ b/docs/sdks/schedules/README.md @@ -6,7 +6,9 @@ * [get_schedules](#get_schedules) - Get Schedules * [schedule_workflow](#schedule_workflow) - Schedule Workflow +* [get_schedule](#get_schedule) - Get Schedule * [unschedule_workflow](#unschedule_workflow) - Unschedule Workflow +* [update_schedule](#update_schedule) - Update Schedule * [pause_schedule](#pause_schedule) - Pause Schedule * [resume_schedule](#resume_schedule) - Resume Schedule @@ -28,26 +30,34 @@ with Mistral( res = mistral.workflows.schedules.get_schedules() - # Handle response - print(res) + while res is not None: + # Handle items + + res = res.next() ``` ### 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 | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `workflow_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by workflow name | +| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by user ID. Pass 'current' to resolve to the authenticated user's ID. | +| `status` | [OptionalNullable[models.GetSchedulesV1WorkflowsSchedulesGetStatus]](../../models/getschedulesv1workflowsschedulesgetstatus.md) | :heavy_minus_sign: | Filter by schedule status: 'active' or 'paused' | +| `page_size` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of items per page. Omitting this parameter fetches all results at once (deprecated — pass page_size to use pagination). | +| `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.WorkflowScheduleListResponse](../../models/workflowschedulelistresponse.md)** +**[models.GetSchedulesV1WorkflowsSchedulesGetResponse](../../models/getschedulesv1workflowsschedulesgetresponse.md)** ### Errors -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## schedule_workflow @@ -98,6 +108,47 @@ with Mistral( | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | +## get_schedule + +Get Schedule + +### 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_schedule(schedule_id="") + + # Handle response + print(res) + +``` + +### 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. | + +### Response + +**[models.ScheduleDefinitionOutput](../../models/scheduledefinitionoutput.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## unschedule_workflow Unschedule Workflow @@ -134,6 +185,48 @@ with Mistral( | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | +## update_schedule + +Update Schedule + +### 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.update_schedule(schedule_id="", schedule={}) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `schedule_id` | *str* | :heavy_check_mark: | N/A | +| `schedule` | [models.PartialScheduleDefinition](../../models/partialscheduledefinition.md) | :heavy_check_mark: | Schedule definition for partial updates.

All fields are optional (inherited from _ScheduleRequestBase). Only explicitly-set
fields are applied during an update; unset fields preserve the existing schedule values. | +| `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 | \*/\* | + ## pause_schedule Pause Schedule diff --git a/docs/sdks/searchindexes/README.md b/docs/sdks/searchindexes/README.md new file mode 100644 index 00000000..471bba59 --- /dev/null +++ b/docs/sdks/searchindexes/README.md @@ -0,0 +1,97 @@ +# Beta.Rag.SearchIndexes + +## Overview + +### Available Operations + +* [list](#list) - Get Search Indexes +* [register](#register) - Register Search Index + +## list + +Get Search Indexes + +### 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.search_indexes.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.SearchIndexResponse]](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## register + +Register Search Index + +### 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.search_indexes.register(name="", index={ + "type": "vespa", + "k8s_cluster": "", + "k8s_namespace": "", + "vespa_instance_name": "", + "schemas": [], + }, status="offline") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `index` | [models.CreateSearchIndexInfoRequestIndex](../../models/createsearchindexinforequestindex.md) | :heavy_check_mark: | N/A | +| `document_count` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `status` | [Optional[models.CreateSearchIndexInfoRequestStatus]](../../models/createsearchindexinforequeststatus.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.SearchIndexResponse](../../models/searchindexresponse.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/voices/README.md b/docs/sdks/voices/README.md index 49b8533f..da59de37 100644 --- a/docs/sdks/voices/README.md +++ b/docs/sdks/voices/README.md @@ -79,19 +79,21 @@ with Mistral( ### 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. | +| 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 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `appearance` | [OptionalNullable[models.VoiceAppearance]](../../models/voiceappearance.md) | :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 @@ -170,15 +172,17 @@ with Mistral( ### 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. | +| 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 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `appearance` | [OptionalNullable[models.VoiceAppearance]](../../models/voiceappearance.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 diff --git a/docs/sdks/workflows/README.md b/docs/sdks/workflows/README.md index 45759776..0fcb9b8b 100644 --- a/docs/sdks/workflows/README.md +++ b/docs/sdks/workflows/README.md @@ -11,6 +11,8 @@ * [get_workflow](#get_workflow) - Get Workflow * [update_workflow](#update_workflow) - Update Workflow * [get_workflow_registration](#get_workflow_registration) - Get Workflow Registration +* [bulk_archive_workflows](#bulk_archive_workflows) - Bulk Archive Workflows +* [bulk_unarchive_workflows](#bulk_unarchive_workflows) - Bulk Unarchive Workflows * [archive_workflow](#archive_workflow) - Archive Workflow * [unarchive_workflow](#unarchive_workflow) - Unarchive Workflow @@ -340,6 +342,88 @@ with Mistral( | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | +## bulk_archive_workflows + +Bulk Archive 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.bulk_archive_workflows(workflow_ids=[]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `workflow_ids` | List[*str*] | :heavy_check_mark: | List of workflow IDs to archive | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowBulkArchiveResponse](../../models/workflowbulkarchiveresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## bulk_unarchive_workflows + +Bulk Unarchive 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.bulk_unarchive_workflows(workflow_ids=[]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `workflow_ids` | List[*str*] | :heavy_check_mark: | List of workflow IDs to unarchive | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowBulkUnarchiveResponse](../../models/workflowbulkunarchiveresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## archive_workflow Archive Workflow diff --git a/examples/azure/chat_no_streaming.py b/examples/azure/chat_no_streaming.py index 952b171d..cccfa2eb 100644 --- a/examples/azure/chat_no_streaming.py +++ b/examples/azure/chat_no_streaming.py @@ -19,4 +19,5 @@ UserMessage(content="What is the capital of France?"), ] res = client.chat.complete(model=AZURE_MODEL, messages=messages) -print(res.choices[0].message.content) +if res.choices and res.choices[0].message: + print(res.choices[0].message.content) diff --git a/packages/azure/.gitignore b/packages/azure/.gitignore index b386de74..a9654890 100644 --- a/packages/azure/.gitignore +++ b/packages/azure/.gitignore @@ -4,7 +4,6 @@ **/.speakeasy/temp/ **/.speakeasy/logs/ .speakeasy/reports -README-PYPI.md .venv/ venv/ src/*.egg-info/ diff --git a/packages/azure/.speakeasy/gen.lock b/packages/azure/.speakeasy/gen.lock index ec39708b..e96be0e1 100644 --- a/packages/azure/.speakeasy/gen.lock +++ b/packages/azure/.speakeasy/gen.lock @@ -1,48 +1,49 @@ lockVersion: 2.0.0 id: dc40fa48-2c4d-46ad-ac8b-270749770f34 management: - docChecksum: 564969ee9c3ae8a740e47605a64c0077 + docChecksum: e657bc210fa9d8169a75517584cfe478 docVersion: 1.0.0 - speakeasyVersion: 1.729.0 - generationVersion: 2.841.0 - releaseVersion: 2.0.0 - configChecksum: 62c02749475cfa5a77859c3b5fab5b8f + speakeasyVersion: 1.763.6 + generationVersion: 2.884.13 + releaseVersion: 2.1.0 + configChecksum: bc26627b24c855835f05b16e35a18296 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 + generation_id: f07aab1c-5923-4503-9d5d-a197e421c084 + pristine_commit_hash: b2c9916623e2899cd1ba4d37d480fd6f3661e4b7 + pristine_tree_hash: 01b0cdfce6e0e00a23f9debf094e22c0405a02d9 features: python: additionalDependencies: 1.0.0 additionalProperties: 1.0.1 configurableModuleName: 0.2.0 constsAndDefaults: 1.0.7 - core: 6.0.12 + core: 6.0.22 defaultEnabledRetries: 0.2.0 - enumUnions: 0.1.0 - envVarSecurityUsage: 0.3.2 - examples: 3.0.2 + enumUnions: 0.1.1 + envVarSecurityUsage: 0.3.3 + examples: 3.0.4 flatRequests: 1.0.1 - globalSecurity: 3.0.5 + globalSecurity: 3.0.7 globalSecurityCallbacks: 1.0.0 globalSecurityFlattening: 1.0.0 - globalServerURLs: 3.2.0 + globalServerURLs: 3.2.1 includes: 3.0.0 methodArguments: 1.0.2 nameOverrides: 3.0.3 nullables: 1.0.2 openEnums: 1.0.4 + operationTimeout: 0.3.1 responseFormat: 1.1.0 - retries: 3.0.4 + retries: 3.0.5 sdkHooks: 1.2.1 - serverEvents: 1.0.13 + serverEvents: 1.0.15 serverEventsSentinels: 0.1.0 serverIDs: 3.0.0 - unions: 3.1.4 + unions: 3.1.5 trackedFiles: .gitattributes: id: 24139dae6567 @@ -56,6 +57,10 @@ trackedFiles: id: 7fe2e5327e07 last_write_checksum: sha1:277a46811144643262651853dc6176d21b33573e pristine_git_object: 712a148c3e2305dca4c702851865f9f8c8e674cc + docs/models/apikeyauth.md: + id: 529789e1b079 + last_write_checksum: sha1:edb801076d411a5d6c1f7a3f4fdb4c3612b12ab1 + pristine_git_object: 1fbff10e21eb51df061790f0215cb4916318ebc1 docs/models/arguments.md: id: 7ea5e33709a7 last_write_checksum: sha1:09eea126210d7fd0353e60a76bf1dbed173f13ec @@ -68,22 +73,26 @@ trackedFiles: id: 9f1795bbe642 last_write_checksum: sha1:1ce4066623a8d62d969e5ed3a088d73a9ba26643 pristine_git_object: 047b7cf95f4db203bf2c501680b73ca0562a122d + docs/models/authorization.md: + id: dec4d9809e25 + last_write_checksum: sha1:6bf766a7b49ca2b706bb4eb88ba2d56406e06e1e + pristine_git_object: 11ea5c6a700e7b92f5cbd29e88e41b834f8b8ef4 docs/models/builtinconnectors.md: id: 9d14e972f08a - last_write_checksum: sha1:1f32eb515e32c58685d0bdc15de09656194c508c - pristine_git_object: f96f50444aaa23ca291db2fd0dc69db0d9d149d9 + last_write_checksum: sha1:2e88e09c549c6101d8ee93978514e168f5d348e3 + pristine_git_object: 150f89b05ac988beb0bd8072ba6d9326fb0c9d3e docs/models/chatcompletionchoice.md: id: 0d15c59ab501 - last_write_checksum: sha1:a6274a39a4239e054816d08517bf8507cb5c4564 - pristine_git_object: deaa0ea073e1b6c21bd466c10db31db2464066f1 + last_write_checksum: sha1:f3c9fa3cc092674a36bf28552b6900d62871b789 + pristine_git_object: 79d24a335c7ca1acb1469213d60ced2ec4987461 docs/models/chatcompletionchoicefinishreason.md: id: 225764da91d3 - last_write_checksum: sha1:b894d3408cb801e072c3c302a5676ff939d59284 - pristine_git_object: b2f15ecbe88328de95b4961ddb3940fd8a6ee64b + last_write_checksum: sha1:fb429ef425a1b01bd6e1a6cb5770034683ebef72 + pristine_git_object: 1ca6a646a7b9ef2b4dd9b0ba8de9e6c8aa63db93 docs/models/chatcompletionrequest.md: id: adffe90369d0 - last_write_checksum: sha1:00453565d70739471a4e1872c93b5b7e66fe6cb6 - pristine_git_object: f8715cd0a335c6dc0fda4b60400f11c4aa8a0a06 + last_write_checksum: sha1:c88753689fc6e0ef5dbbb0c3c6ac69d05e290b85 + pristine_git_object: ba44a0661680b2e757d08e898bf399f4d5c2dc11 docs/models/chatcompletionrequestmessage.md: id: 3f5e170d418c last_write_checksum: sha1:7921c5a508a9f88adc01caab34e26182b8035607 @@ -92,6 +101,10 @@ trackedFiles: 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 @@ -102,8 +115,8 @@ trackedFiles: pristine_git_object: a0465ffbfc5558628953e03fbc53b80bbdc8649b docs/models/chatcompletionstreamrequest.md: id: cf8f29558a68 - last_write_checksum: sha1:7233a19b12f3204b8e2259a4a09d0d9726609e4e - pristine_git_object: cc82a8c707268084865f86d71be82de5ebf6f821 + last_write_checksum: sha1:52faa9fc8bebad9ebc6b8d9be01d2f7890a4a515 + pristine_git_object: c3d90e133c2b4c1714cbddaa653ae646daed82dc docs/models/chatcompletionstreamrequestmessage.md: id: 053a98476cd2 last_write_checksum: sha1:8270692463fab1243d9de4bbef7162daa64e52c5 @@ -112,10 +125,18 @@ trackedFiles: 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/codeinterpretertool.md: + id: f009740c6e54 + last_write_checksum: sha1:a2114d61a98a48b4365a77c0c75c06ca834367ad + pristine_git_object: 6302fc627d7c49442b6c9aec19c70fdceaf7c519 docs/models/completionchunk.md: id: 60cb30423c60 last_write_checksum: sha1:61b976fe2e71236cf7941ee1635decc31bd304b2 @@ -130,8 +151,12 @@ trackedFiles: pristine_git_object: 1532c25b8fc065d486f52d4610a7f757e5340875 docs/models/completionresponsestreamchoicefinishreason.md: id: 5f1fbfc90b8e - last_write_checksum: sha1:20824b4a223cbd3658b32440973a7d47dcd108b9 - pristine_git_object: 0fece473297227c75db4e7ded63417a2f117cac0 + last_write_checksum: sha1:4bb61177835571bc4a271f14e1e2ea1780556d85 + pristine_git_object: f1bd6ad8a352b557344644bc1f55446e4024d795 + docs/models/confidencescoresgranularity.md: + id: 76a175c65878 + last_write_checksum: sha1:049eeb8421d61023dd5652cea4df1c62d8152914 + pristine_git_object: 32161eeed231ad16e4dbb212cce624d58f3093ea docs/models/contentchunk.md: id: d2d3a32080cd last_write_checksum: sha1:5839a26cdc412b78caad7fb59df97bdcea57be6d @@ -140,10 +165,14 @@ trackedFiles: id: e8f2f9e54b8e last_write_checksum: sha1:4c14b386f9f89d98f4dd9487ab030f10478c0e63 pristine_git_object: 107f1bd428b1f39b36f75e5a10532bc462967ce5 + docs/models/customconnector.md: + id: 7bcc77607afa + last_write_checksum: sha1:ce9e8ffac3f83e08269fbed5d2dffbfeb9f8649a + pristine_git_object: 0a0b69217abb0fbcbe30fad32c239aea070d3740 docs/models/deltamessage.md: id: 6c5ed6b60968 - last_write_checksum: sha1:00052476b9b2474dbc149f18dd18c71c86d0fc74 - pristine_git_object: e0ee575f3fce7c312114ce8c5390efc5c4854952 + last_write_checksum: sha1:c49575abe1bb581db1ae497b7a3b1ff2820abfbc + pristine_git_object: c2395e1bb06f983a2f56ab5900f126ed99ae9c11 docs/models/deltamessagecontent.md: id: 7307bedc8733 last_write_checksum: sha1:a1211b8cb576ad1358e68983680ee326c3920a5e @@ -152,6 +181,10 @@ trackedFiles: id: cd1d2a444370 last_write_checksum: sha1:d00a2ac808a0ae83a7b97da87e647ecc8dca9c52 pristine_git_object: 509d43b733d68d462853d9eb52fc913c855dff40 + docs/models/documentlibrarytool.md: + id: 68083b0ef8f3 + last_write_checksum: sha1:76b9f47c399915a338abe929cb10c1b37282eadf + pristine_git_object: 95c3fa52ee3ff29e72bc0240a98c0afaa0cd5f62 docs/models/documenturlchunk.md: id: 48437d297408 last_write_checksum: sha1:5f9294355929d66834c52c67990ba36a7f81387d @@ -162,8 +195,8 @@ trackedFiles: pristine_git_object: 18217114060ac4e4b45fefabace4628684f27e5c docs/models/format_.md: id: a17c22228eda - last_write_checksum: sha1:dad6de59fec6378d50356007602e2a0254d8d2e4 - pristine_git_object: 97d286a4ed7cff0a4058bbfa06c4573428182876 + last_write_checksum: sha1:305fff64a63eaaef9d2d0ea1f5c439b657515095 + pristine_git_object: 3311b410893086b87a077fa09b822e56e7acddb1 docs/models/function.md: id: 416a80fba031 last_write_checksum: sha1:a9485076d430a7753558461ce87bf42d09e34511 @@ -176,18 +209,26 @@ trackedFiles: id: 4b3bd62c0f26 last_write_checksum: sha1:754fe32bdffe53c1057b302702f5516f4e551cfb pristine_git_object: 87d7b4852de629015166605b273deb9341202dc0 + docs/models/guardrailconfig.md: + id: f60bf2eefb45 + last_write_checksum: sha1:e8dd384d2fd18d731753ba8d45a2975379c97052 + pristine_git_object: 1276462cc43fbd940f12282b1dca05e6fc7a16f9 docs/models/imagedetail.md: id: f8217529b496 - last_write_checksum: sha1:fdf19ac9459f64616240955cb81a84ef03e775c8 - pristine_git_object: 1e5ba3fd405a14e5e2872cc85504584dca19b726 + last_write_checksum: sha1:7588bc9f9c09df1b040f4b97b678b56e09244743 + pristine_git_object: d13adbf683bd58d3948f0057bf86b8754a132721 + 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:da7a792f7b649f311062338dfbf3d25ff55fe6c5 - pristine_git_object: db0c53d22e29fa25222edb86b264e5135879a029 + last_write_checksum: sha1:05e0c3053720c6ad6c663237a3f3621e0e9fed9f + pristine_git_object: 6d238e255d368c1b12ddc231dc5f8dc11279d47e docs/models/imageurlunion.md: id: 9d3c691a9db0 last_write_checksum: sha1:4e32bcd7d44746d2ddbfafbef96152bb2bdb2a15 @@ -202,52 +243,96 @@ trackedFiles: pristine_git_object: d6094ac2c6e0326c039dad2f6b89158694ef6aa7 docs/models/mistralpromptmode.md: id: d17d5db4d3b6 - last_write_checksum: sha1:abcb7205c5086169c7d9449d15ac142448a7d258 - pristine_git_object: c3409d03b9646e21a3793372d06dcae6fef95463 + last_write_checksum: sha1:200dff492c240b34321df5755933ba0344fdc9ca + pristine_git_object: 3a8f7841e73e56411185d6095aa96054b1bea6b0 + docs/models/moderationllmaction.md: + id: 26373b4ad9cd + last_write_checksum: sha1:443a682b1f1c5d5068316431aac6cdd65132b77e + pristine_git_object: 526b7a1311e66a2561cf1ac6277cd9412edf0a10 + 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/oauth2tokenauth.md: + id: f23959dcc4b0 + last_write_checksum: sha1:ca434f8479c3f5e868db1269e86efa5e0d9070e2 + pristine_git_object: 89f80436474e3c2293bb4fcafce11e626e2cdf79 + 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:091077fedf1b699d5160a21fe352056c247ef988 - pristine_git_object: 02473d44f73485fd7b7f0031d51bfac835d4036e + last_write_checksum: sha1:84b903d90dadcac943000b90e8a8e8a81c8b92fa + pristine_git_object: 0fc55052cdf2360131c0adcec93a732e2b0f78c5 docs/models/ocrrequest.md: id: 6862a3fc2d0f - last_write_checksum: sha1:eefa8ad80773e00ac297f3cf806704ac6ac3557d - pristine_git_object: 2d26c19fd1cecb234d7fb761dd73cc0a59e622ad + last_write_checksum: sha1:d06488b0ac9343813db7fe9f58d3a8450d7fa663 + pristine_git_object: 2066b90339c5bfb795e94581edc47412fac75a2e 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 + 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/pages.md: + id: 9045c659bb29 + last_write_checksum: sha1:b4b9daaa3e2bd6efeb6f5efe07e8da58385b3ee3 + pristine_git_object: a3631692d4d8c230e71c7c9c6ccb12b96fd93279 docs/models/prediction.md: id: 3c70b2262201 last_write_checksum: sha1:ca8a77219e6113f2358a5363e935288d90df0725 pristine_git_object: fae3c1ca4ba2c2ddb3b7de401ecdc8d56dcc7740 + docs/models/reasoningeffort.md: + id: c8fd630d3f07 + last_write_checksum: sha1:e76b9260f9dd23ab2f0c6a700602f918c3792857 + pristine_git_object: f39e92ac9f7c6a19e24b5773252d179e1b3856a9 docs/models/referencechunk.md: id: 07895f9debfd - last_write_checksum: sha1:4384049375a2566c7567599f97ce1ec19e9f6276 - pristine_git_object: d847e24845a399c7ca93d54701832fb65e01b3ab + 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/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 + last_write_checksum: sha1:97126f8e76a1893953f7c4b370dadc32ea0a1e24 + pristine_git_object: 73c02b7785e6e897fa04c3546aa12285b7e28e2e docs/models/security.md: id: 452e4d4eb67a last_write_checksum: sha1:ce2871b49c1632d50e22d0b1ebe4999021d52313 @@ -266,36 +351,40 @@ trackedFiles: pristine_git_object: 40030c170746d9953d25b979ab7e6f522018e230 docs/models/tableformat.md: id: d8cd08c55c3c - last_write_checksum: sha1:e0736ea9576466d71821aa1e67fc632cc5a85414 - pristine_git_object: 54f029b814fdcfa2e93e2b8b0594ef9e4eab792a + last_write_checksum: sha1:b1a0e125b25ed0fe71ea56bbce405e49cae46c9a + pristine_git_object: 14b06acbae039dbb46bd2872dbc16e5bdee4cffc 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 + last_write_checksum: sha1:db29812dbc6f9be7a385322d25a5cd98bfb3ef1e + pristine_git_object: d825497ee09624b829965d2b5bea2ddc54a32608 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 + last_write_checksum: sha1:2ab2016846da06ab38751176ba80fb6527c2818b + pristine_git_object: 85888d01cf439be601c8d1df4048c90161cf47df docs/models/toolcall.md: id: 80892ea1a051 - last_write_checksum: sha1:cb27b9d36cfe6227978c7a7a01b1349b6bac99d9 - pristine_git_object: 3819236b9f3eee2f6878818cfbbe2817e97f7de2 + last_write_checksum: sha1:621dc83981e13cbcbc21f2e16a34178c322c4566 + pristine_git_object: 9d236e8b289977d2aa7bded0d633b224c5ec9e57 docs/models/toolchoice.md: id: "097076343426" - last_write_checksum: sha1:25b33b34da02c3b46349dc8b6223f9ae18370d16 - pristine_git_object: 373046bbbc834169293b4f4ae8b2e238f952ddde + last_write_checksum: sha1:65a2794a1102fdcba6fa5a3f497630fbaf98f94b + pristine_git_object: a457f96f6e295d590a5ef75f83a5a6c4fdd41c47 docs/models/toolchoiceenum.md: id: 15410de51ffc - last_write_checksum: sha1:ca0cf9bf128bebc8faedd9333cc6a56b30f58130 - pristine_git_object: 0be3d6c54b13a8bf30773398a2c12e0d30d3ae58 + last_write_checksum: sha1:7cb97b478232ae43bae387483c7df310f5ebd9eb + pristine_git_object: 608091262e369e585ba2d9391671dedf1d1db539 + docs/models/toolconfiguration.md: + id: 06bfa2c4e662 + last_write_checksum: sha1:9b619977375f228c76f09d48d6e2833add6c07e2 + pristine_git_object: 89286a172124ce3473bcb081de6e4db8c95afefa docs/models/toolmessage.md: id: 0553747c37a1 last_write_checksum: sha1:ac61e644ba7c6da607cb479eafd1db78d8e8012e @@ -306,16 +395,12 @@ trackedFiles: 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 + 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/usageinfo.md: id: ec6fe65028a9 last_write_checksum: sha1:cf71fb9676d870eba7c4d10a69636e1db4054adc @@ -336,6 +421,14 @@ trackedFiles: id: 304bdf06ef8b last_write_checksum: sha1:1f297f34069668f6107f2c0389606efe413ff5a8 pristine_git_object: 5bcea5b5d12e72222720af2c014d64ec4bdfee4a + 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 py.typed: id: 258c3ed47ae4 last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 @@ -344,10 +437,6 @@ trackedFiles: 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 @@ -370,16 +459,16 @@ trackedFiles: pristine_git_object: 3e4e39555d60adebe84e596c8323ee5b80676fc9 src/mistralai/azure/client/_version.py: id: a77160e60e5d - last_write_checksum: sha1:991341c1aaa4a0fc2ef89aa7a69429b54764d309 - pristine_git_object: 8923c29dad7a842f2137ae6e466c8a7ddf13823d + last_write_checksum: sha1:78ea54afa03d5257fab907e6b9d8b352b6f83580 + pristine_git_object: 4641c83258e80ce3b79400e8cd2f4336d0f92012 src/mistralai/azure/client/basesdk.py: id: 5a585a95ec21 - last_write_checksum: sha1:0c2e686aa42d6aeeb103193aa058d6ddff7bcf74 - pristine_git_object: 0d4d9a440e6c7726b6bc7fc6525aa3dc009847eb + last_write_checksum: sha1:1ad34df596605b1ce2ada8d120223e5c13f7bd9a + pristine_git_object: e08ce351fbd7530d940fcd61c29f33285de91d58 src/mistralai/azure/client/chat.py: id: c18454e628d7 - last_write_checksum: sha1:884e22b0e313662c67cec7101765d8d7ef0bc48a - pristine_git_object: 1051f9527851894988f7e1689923575cf72a0896 + last_write_checksum: sha1:6f76826ff4e853b3ddd692f5f1b3d5a49cd9b257 + pristine_git_object: e3915c745af0bb1dac79b4fadea9d190b9472c62 src/mistralai/azure/client/errors/__init__.py: id: f377703514d9 last_write_checksum: sha1:36c516c11f8083c3380a72c1d0f0718a3345f24b @@ -410,64 +499,80 @@ trackedFiles: pristine_git_object: 89560b566073785535643e694c112bedbd3db13d src/mistralai/azure/client/models/__init__.py: id: "335011330e21" - last_write_checksum: sha1:6ae218231fc52b0ce36cf3ed2116c93e4782791f - pristine_git_object: 79c5df321d8d95cecd502e22a521165f70c5c635 + last_write_checksum: sha1:19ab292c86de25adc40cb0f8159cdfa382386e36 + pristine_git_object: d9c28adc636c9eb1e204eeee4775bb8ba53e5a25 + src/mistralai/azure/client/models/apikeyauth.py: + id: 90b0600cb391 + last_write_checksum: sha1:77e9e4546f94890349f82ed033b679bf495e7c48 + pristine_git_object: 7bce715c111562d0a32809f32dfdc4d337406c1e src/mistralai/azure/client/models/assistantmessage.py: id: 353ed9110f97 - last_write_checksum: sha1:973979ac03f86f26ee9a540aaaa8f70a7011daca - pristine_git_object: e9ae6e82c3c758561c8c9663f27b2fd7e38d2911 + last_write_checksum: sha1:9271319ff0ffc6190b2bb771dcd1a5378008c276 + pristine_git_object: f5e3316b0ff4818cb7b5d2d14d8fc6c4b4f951b9 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 + last_write_checksum: sha1:a99520160412adfa8b53d4d054c4d192d82920a1 + pristine_git_object: 7ab8832c80929a48412d03aae4e718a855229cfa src/mistralai/azure/client/models/chatcompletionrequest.py: id: 0c711c870184 - last_write_checksum: sha1:ffdd11a4945dd805c9a73328749c2f4d9b6f80e6 - pristine_git_object: edd0fdc74a1b81f458d6083e79dc393e488da36a + last_write_checksum: sha1:b290e59c11479f7c5d7e555a220fb99bb8c105e5 + pristine_git_object: 90dc0101c736b0dc10b3725fec32401c2300d559 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 + last_write_checksum: sha1:409ecde82694094b5acf730c6c87225649fb826e + pristine_git_object: 757d623150bc7b7e8ed9ebd514b3294f56d12f32 + src/mistralai/azure/client/models/codeinterpretertool.py: + id: b3a6fae1bf7c + last_write_checksum: sha1:25194d72cececa577ad4a010a910a346e25fb331 + pristine_git_object: 0f588be3278948fb4864c5193171f223d7372108 src/mistralai/azure/client/models/completionchunk.py: id: 28d620f25510 - last_write_checksum: sha1:84d1c55ef7bdb438e7f536a604a070799d054281 - pristine_git_object: 0e64bbc8aa0293c9d763db56287f296909260c38 + last_write_checksum: sha1:d980ae761d584f526417413c29d26a644adbbdd8 + pristine_git_object: f6168f17a21af0f45549bc345e29c7612afacddf 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 + last_write_checksum: sha1:215e9f0290c30472f322ca0baad251ddd363e90d + pristine_git_object: 36be83026bcd9431f87238971fca8e566a4c831c src/mistralai/azure/client/models/contentchunk.py: id: 1f65e4f8f731 last_write_checksum: sha1:cf11e1f061d3c8af040ebbdba0b25d4177e1cea4 pristine_git_object: 17efcc7d5825461576cf61257908688cffd23eb7 + src/mistralai/azure/client/models/customconnector.py: + id: 667abbf974f5 + last_write_checksum: sha1:3a9d4ea0fdb5c94d6849ae34b37786fc514d8084 + pristine_git_object: e7eac82ac40ccbe16e7f15b7130f34a5991f78e1 src/mistralai/azure/client/models/deltamessage.py: id: b7dab1d158de - last_write_checksum: sha1:190c2809d575244eda5efbb1e00a4ec5811aea29 - pristine_git_object: 567e772fc1b376efaec1a2dfd660bc74a916f8ee + last_write_checksum: sha1:1d9f3d87e728503470a62274bf4e14fbb334d0cf + pristine_git_object: 5bac18c228dd30a65d55c23ec4e9e4c845dd9de6 + src/mistralai/azure/client/models/documentlibrarytool.py: + id: 767763a86267 + last_write_checksum: sha1:5c56964279d1a4873ff5837b9353363917ba46ce + pristine_git_object: 6e2e31e795e8f0aaf05d1ad55f0f97c04437f15e src/mistralai/azure/client/models/documenturlchunk.py: id: e56fec6e977f - last_write_checksum: sha1:0313d94f343d46dac7cc3adc392feaf06fa2b2a4 - pristine_git_object: 2dea80056f6752bdaa5d00f391cb6f54371a9d2b + last_write_checksum: sha1:6ca5678c910d689b49b3aeb6d2ac3c88026d3315 + pristine_git_object: 03af581691982a7c92a920580ff977029c047a61 src/mistralai/azure/client/models/filechunk.py: id: 150d9f180110 - last_write_checksum: sha1:6d12d630a5bfd601836f9cb3d63b9eb2f15f880d - pristine_git_object: 6baa0cba81535e157c0f81ae2648362f7bd1adbd + last_write_checksum: sha1:abc825d41e5d50809612f6ccbdb13c6c275355dd + pristine_git_object: 772f67e6f68542d5d50925d1d0b257fc97449e27 src/mistralai/azure/client/models/function.py: id: 6d1e2011a14b - last_write_checksum: sha1:b064eca9256966603581d41b5b2c08cd2448224d - pristine_git_object: 055d3657fd98da63b80deb8cd2054e95a0e66a2b + last_write_checksum: sha1:a697a846786d49be782f6c4382034c161aa465fb + pristine_git_object: 3f135ed262430a705989607b9dee732b0270e71a src/mistralai/azure/client/models/functioncall.py: id: ced560a1bd57 last_write_checksum: sha1:490cb3a0305994de063e06fa4c77defa911271f3 @@ -476,66 +581,110 @@ trackedFiles: id: 6f09474ebc85 last_write_checksum: sha1:651ceed24416ce8192f70db03cc5cd0db685899f pristine_git_object: 839e0d557a902da6c819210962e38e1df9bda90f + src/mistralai/azure/client/models/guardrailconfig.py: + id: 58feab16c930 + last_write_checksum: sha1:73457a4444c46ca4ab9dce3b9e67c6940dfb8a18 + pristine_git_object: 4feffa67feecb2fa1e8b36128e95d2cb54fff4ca src/mistralai/azure/client/models/imagedetail.py: id: de211988043d last_write_checksum: sha1:812f2ec4fc0d8d13db643ed49192384d5a841aa4 pristine_git_object: 2d074cee614e1c49b69ee4073c3aaaa7a5a2c9e2 + src/mistralai/azure/client/models/imagegenerationtool.py: + id: 789c0facd38d + last_write_checksum: sha1:ffc9e94d9f1458001015182e195714a617cdc9fb + pristine_git_object: 5c51d688d9aebac94f628ebdbfbe4cd0cd142e3d src/mistralai/azure/client/models/imageurl.py: id: c8882341c798 - last_write_checksum: sha1:8c3c08cc5d33c66b12539270b7edbf157d936f86 - pristine_git_object: bcb4fe43d334752be501d694543250d7e632a9c7 + last_write_checksum: sha1:a65ea39bd95e932d2af43731c768c0a6fdbafbdd + pristine_git_object: c1704cd899da55f162245e748528f4b0162936ef src/mistralai/azure/client/models/imageurlchunk.py: id: b6f0abb574d7 - last_write_checksum: sha1:417618d9d2aba85386a100dfe818d13342830526 - pristine_git_object: 7213c49846a4107271d017dd695648d98c2efa94 + last_write_checksum: sha1:d4cac15f4dd55582aca63f97b2f054fb375ade6c + pristine_git_object: 8e8df9a624db97fd142c478ea298bf8e6cabb3cc src/mistralai/azure/client/models/jsonschema.py: id: bfd486f4bb18 - last_write_checksum: sha1:ccb2b53bd2351ec5119d9a7914a1a42c2746a096 - pristine_git_object: 99f2fb8903562465687edfd300d8efd373b92247 + last_write_checksum: sha1:d4c3bf57f61c8ec51552c24ea8353555733b4f37 + pristine_git_object: 2790728b9b2cabcd99f11695a36fd5c7e2c2da23 src/mistralai/azure/client/models/mistralpromptmode.py: id: d0028b1e4129 last_write_checksum: sha1:46fe1ab8ac2d5867877368a59a4aa5be2fabadeb pristine_git_object: 26e7adbdc4a981c92d51b72542c966b0ba0fb8f8 + src/mistralai/azure/client/models/moderationllmaction.py: + id: e2fba44eb74f + last_write_checksum: sha1:fbc27faa2fbaa51a66bee21935c4bce350291f5e + pristine_git_object: cff03d9aa6de26ce3daa9edbc065ec3f759b5ee6 + src/mistralai/azure/client/models/moderationllmv1categorythresholds.py: + id: f349ac02c9f0 + last_write_checksum: sha1:0e79c7b6296b2479929e5404626622c08752d2f1 + pristine_git_object: e3e9b22fb1ce89a4e9943fcb2a7a7aa665ed3ef4 + src/mistralai/azure/client/models/moderationllmv1config.py: + id: ac93fb39aadb + last_write_checksum: sha1:e24e34932dba1153a1ecf294d6cd78580b24e0cf + pristine_git_object: 8226887086a03b23627bd0b571efcff5ac92e27b + src/mistralai/azure/client/models/moderationllmv2categorythresholds.py: + id: ea8effbabe44 + last_write_checksum: sha1:12a4cd1a62d1c28b46c43fa062785f6217e40d3f + pristine_git_object: 57af08d82fd18e3a3a6c03d08e0c91c9c02433da + src/mistralai/azure/client/models/moderationllmv2config.py: + id: 35717297bfb3 + last_write_checksum: sha1:b66c2038d93cc8b5ba97a46a2cb724d65d6ef7ee + pristine_git_object: 57075e6051d669c7a531c13de6c6fa59c4fbd745 + src/mistralai/azure/client/models/oauth2tokenauth.py: + id: 11354c05bf86 + last_write_checksum: sha1:130bd53306d15d52f9dbc370bf1cfc129ba9ea30 + pristine_git_object: 3da345fce3ac1a56977ea6e216c7c03fbc751716 + src/mistralai/azure/client/models/ocrconfidencescore.py: + id: 523a4fdcb5b5 + last_write_checksum: sha1:fd008d51230ccdeaec923814c2d850f26ae0aab5 + pristine_git_object: 7ac59069009c5263d7c3ec016eb3dc5ccb12aea4 src/mistralai/azure/client/models/ocrimageobject.py: id: 9c9f987d94bb - last_write_checksum: sha1:423effee97a4120a26ba78c2abe7f6adeb5c733d - pristine_git_object: a23515b346a0f9517fec0b2381e1b0c04cb31816 + last_write_checksum: sha1:ddad5de6270b68f86ffd79322ce24dc8429b328a + pristine_git_object: 91d7ac0e16b3c9aafc055d1456de17abef14864f + src/mistralai/azure/client/models/ocrpageconfidencescores.py: + id: 697ff82a29a0 + last_write_checksum: sha1:7db4c357f8bfa78a6b448a5d80678b3c4e86c123 + pristine_git_object: 2d5d7a1ac3113eaa295ec98a739487beb03820a3 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 + last_write_checksum: sha1:b7a51aa640c4fc234618b9f362ab5972f39242ee + pristine_git_object: 08b5dbcb3734353dc44d235553ea98109be92795 src/mistralai/azure/client/models/ocrrequest.py: id: 365a5b4776a2 - last_write_checksum: sha1:e684da1b6db18cb9c5ce95b9cc58556e05a9ea9b - pristine_git_object: a2cd341593c9db3644076d39352abca6815efc56 + last_write_checksum: sha1:c59138d47c445ee26cdbeb290c56ad2f126a4b59 + pristine_git_object: 731c0cf82fd659a5a41917b7f2416cabbf322a85 src/mistralai/azure/client/models/ocrresponse.py: id: b8cde8c16a4c - last_write_checksum: sha1:55e81631f6fe57aaf58178460e1c5fc69fa19377 - pristine_git_object: 3dc09fd770a064e69e84519bd0f0c9127ebd8176 + last_write_checksum: sha1:d34db61dc06e7755e827e54c1b7e8c37b1ad5d12 + pristine_git_object: 6e27f574d2a4588f758c52be064744541265d5d7 src/mistralai/azure/client/models/ocrtableobject.py: id: c2cd51b8789e - last_write_checksum: sha1:86a8fd2241cf6a636e81e58484a90bdb7880085e - pristine_git_object: f1de5428a71f9d42cd9f9e764d0bbf88f3aad8cc + last_write_checksum: sha1:46a369822ea4311807e2103c22f42b19630fb2d9 + pristine_git_object: 07bc7c1309e5aef087b1b78f43be1041cd70460c src/mistralai/azure/client/models/ocrusageinfo.py: id: 5e9118cac468 - last_write_checksum: sha1:97887b58cfe6ebd9ebd5905c6c7485525d6dc788 - pristine_git_object: f63315d23a1659aee4333b45c4239861aa5220d7 + last_write_checksum: sha1:12f75c7d33a9f784eaafc97b24e94350fea2ae41 + pristine_git_object: b5c5f5c1189677bdc33d4d9a3f882f25dc5d4b4d src/mistralai/azure/client/models/prediction.py: id: bd6abfa93083 - last_write_checksum: sha1:07d06d5629af183f999e043744a67868ef779bcc - pristine_git_object: 1fa1d78248628ccdc102ce0631d344150addfd2d + last_write_checksum: sha1:8fde8f75071e011b7add558b3c61dfe2e04c2ea5 + pristine_git_object: 3d94feb5181b714b773ce4158af2bf786f382fa5 + src/mistralai/azure/client/models/reasoningeffort.py: + id: 16ce306129e5 + last_write_checksum: sha1:703d87ae8c89b9fa9284833c45daa77752c3a8e8 + pristine_git_object: 43ffa02b8407ab64d41f23c3a56c02fe275e38de src/mistralai/azure/client/models/referencechunk.py: id: c9612f854670 - last_write_checksum: sha1:e81e758e00db915e68f58ffa1e03b2c473f64477 - pristine_git_object: f7af9bf9a73e0d782e5e6c6a7866af6fbc3668d8 + last_write_checksum: sha1:20193f683118bf6491fbf54c103c9b7433d9c2de + pristine_git_object: debab3cece0fdbb7e8dbcdf31b773f4d2eb79fe4 src/mistralai/azure/client/models/responseformat.py: id: c124e7c316aa - last_write_checksum: sha1:d368a2d4320356b6daab1dd0c62c6c862e902ca0 - pristine_git_object: 20fd2b868506cff278d1d7dc719eddd56ea538b0 + last_write_checksum: sha1:8233b272403d9b96f194498d624703e936a7d4ad + pristine_git_object: 50f0b075404b540f8003e56dbe23f2f22b71f9d1 src/mistralai/azure/client/models/responseformats.py: id: fef416cefcd4 last_write_checksum: sha1:a212e85d286b5b49219f57d071a2232ff8b5263b @@ -558,52 +707,60 @@ trackedFiles: pristine_git_object: 9295148588a143278ff5f48f9142347e35cfdab2 src/mistralai/azure/client/models/thinkchunk.py: id: df6bbd55b3eb - last_write_checksum: sha1:b988cdf2755c3192aef30a9b2f945214fbc59785 - pristine_git_object: ec8e7f95be2ff0d742acb1fdea2867e23788cb06 + last_write_checksum: sha1:0be9b76a5278eb5ac537500cfc097d0a6605aa44 + pristine_git_object: 8e52ccc9dc36aad303a1aaf7f596f8d33071073b src/mistralai/azure/client/models/tool.py: id: 4075ef72c086 - last_write_checksum: sha1:4bef6d64b6426fdeff5031557c3c0e37f5c33b9a - pristine_git_object: 87329bdb73526120a3f63d48299114485a7fe038 + last_write_checksum: sha1:0d6610c91df755b3c9e037053e01acb3b2e7fe5f + pristine_git_object: ecfb5f34f0b09cedd026db218e99fdff5c994df8 src/mistralai/azure/client/models/toolcall.py: id: c65e6f79e539 - last_write_checksum: sha1:a3b36214b4533b79868630348762206a0e5ca26e - pristine_git_object: ada1ea65136fa58dce55f2857d895ea916bcd41f + last_write_checksum: sha1:c4892903cf784b2c9c419e0531dd50d73c7de117 + pristine_git_object: 87ccd030b41a93ad28a62accb84ec6bdbbb1d477 src/mistralai/azure/client/models/toolchoice.py: id: c25062b5de34 - last_write_checksum: sha1:6212c9366eb3b4f4062c86c00d4502dd03bf5ce1 - pristine_git_object: ddb9e1417c880c44a7f0505bfde839570fa3cd4a + last_write_checksum: sha1:8d33cc71f03e577f9ec3f98a23096d3eb75742cb + pristine_git_object: 15d1da1cebd1d8c36c33d60a4b57725e85c8f1e5 src/mistralai/azure/client/models/toolchoiceenum.py: id: cc06ba3a8d21 last_write_checksum: sha1:3dbba9a58c5569aafe115f3f7713a52b01ad8620 pristine_git_object: 01f6f677b379f9e3c99db9d1ad248cb0033a2804 + src/mistralai/azure/client/models/toolconfiguration.py: + id: b07091794add + last_write_checksum: sha1:7a31641d9497635de16a650d0a3e0c82bc4c36f3 + pristine_git_object: 6977679f36a90e5a86c6574fa8b3ef1fd2f24c19 src/mistralai/azure/client/models/toolmessage.py: id: 84ac736fa955 - last_write_checksum: sha1:e4ed14906985fe74fd76a9adb09125ebc1218a1f - pristine_git_object: 670210de0d05b52ee9dffbbb808a87e67c2d37a9 + last_write_checksum: sha1:aa9b117c29886ed3cf1a1269a9d4b180f40f6168 + pristine_git_object: e246d5a29af3d758a2e81413abe8d24b4a487872 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 + last_write_checksum: sha1:3f522c035643c96d12df6047a253c48735c29f38 + pristine_git_object: 0845fde3cbab8e46038e957367dbc1ea1581440f src/mistralai/azure/client/models/usageinfo.py: id: 3edc9c81b329 - last_write_checksum: sha1:0ac2350e4efa1ed3ffd7d33ac91c3ef564d1d773 - pristine_git_object: 0f04c87c97ff3148106408a46618c848b86c4b37 + last_write_checksum: sha1:98dce1963bb4a9cccc5634d79d210c2fb92d92de + pristine_git_object: 9200682a4344cfa6e67fb30d5dc7710fbb547940 src/mistralai/azure/client/models/usermessage.py: id: 3796508adc07 - last_write_checksum: sha1:8eb35fb07971d74cf2cb0858c037558f52df6aa9 - pristine_git_object: 549b01ca887651a95c5efc8aff3372d32dfdc277 + last_write_checksum: sha1:8e93e3edef3fc85c60a16d7e7b74a0fc357f4646 + pristine_git_object: 7dbca134f54afcb93e0cb2fd7faa09a3010c2172 src/mistralai/azure/client/models/validationerror.py: id: f2b84813e2ea - last_write_checksum: sha1:10b9637fc1c659518bc5bc9116058ad055869800 - pristine_git_object: f0169e18a5d0e3d1d87fd907697fcca22b11bc06 + last_write_checksum: sha1:ab5b5f28322856248c4288cce029c385100b80c4 + pristine_git_object: aaa72f21ce4ccbea4d7278539d898c5e9f799e44 + src/mistralai/azure/client/models/websearchpremiumtool.py: + id: 4b8bc6d9411d + last_write_checksum: sha1:7ae05870a61adb37cf8f2b7828f728b55fdd1440 + pristine_git_object: 252d8803e71d18b01e702ec2cbc6f57db0191e73 + src/mistralai/azure/client/models/websearchtool.py: + id: f0af7a3db559 + last_write_checksum: sha1:f5ed31a377eec433ebd35e6754a313590a5f83d3 + pristine_git_object: 363e033128fe7eb091280a58d53d0013b2020930 src/mistralai/azure/client/ocr.py: id: 5817c10c9297 - last_write_checksum: sha1:7666ca9f4596cee080952b2f4096bd4176051680 - pristine_git_object: b9270f6a52406d8a9bf02d90c24ae540da6dfb9d + last_write_checksum: sha1:935155cce07869bfed809449223528a892d2577a + pristine_git_object: c4f706a9b197f86183eece46dcc96c2786dfca5c src/mistralai/azure/client/py.typed: id: e88369f116d2 last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 @@ -642,8 +799,8 @@ trackedFiles: pristine_git_object: 3324e1bc2668c54c4d5f5a1a845675319757a828 src/mistralai/azure/client/utils/eventstreaming.py: id: bdc37b70360c - last_write_checksum: sha1:ffa870a25a7e4e2015bfd7a467ccd3aa1de97f0e - pristine_git_object: f2052fc22d9fd6c663ba3dce019fe234ca37108b + last_write_checksum: sha1:620d78a8b4e3b854e08d136e02e40a01a786bd70 + pristine_git_object: 3bdcd6d3d4fc772cb7f5fca8685dcdc8c85e13e8 src/mistralai/azure/client/utils/forms.py: id: 51696122c557 last_write_checksum: sha1:0ca31459b99f761fcc6d0557a0a38daac4ad50f4 @@ -658,8 +815,8 @@ trackedFiles: pristine_git_object: b661aff65d38b77d035149699aea09b2785d2fc6 src/mistralai/azure/client/utils/metadata.py: id: 44f85bd3b2e2 - last_write_checksum: sha1:c6a560bd0c63ab158582f34dadb69433ea73b3d4 - pristine_git_object: 173b3e5ce658675c2f504222a56b3daaaa68107d + last_write_checksum: sha1:e703e5cbb5255144aacf86898d1420529afaaff8 + pristine_git_object: 5abddd588837ac297050ca3b543627faadb350a9 src/mistralai/azure/client/utils/queryparams.py: id: ec1c03114156 last_write_checksum: sha1:b94c3f314fd3da0d1d215afc2731f48748e2aa59 @@ -674,12 +831,12 @@ trackedFiles: pristine_git_object: af07d4e941007af4213c5ec9047ef8a2fca04e5e src/mistralai/azure/client/utils/security.py: id: 1d35741ce5f1 - last_write_checksum: sha1:435dd8b180cefcd733e635b9fa45512da091d9c0 - pristine_git_object: 17996bd54b8624009802fbbdf30bcb4225b8dfed + last_write_checksum: sha1:c11eef495b6aaa249178c24c796940cc540b7a00 + pristine_git_object: 42d8d78e9981eed7507670014d99588e27ab325a src/mistralai/azure/client/utils/serializers.py: id: a1f26d73c3ad - last_write_checksum: sha1:ce1d8d7f500a9ccba0aeca5057cee9c271f4dfd7 - pristine_git_object: 14321eb479de81d0d9580ec8291e0ff91bf29e57 + last_write_checksum: sha1:61009f2e4ef6613a1a5af813fe020373dae5a492 + pristine_git_object: d2149f8b909cb96628db140ac3cddb1b1e981367 src/mistralai/azure/client/utils/unions.py: id: 9abcc9913e3f last_write_checksum: sha1:6e38049f323e0b5fb4bd0e88ab51ec447197ccb0 @@ -730,7 +887,6 @@ examples: 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 diff --git a/packages/azure/.speakeasy/gen.yaml b/packages/azure/.speakeasy/gen.yaml index 58016b88..f59f7edc 100644 --- a/packages/azure/.speakeasy/gen.yaml +++ b/packages/azure/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 2.0.0 + version: 2.1.0 additionalDependencies: dev: pytest: ^8.2.2 diff --git a/packages/azure/README-PYPI.md b/packages/azure/README-PYPI.md new file mode 100644 index 00000000..7b71bce3 --- /dev/null +++ b/packages/azure/README-PYPI.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](https://github.com/mistralai/client-python/blob/main/packages/azure/docs/sdks/chat/README.md) + +* [stream](https://github.com/mistralai/client-python/blob/main/packages/azure/docs/sdks/chat/README.md#stream) - Stream chat completion +* [complete](https://github.com/mistralai/client-python/blob/main/packages/azure/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 index 6844bc64..c20bf38c 100644 --- a/packages/azure/RELEASES.md +++ b/packages/azure/RELEASES.md @@ -38,4 +38,14 @@ Based on: ### 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 +- [PyPI v2.0.0] https://pypi.org/project/mistralai-azure/2.0.0 - packages/azure + +## 2026-05-22 14:13:06 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.763.6 (2.884.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.1.0] packages/azure +### Releases +- [PyPI v2.1.0] https://pypi.org/project/mistralai-azure/2.1.0 - packages/azure \ No newline at end of file diff --git a/packages/azure/docs/models/apikeyauth.md b/packages/azure/docs/models/apikeyauth.md new file mode 100644 index 00000000..1fbff10e --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/authorization.md b/packages/azure/docs/models/authorization.md new file mode 100644 index 00000000..11ea5c6a --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/builtinconnectors.md b/packages/azure/docs/models/builtinconnectors.md index f96f5044..150f89b0 100644 --- a/packages/azure/docs/models/builtinconnectors.md +++ b/packages/azure/docs/models/builtinconnectors.md @@ -1,12 +1,17 @@ # BuiltInConnectors +## Example Usage + +```python +from mistralai.azure.client.models import BuiltInConnectors +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 +- `"web_search"` +- `"web_search_premium"` +- `"code_interpreter"` +- `"image_generation"` +- `"document_library"` diff --git a/packages/azure/docs/models/chatcompletionchoice.md b/packages/azure/docs/models/chatcompletionchoice.md index deaa0ea0..79d24a33 100644 --- a/packages/azure/docs/models/chatcompletionchoice.md +++ b/packages/azure/docs/models/chatcompletionchoice.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | `index` | *int* | :heavy_check_mark: | N/A | 0 | -| `message` | [models.AssistantMessage](../models/assistantmessage.md) | :heavy_check_mark: | N/A | | +| `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/packages/azure/docs/models/chatcompletionchoicefinishreason.md b/packages/azure/docs/models/chatcompletionchoicefinishreason.md index b2f15ecb..1ca6a646 100644 --- a/packages/azure/docs/models/chatcompletionchoicefinishreason.md +++ b/packages/azure/docs/models/chatcompletionchoicefinishreason.md @@ -1,12 +1,21 @@ # ChatCompletionChoiceFinishReason +## Example Usage + +```python +from mistralai.azure.client.models import ChatCompletionChoiceFinishReason + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ChatCompletionChoiceFinishReason = "stop" +``` + ## Values -| Name | Value | -| -------------- | -------------- | -| `STOP` | stop | -| `LENGTH` | length | -| `MODEL_LENGTH` | model_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"` +- `"model_length"` +- `"error"` +- `"tool_calls"` diff --git a/packages/azure/docs/models/chatcompletionrequest.md b/packages/azure/docs/models/chatcompletionrequest.md index f8715cd0..ba44a066 100644 --- a/packages/azure/docs/models/chatcompletionrequest.md +++ b/packages/azure/docs/models/chatcompletionrequest.md @@ -7,20 +7,22 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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. | | +| `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.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 | | +| `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.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. | | +| `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` | *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. | | +| `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 | | | `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/chatcompletionrequesttool.md b/packages/azure/docs/models/chatcompletionrequesttool.md new file mode 100644 index 00000000..572d12ca --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/chatcompletionstreamrequest.md b/packages/azure/docs/models/chatcompletionstreamrequest.md index cc82a8c7..c3d90e13 100644 --- a/packages/azure/docs/models/chatcompletionstreamrequest.md +++ b/packages/azure/docs/models/chatcompletionstreamrequest.md @@ -7,20 +7,22 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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. | | +| `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.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 | | +| `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.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. | | +| `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` | *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. | | +| `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 | | | `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/chatcompletionstreamrequesttool.md b/packages/azure/docs/models/chatcompletionstreamrequesttool.md new file mode 100644 index 00000000..48998fcb --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/codeinterpretertool.md b/packages/azure/docs/models/codeinterpretertool.md new file mode 100644 index 00000000..6302fc62 --- /dev/null +++ b/packages/azure/docs/models/codeinterpretertool.md @@ -0,0 +1,9 @@ +# CodeInterpreterTool + + +## Fields + +| 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/packages/azure/docs/models/completionresponsestreamchoicefinishreason.md b/packages/azure/docs/models/completionresponsestreamchoicefinishreason.md index 0fece473..f1bd6ad8 100644 --- a/packages/azure/docs/models/completionresponsestreamchoicefinishreason.md +++ b/packages/azure/docs/models/completionresponsestreamchoicefinishreason.md @@ -1,11 +1,20 @@ # CompletionResponseStreamChoiceFinishReason +## Example Usage + +```python +from mistralai.azure.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/packages/azure/docs/models/confidencescoresgranularity.md b/packages/azure/docs/models/confidencescoresgranularity.md new file mode 100644 index 00000000..32161eee --- /dev/null +++ b/packages/azure/docs/models/confidencescoresgranularity.md @@ -0,0 +1,14 @@ +# ConfidenceScoresGranularity + +## Example Usage + +```python +from mistralai.azure.client.models import ConfidenceScoresGranularity +value: ConfidenceScoresGranularity = "word" +``` + + +## Values + +- `"word"` +- `"page"` diff --git a/packages/azure/docs/models/customconnector.md b/packages/azure/docs/models/customconnector.md new file mode 100644 index 00000000..0a0b6921 --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/deltamessage.md b/packages/azure/docs/models/deltamessage.md index e0ee575f..c2395e1b 100644 --- a/packages/azure/docs/models/deltamessage.md +++ b/packages/azure/docs/models/deltamessage.md @@ -3,8 +3,11 @@ ## 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 +| 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/packages/azure/docs/models/documentlibrarytool.md b/packages/azure/docs/models/documentlibrarytool.md new file mode 100644 index 00000000..95c3fa52 --- /dev/null +++ b/packages/azure/docs/models/documentlibrarytool.md @@ -0,0 +1,10 @@ +# DocumentLibraryTool + + +## Fields + +| 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/packages/azure/docs/models/format_.md b/packages/azure/docs/models/format_.md index 97d286a4..3311b410 100644 --- a/packages/azure/docs/models/format_.md +++ b/packages/azure/docs/models/format_.md @@ -2,10 +2,19 @@ Format of the table +## Example Usage + +```python +from mistralai.azure.client.models import Format + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Format = "markdown" +``` + ## Values -| Name | Value | -| ---------- | ---------- | -| `MARKDOWN` | markdown | -| `HTML` | html | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"markdown"` +- `"html"` diff --git a/packages/azure/docs/models/guardrailconfig.md b/packages/azure/docs/models/guardrailconfig.md new file mode 100644 index 00000000..1276462c --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/imagedetail.md b/packages/azure/docs/models/imagedetail.md index 1e5ba3fd..d13adbf6 100644 --- a/packages/azure/docs/models/imagedetail.md +++ b/packages/azure/docs/models/imagedetail.md @@ -1,10 +1,19 @@ # ImageDetail +## Example Usage + +```python +from mistralai.azure.client.models import ImageDetail + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ImageDetail = "low" +``` + ## Values -| Name | Value | -| ------ | ------ | -| `LOW` | low | -| `AUTO` | auto | -| `HIGH` | high | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"low"` +- `"auto"` +- `"high"` diff --git a/packages/azure/docs/models/imagegenerationtool.md b/packages/azure/docs/models/imagegenerationtool.md new file mode 100644 index 00000000..b476b6f2 --- /dev/null +++ b/packages/azure/docs/models/imagegenerationtool.md @@ -0,0 +1,9 @@ +# ImageGenerationTool + + +## Fields + +| 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/packages/azure/docs/models/imageurlchunk.md b/packages/azure/docs/models/imageurlchunk.md index db0c53d2..6d238e25 100644 --- a/packages/azure/docs/models/imageurlchunk.md +++ b/packages/azure/docs/models/imageurlchunk.md @@ -1,6 +1,6 @@ # ImageURLChunk -{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0 +{"type":"image_url","image_url":"data:image/png;base64,iVBORw0"} ## Fields diff --git a/packages/azure/docs/models/mistralpromptmode.md b/packages/azure/docs/models/mistralpromptmode.md index c3409d03..3a8f7841 100644 --- a/packages/azure/docs/models/mistralpromptmode.md +++ b/packages/azure/docs/models/mistralpromptmode.md @@ -4,9 +4,18 @@ 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.azure.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/packages/azure/docs/models/moderationllmaction.md b/packages/azure/docs/models/moderationllmaction.md new file mode 100644 index 00000000..526b7a13 --- /dev/null +++ b/packages/azure/docs/models/moderationllmaction.md @@ -0,0 +1,14 @@ +# ModerationLLMAction + +## Example Usage + +```python +from mistralai.azure.client.models import ModerationLLMAction +value: ModerationLLMAction = "none" +``` + + +## Values + +- `"none"` +- `"block"` diff --git a/packages/azure/docs/models/moderationllmv1categorythresholds.md b/packages/azure/docs/models/moderationllmv1categorythresholds.md new file mode 100644 index 00000000..90ae213f --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/moderationllmv1config.md b/packages/azure/docs/models/moderationllmv1config.md new file mode 100644 index 00000000..bdb5812b --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/moderationllmv2categorythresholds.md b/packages/azure/docs/models/moderationllmv2categorythresholds.md new file mode 100644 index 00000000..e95b81b0 --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/moderationllmv2config.md b/packages/azure/docs/models/moderationllmv2config.md new file mode 100644 index 00000000..e928506c --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/oauth2tokenauth.md b/packages/azure/docs/models/oauth2tokenauth.md new file mode 100644 index 00000000..89f80436 --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/ocrconfidencescore.md b/packages/azure/docs/models/ocrconfidencescore.md new file mode 100644 index 00000000..73fdcb28 --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/ocrpageconfidencescores.md b/packages/azure/docs/models/ocrpageconfidencescores.md new file mode 100644 index 00000000..bffb2148 --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/ocrpageobject.md b/packages/azure/docs/models/ocrpageobject.md index 02473d44..0fc55052 100644 --- a/packages/azure/docs/models/ocrpageobject.md +++ b/packages/azure/docs/models/ocrpageobject.md @@ -3,13 +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 | -| `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 +| 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/packages/azure/docs/models/ocrrequest.md b/packages/azure/docs/models/ocrrequest.md index 2d26c19f..2066b903 100644 --- a/packages/azure/docs/models/ocrrequest.md +++ b/packages/azure/docs/models/ocrrequest.md @@ -6,9 +6,8 @@ | 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 | | +| `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 | | @@ -17,4 +16,5 @@ | `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 +| `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/packages/azure/docs/models/ocrtableobject.md b/packages/azure/docs/models/ocrtableobject.md index 4e27697c..2da8f610 100644 --- a/packages/azure/docs/models/ocrtableobject.md +++ b/packages/azure/docs/models/ocrtableobject.md @@ -3,8 +3,9 @@ ## 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 +| 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/packages/azure/docs/models/pages.md b/packages/azure/docs/models/pages.md new file mode 100644 index 00000000..a3631692 --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/reasoningeffort.md b/packages/azure/docs/models/reasoningeffort.md new file mode 100644 index 00000000..f39e92ac --- /dev/null +++ b/packages/azure/docs/models/reasoningeffort.md @@ -0,0 +1,14 @@ +# ReasoningEffort + +## Example Usage + +```python +from mistralai.azure.client.models import ReasoningEffort +value: ReasoningEffort = "none" +``` + + +## Values + +- `"none"` +- `"high"` diff --git a/packages/azure/docs/models/referencechunk.md b/packages/azure/docs/models/referencechunk.md index d847e248..0186d3c3 100644 --- a/packages/azure/docs/models/referencechunk.md +++ b/packages/azure/docs/models/referencechunk.md @@ -3,7 +3,7 @@ ## 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 +| 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/packages/azure/docs/models/referenceid.md b/packages/azure/docs/models/referenceid.md new file mode 100644 index 00000000..1d29397f --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/responseformats.md b/packages/azure/docs/models/responseformats.md index 2f5f1e55..73c02b77 100644 --- a/packages/azure/docs/models/responseformats.md +++ b/packages/azure/docs/models/responseformats.md @@ -1,10 +1,15 @@ # ResponseFormats +## Example Usage + +```python +from mistralai.azure.client.models import ResponseFormats +value: ResponseFormats = "text" +``` + ## Values -| Name | Value | -| ------------- | ------------- | -| `TEXT` | text | -| `JSON_OBJECT` | json_object | -| `JSON_SCHEMA` | json_schema | \ No newline at end of file +- `"text"` +- `"json_object"` +- `"json_schema"` diff --git a/packages/azure/docs/models/tableformat.md b/packages/azure/docs/models/tableformat.md index 54f029b8..14b06acb 100644 --- a/packages/azure/docs/models/tableformat.md +++ b/packages/azure/docs/models/tableformat.md @@ -1,9 +1,14 @@ # TableFormat +## Example Usage + +```python +from mistralai.azure.client.models import TableFormat +value: TableFormat = "markdown" +``` + ## Values -| Name | Value | -| ---------- | ---------- | -| `MARKDOWN` | markdown | -| `HTML` | html | \ No newline at end of file +- `"markdown"` +- `"html"` diff --git a/packages/azure/docs/models/thinkchunk.md b/packages/azure/docs/models/thinkchunk.md index b07f598e..d825497e 100644 --- a/packages/azure/docs/models/thinkchunk.md +++ b/packages/azure/docs/models/thinkchunk.md @@ -7,4 +7,5 @@ | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | `type` | *Literal["thinking"]* | :heavy_check_mark: | N/A | | `thinking` | List[[models.Thinking](../models/thinking.md)] | :heavy_check_mark: | N/A | +| `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/packages/azure/docs/models/tool.md b/packages/azure/docs/models/tool.md index fb661f72..85888d01 100644 --- a/packages/azure/docs/models/tool.md +++ b/packages/azure/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/packages/azure/docs/models/toolcall.md b/packages/azure/docs/models/toolcall.md index 3819236b..9d236e8b 100644 --- a/packages/azure/docs/models/toolcall.md +++ b/packages/azure/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/packages/azure/docs/models/toolchoice.md b/packages/azure/docs/models/toolchoice.md index 373046bb..a457f96f 100644 --- a/packages/azure/docs/models/toolchoice.md +++ b/packages/azure/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/packages/azure/docs/models/toolchoiceenum.md b/packages/azure/docs/models/toolchoiceenum.md index 0be3d6c5..60809126 100644 --- a/packages/azure/docs/models/toolchoiceenum.md +++ b/packages/azure/docs/models/toolchoiceenum.md @@ -1,11 +1,16 @@ # ToolChoiceEnum +## Example Usage + +```python +from mistralai.azure.client.models import ToolChoiceEnum +value: ToolChoiceEnum = "auto" +``` + ## Values -| Name | Value | -| ---------- | ---------- | -| `AUTO` | auto | -| `NONE` | none | -| `ANY` | any | -| `REQUIRED` | required | \ No newline at end of file +- `"auto"` +- `"none"` +- `"any"` +- `"required"` diff --git a/packages/azure/docs/models/toolconfiguration.md b/packages/azure/docs/models/toolconfiguration.md new file mode 100644 index 00000000..89286a17 --- /dev/null +++ b/packages/azure/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/packages/azure/docs/models/toolreferencechunk.md b/packages/azure/docs/models/toolreferencechunk.md index 9fc10399..49ea4ca7 100644 --- a/packages/azure/docs/models/toolreferencechunk.md +++ b/packages/azure/docs/models/toolreferencechunk.md @@ -3,11 +3,11 @@ ## 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 +| 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/packages/gcp/docs/models/toolunion.md b/packages/azure/docs/models/toolreferencechunktool.md similarity index 87% rename from packages/gcp/docs/models/toolunion.md rename to packages/azure/docs/models/toolreferencechunktool.md index 2dcb3dee..999f7c34 100644 --- a/packages/gcp/docs/models/toolunion.md +++ b/packages/azure/docs/models/toolreferencechunktool.md @@ -1,4 +1,4 @@ -# ToolUnion +# ToolReferenceChunkTool ## Supported Types diff --git a/packages/azure/docs/models/tooltypes.md b/packages/azure/docs/models/tooltypes.md deleted file mode 100644 index 84e49253..00000000 --- a/packages/azure/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/azure/docs/models/websearchpremiumtool.md b/packages/azure/docs/models/websearchpremiumtool.md new file mode 100644 index 00000000..78b736cd --- /dev/null +++ b/packages/azure/docs/models/websearchpremiumtool.md @@ -0,0 +1,9 @@ +# WebSearchPremiumTool + + +## Fields + +| 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/packages/azure/docs/models/websearchtool.md b/packages/azure/docs/models/websearchtool.md new file mode 100644 index 00000000..4ca7333c --- /dev/null +++ b/packages/azure/docs/models/websearchtool.md @@ -0,0 +1,9 @@ +# WebSearchTool + + +## Fields + +| 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/packages/azure/pyproject.toml b/packages/azure/pyproject.toml index 334767bd..1e2424fe 100644 --- a/packages/azure/pyproject.toml +++ b/packages/azure/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mistralai-azure" -version = "2.0.0" +version = "2.1.0" description = "Python Client SDK for the Mistral AI API in Azure." authors = [{ name = "Mistral" }] requires-python = ">=3.10" @@ -20,6 +20,9 @@ dev = [ "pytest-asyncio>=0.23.7,<0.24", ] +[tool.uv] +exclude-newer = "7 days" + [tool.setuptools.package-data] "*" = ["py.typed", "src/mistralai/azure/client/py.typed"] diff --git a/packages/azure/src/mistralai/azure/client/_version.py b/packages/azure/src/mistralai/azure/client/_version.py index 8923c29d..4641c832 100644 --- a/packages/azure/src/mistralai/azure/client/_version.py +++ b/packages/azure/src/mistralai/azure/client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "mistralai-azure" -__version__: str = "2.0.0" +__version__: str = "2.1.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" +__gen_version__: str = "2.884.13" +__user_agent__: str = "speakeasy-sdk/python 2.1.0 2.884.13 1.0.0 mistralai-azure" try: if __package__ is not None: diff --git a/packages/azure/src/mistralai/azure/client/basesdk.py b/packages/azure/src/mistralai/azure/client/basesdk.py index 0d4d9a44..e08ce351 100644 --- a/packages/azure/src/mistralai/azure/client/basesdk.py +++ b/packages/azure/src/mistralai/azure/client/basesdk.py @@ -7,6 +7,7 @@ AfterErrorContext, AfterSuccessContext, BeforeRequestContext, + HookContext, ) from mistralai.azure.client.utils import ( RetryConfig, @@ -66,6 +67,7 @@ def _build_request_async( 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( @@ -87,6 +89,7 @@ def _build_request_async( url_override, http_headers, allow_empty_value, + allowed_fields, ) def _build_request( @@ -110,6 +113,7 @@ def _build_request( 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( @@ -131,6 +135,7 @@ def _build_request( url_override, http_headers, allow_empty_value, + allowed_fields, ) def _build_request_with_client( @@ -155,6 +160,7 @@ def _build_request_with_client( 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 = {} @@ -188,7 +194,9 @@ def _build_request_with_client( security = security() if security is not None: - security_headers, security_query_params = utils.get_security(security) + security_headers, security_query_params = utils.get_security( + security, allowed_fields + ) headers = {**headers, **security_headers} query_params = {**query_params, **security_query_params} @@ -225,15 +233,15 @@ def _build_request_with_client( data=serialized_request_body.data, files=serialized_request_body.files, headers=headers, - timeout=timeout, + timeout=timeout if timeout is not None else httpx.USE_CLIENT_DEFAULT, ) def do_request( self, - hook_ctx, - request, - error_status_codes, - stream=False, + hook_ctx: HookContext, + request: httpx.Request, + is_error_status_code: Callable[[int], bool], + stream: bool = False, retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, ) -> httpx.Response: client = self.sdk_configuration.client @@ -245,6 +253,8 @@ 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, @@ -275,19 +285,6 @@ def do(): "" 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: @@ -295,17 +292,27 @@ def do(): else: http_res = do() - if not utils.match_status_codes(error_status_codes, http_res.status_code): + if is_error_status_code(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) + else: 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, + hook_ctx: HookContext, + request: httpx.Request, + is_error_status_code: Callable[[int], bool], + stream: bool = False, retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, ) -> httpx.Response: client = self.sdk_configuration.async_client @@ -320,6 +327,8 @@ async def do(): 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, @@ -353,20 +362,6 @@ async def do(): "" 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: @@ -376,7 +371,20 @@ async def do(): else: http_res = await do() - if not utils.match_status_codes(error_status_codes, http_res.status_code): + if is_error_status_code(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) + else: http_res = await run_sync_in_thread( hooks.after_success, AfterSuccessContext(hook_ctx), http_res ) diff --git a/packages/azure/src/mistralai/azure/client/chat.py b/packages/azure/src/mistralai/azure/client/chat.py index 1051f952..e3915c74 100644 --- a/packages/azure/src/mistralai/azure/client/chat.py +++ b/packages/azure/src/mistralai/azure/client/chat.py @@ -21,22 +21,25 @@ def stream( ], model: Optional[str] = "azureai", temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, + top_p: OptionalNullable[float] = UNSET, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = True, - stop: Optional[ + stop: OptionalNullable[ Union[ models.ChatCompletionStreamRequestStop, models.ChatCompletionStreamRequestStopTypedDict, ] - ] = None, + ] = 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.Tool], List[models.ToolTypedDict]] + Union[ + List[models.ChatCompletionStreamRequestTool], + List[models.ChatCompletionStreamRequestToolTypedDict], + ] ] = UNSET, tool_choice: Optional[ Union[ @@ -44,14 +47,18 @@ def stream( models.ChatCompletionStreamRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = 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, safe_prompt: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -79,7 +86,9 @@ def stream( :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 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 @@ -91,6 +100,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: @@ -111,7 +123,9 @@ def stream( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ChatCompletionStreamRequestTool]] + ), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] ), @@ -122,13 +136,17 @@ def stream( 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]] + ), safe_prompt=safe_prompt, ) req = self._build_request( method="POST", - path="/chat/completions#stream", + path="/models/chat/completions#stream", base_url=base_url, url_variables=url_variables, request=request, @@ -163,7 +181,7 @@ def stream( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -201,22 +219,25 @@ async def stream_async( ], model: Optional[str] = "azureai", temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, + top_p: OptionalNullable[float] = UNSET, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = True, - stop: Optional[ + stop: OptionalNullable[ Union[ models.ChatCompletionStreamRequestStop, models.ChatCompletionStreamRequestStopTypedDict, ] - ] = None, + ] = 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.Tool], List[models.ToolTypedDict]] + Union[ + List[models.ChatCompletionStreamRequestTool], + List[models.ChatCompletionStreamRequestToolTypedDict], + ] ] = UNSET, tool_choice: Optional[ Union[ @@ -224,14 +245,18 @@ async def stream_async( models.ChatCompletionStreamRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = 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, safe_prompt: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -259,7 +284,9 @@ async def stream_async( :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 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 @@ -271,6 +298,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: @@ -291,7 +321,9 @@ async def stream_async( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ChatCompletionStreamRequestTool]] + ), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] ), @@ -302,13 +334,17 @@ async def stream_async( 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]] + ), safe_prompt=safe_prompt, ) req = self._build_request_async( method="POST", - path="/chat/completions#stream", + path="/models/chat/completions#stream", base_url=base_url, url_variables=url_variables, request=request, @@ -343,7 +379,7 @@ async def stream_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -381,22 +417,25 @@ def complete( ], model: Optional[str] = "azureai", temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, + top_p: OptionalNullable[float] = UNSET, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = False, - stop: Optional[ + stop: OptionalNullable[ Union[ models.ChatCompletionRequestStop, models.ChatCompletionRequestStopTypedDict, ] - ] = None, + ] = 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.Tool], List[models.ToolTypedDict]] + Union[ + List[models.ChatCompletionRequestTool], + List[models.ChatCompletionRequestToolTypedDict], + ] ] = UNSET, tool_choice: Optional[ Union[ @@ -404,14 +443,18 @@ def complete( models.ChatCompletionRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = 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, safe_prompt: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -437,7 +480,9 @@ def complete( :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 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 @@ -449,6 +494,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: @@ -469,7 +517,9 @@ def complete( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ChatCompletionRequestTool]] + ), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.ChatCompletionRequestToolChoice] ), @@ -480,13 +530,17 @@ def complete( 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]] + ), safe_prompt=safe_prompt, ) req = self._build_request( method="POST", - path="/chat/completions", + path="/models/chat/completions", base_url=base_url, url_variables=url_variables, request=request, @@ -521,7 +575,7 @@ def complete( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -551,22 +605,25 @@ async def complete_async( ], model: Optional[str] = "azureai", temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, + top_p: OptionalNullable[float] = UNSET, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = False, - stop: Optional[ + stop: OptionalNullable[ Union[ models.ChatCompletionRequestStop, models.ChatCompletionRequestStopTypedDict, ] - ] = None, + ] = 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.Tool], List[models.ToolTypedDict]] + Union[ + List[models.ChatCompletionRequestTool], + List[models.ChatCompletionRequestToolTypedDict], + ] ] = UNSET, tool_choice: Optional[ Union[ @@ -574,14 +631,18 @@ async def complete_async( models.ChatCompletionRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = 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, safe_prompt: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -607,7 +668,9 @@ async def complete_async( :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 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 @@ -619,6 +682,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: @@ -639,7 +705,9 @@ async def complete_async( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ChatCompletionRequestTool]] + ), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.ChatCompletionRequestToolChoice] ), @@ -650,13 +718,17 @@ async def complete_async( 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]] + ), safe_prompt=safe_prompt, ) req = self._build_request_async( method="POST", - path="/chat/completions", + path="/models/chat/completions", base_url=base_url, url_variables=url_variables, request=request, @@ -691,7 +763,7 @@ async def complete_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/packages/azure/src/mistralai/azure/client/models/__init__.py b/packages/azure/src/mistralai/azure/client/models/__init__.py index 79c5df32..d9c28adc 100644 --- a/packages/azure/src/mistralai/azure/client/models/__init__.py +++ b/packages/azure/src/mistralai/azure/client/models/__init__.py @@ -5,6 +5,7 @@ from mistralai.azure.client.utils.dynamic_imports import lazy_getattr, lazy_dir if TYPE_CHECKING: + from .apikeyauth import APIKeyAuth, APIKeyAuthTypedDict from .assistantmessage import ( AssistantMessage, AssistantMessageContent, @@ -23,8 +24,10 @@ ChatCompletionRequestMessageTypedDict, ChatCompletionRequestStop, ChatCompletionRequestStopTypedDict, + ChatCompletionRequestTool, ChatCompletionRequestToolChoice, ChatCompletionRequestToolChoiceTypedDict, + ChatCompletionRequestToolTypedDict, ChatCompletionRequestTypedDict, ) from .chatcompletionresponse import ( @@ -37,10 +40,13 @@ ChatCompletionStreamRequestMessageTypedDict, ChatCompletionStreamRequestStop, ChatCompletionStreamRequestStopTypedDict, + ChatCompletionStreamRequestTool, ChatCompletionStreamRequestToolChoice, ChatCompletionStreamRequestToolChoiceTypedDict, + ChatCompletionStreamRequestToolTypedDict, ChatCompletionStreamRequestTypedDict, ) + from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict from .completionchunk import CompletionChunk, CompletionChunkTypedDict from .completionevent import CompletionEvent, CompletionEventTypedDict from .completionresponsestreamchoice import ( @@ -49,12 +55,19 @@ CompletionResponseStreamChoiceTypedDict, ) from .contentchunk import ContentChunk, ContentChunkTypedDict, UnknownContentChunk + from .customconnector import ( + Authorization, + AuthorizationTypedDict, + CustomConnector, + CustomConnectorTypedDict, + ) from .deltamessage import ( DeltaMessage, DeltaMessageContent, DeltaMessageContentTypedDict, DeltaMessageTypedDict, ) + from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict from .filechunk import FileChunk, FileChunkTypedDict from .function import Function, FunctionTypedDict @@ -65,7 +78,9 @@ FunctionCallTypedDict, ) from .functionname import FunctionName, FunctionNameTypedDict + from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict from .imagedetail import ImageDetail + from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict from .imageurl import ImageURL, ImageURLTypedDict from .imageurlchunk import ( ImageURLChunk, @@ -75,21 +90,53 @@ ) from .jsonschema import JSONSchema, JSONSchemaTypedDict from .mistralpromptmode import MistralPromptMode + 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 .oauth2tokenauth import OAuth2TokenAuth, OAuth2TokenAuthTypedDict + 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, Document, DocumentTypedDict, OCRRequest, OCRRequestTypedDict, + Pages, + PagesTypedDict, 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 .reasoningeffort import ReasoningEffort + from .referencechunk import ( + ReferenceChunk, + ReferenceChunkTypedDict, + ReferenceID, + ReferenceIDTypedDict, + ) from .responseformat import ResponseFormat, ResponseFormatTypedDict from .responseformats import ResponseFormats from .security import Security, SecurityTypedDict @@ -109,6 +156,7 @@ from .toolcall import ToolCall, ToolCallTypedDict from .toolchoice import ToolChoice, ToolChoiceTypedDict from .toolchoiceenum import ToolChoiceEnum + from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict from .toolmessage import ( ToolMessage, ToolMessageContent, @@ -117,11 +165,10 @@ ) from .toolreferencechunk import ( ToolReferenceChunk, + ToolReferenceChunkTool, + ToolReferenceChunkToolTypedDict, ToolReferenceChunkTypedDict, - ToolUnion, - ToolUnionTypedDict, ) - from .tooltypes import ToolTypes from .usageinfo import UsageInfo, UsageInfoTypedDict from .usermessage import ( UserMessage, @@ -137,14 +184,23 @@ ValidationError, ValidationErrorTypedDict, ) + from .websearchpremiumtool import ( + WebSearchPremiumTool, + WebSearchPremiumToolTypedDict, + ) + from .websearchtool import WebSearchTool, WebSearchToolTypedDict __all__ = [ + "APIKeyAuth", + "APIKeyAuthTypedDict", "Arguments", "ArgumentsTypedDict", "AssistantMessage", "AssistantMessageContent", "AssistantMessageContentTypedDict", "AssistantMessageTypedDict", + "Authorization", + "AuthorizationTypedDict", "BuiltInConnectors", "ChatCompletionChoice", "ChatCompletionChoiceFinishReason", @@ -154,8 +210,10 @@ "ChatCompletionRequestMessageTypedDict", "ChatCompletionRequestStop", "ChatCompletionRequestStopTypedDict", + "ChatCompletionRequestTool", "ChatCompletionRequestToolChoice", "ChatCompletionRequestToolChoiceTypedDict", + "ChatCompletionRequestToolTypedDict", "ChatCompletionRequestTypedDict", "ChatCompletionResponse", "ChatCompletionResponseTypedDict", @@ -164,9 +222,13 @@ "ChatCompletionStreamRequestMessageTypedDict", "ChatCompletionStreamRequestStop", "ChatCompletionStreamRequestStopTypedDict", + "ChatCompletionStreamRequestTool", "ChatCompletionStreamRequestToolChoice", "ChatCompletionStreamRequestToolChoiceTypedDict", + "ChatCompletionStreamRequestToolTypedDict", "ChatCompletionStreamRequestTypedDict", + "CodeInterpreterTool", + "CodeInterpreterToolTypedDict", "CompletionChunk", "CompletionChunkTypedDict", "CompletionEvent", @@ -174,15 +236,20 @@ "CompletionResponseStreamChoice", "CompletionResponseStreamChoiceFinishReason", "CompletionResponseStreamChoiceTypedDict", + "ConfidenceScoresGranularity", "ContentChunk", "ContentChunkTypedDict", "Context", "ContextTypedDict", + "CustomConnector", + "CustomConnectorTypedDict", "DeltaMessage", "DeltaMessageContent", "DeltaMessageContentTypedDict", "DeltaMessageTypedDict", "Document", + "DocumentLibraryTool", + "DocumentLibraryToolTypedDict", "DocumentTypedDict", "DocumentURLChunk", "DocumentURLChunkTypedDict", @@ -195,7 +262,11 @@ "FunctionName", "FunctionNameTypedDict", "FunctionTypedDict", + "GuardrailConfig", + "GuardrailConfigTypedDict", "ImageDetail", + "ImageGenerationTool", + "ImageGenerationToolTypedDict", "ImageURL", "ImageURLChunk", "ImageURLChunkTypedDict", @@ -207,8 +278,23 @@ "Loc", "LocTypedDict", "MistralPromptMode", + "ModerationLLMAction", + "ModerationLlmv1CategoryThresholds", + "ModerationLlmv1CategoryThresholdsTypedDict", + "ModerationLlmv1Config", + "ModerationLlmv1ConfigTypedDict", + "ModerationLlmv2CategoryThresholds", + "ModerationLlmv2CategoryThresholdsTypedDict", + "ModerationLlmv2Config", + "ModerationLlmv2ConfigTypedDict", + "OAuth2TokenAuth", + "OAuth2TokenAuthTypedDict", + "OCRConfidenceScore", + "OCRConfidenceScoreTypedDict", "OCRImageObject", "OCRImageObjectTypedDict", + "OCRPageConfidenceScores", + "OCRPageConfidenceScoresTypedDict", "OCRPageDimensions", "OCRPageDimensionsTypedDict", "OCRPageObject", @@ -221,10 +307,15 @@ "OCRTableObjectTypedDict", "OCRUsageInfo", "OCRUsageInfoTypedDict", + "Pages", + "PagesTypedDict", "Prediction", "PredictionTypedDict", + "ReasoningEffort", "ReferenceChunk", "ReferenceChunkTypedDict", + "ReferenceID", + "ReferenceIDTypedDict", "ResponseFormat", "ResponseFormatTypedDict", "ResponseFormats", @@ -249,16 +340,17 @@ "ToolChoice", "ToolChoiceEnum", "ToolChoiceTypedDict", + "ToolConfiguration", + "ToolConfigurationTypedDict", "ToolMessage", "ToolMessageContent", "ToolMessageContentTypedDict", "ToolMessageTypedDict", "ToolReferenceChunk", + "ToolReferenceChunkTool", + "ToolReferenceChunkToolTypedDict", "ToolReferenceChunkTypedDict", "ToolTypedDict", - "ToolTypes", - "ToolUnion", - "ToolUnionTypedDict", "UnknownContentChunk", "UsageInfo", "UsageInfoTypedDict", @@ -268,9 +360,15 @@ "UserMessageTypedDict", "ValidationError", "ValidationErrorTypedDict", + "WebSearchPremiumTool", + "WebSearchPremiumToolTypedDict", + "WebSearchTool", + "WebSearchToolTypedDict", ] _dynamic_imports: dict[str, str] = { + "APIKeyAuth": ".apikeyauth", + "APIKeyAuthTypedDict": ".apikeyauth", "AssistantMessage": ".assistantmessage", "AssistantMessageContent": ".assistantmessage", "AssistantMessageContentTypedDict": ".assistantmessage", @@ -284,8 +382,10 @@ "ChatCompletionRequestMessageTypedDict": ".chatcompletionrequest", "ChatCompletionRequestStop": ".chatcompletionrequest", "ChatCompletionRequestStopTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestTool": ".chatcompletionrequest", "ChatCompletionRequestToolChoice": ".chatcompletionrequest", "ChatCompletionRequestToolChoiceTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestToolTypedDict": ".chatcompletionrequest", "ChatCompletionRequestTypedDict": ".chatcompletionrequest", "ChatCompletionResponse": ".chatcompletionresponse", "ChatCompletionResponseTypedDict": ".chatcompletionresponse", @@ -294,9 +394,13 @@ "ChatCompletionStreamRequestMessageTypedDict": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestStop": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestStopTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestTool": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestToolChoice": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestToolChoiceTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestToolTypedDict": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestTypedDict": ".chatcompletionstreamrequest", + "CodeInterpreterTool": ".codeinterpretertool", + "CodeInterpreterToolTypedDict": ".codeinterpretertool", "CompletionChunk": ".completionchunk", "CompletionChunkTypedDict": ".completionchunk", "CompletionEvent": ".completionevent", @@ -307,10 +411,16 @@ "ContentChunk": ".contentchunk", "ContentChunkTypedDict": ".contentchunk", "UnknownContentChunk": ".contentchunk", + "Authorization": ".customconnector", + "AuthorizationTypedDict": ".customconnector", + "CustomConnector": ".customconnector", + "CustomConnectorTypedDict": ".customconnector", "DeltaMessage": ".deltamessage", "DeltaMessageContent": ".deltamessage", "DeltaMessageContentTypedDict": ".deltamessage", "DeltaMessageTypedDict": ".deltamessage", + "DocumentLibraryTool": ".documentlibrarytool", + "DocumentLibraryToolTypedDict": ".documentlibrarytool", "DocumentURLChunk": ".documenturlchunk", "DocumentURLChunkTypedDict": ".documenturlchunk", "FileChunk": ".filechunk", @@ -323,7 +433,11 @@ "FunctionCallTypedDict": ".functioncall", "FunctionName": ".functionname", "FunctionNameTypedDict": ".functionname", + "GuardrailConfig": ".guardrailconfig", + "GuardrailConfigTypedDict": ".guardrailconfig", "ImageDetail": ".imagedetail", + "ImageGenerationTool": ".imagegenerationtool", + "ImageGenerationToolTypedDict": ".imagegenerationtool", "ImageURL": ".imageurl", "ImageURLTypedDict": ".imageurl", "ImageURLChunk": ".imageurlchunk", @@ -333,16 +447,34 @@ "JSONSchema": ".jsonschema", "JSONSchemaTypedDict": ".jsonschema", "MistralPromptMode": ".mistralpromptmode", + "ModerationLLMAction": ".moderationllmaction", + "ModerationLlmv1CategoryThresholds": ".moderationllmv1categorythresholds", + "ModerationLlmv1CategoryThresholdsTypedDict": ".moderationllmv1categorythresholds", + "ModerationLlmv1Config": ".moderationllmv1config", + "ModerationLlmv1ConfigTypedDict": ".moderationllmv1config", + "ModerationLlmv2CategoryThresholds": ".moderationllmv2categorythresholds", + "ModerationLlmv2CategoryThresholdsTypedDict": ".moderationllmv2categorythresholds", + "ModerationLlmv2Config": ".moderationllmv2config", + "ModerationLlmv2ConfigTypedDict": ".moderationllmv2config", + "OAuth2TokenAuth": ".oauth2tokenauth", + "OAuth2TokenAuthTypedDict": ".oauth2tokenauth", + "OCRConfidenceScore": ".ocrconfidencescore", + "OCRConfidenceScoreTypedDict": ".ocrconfidencescore", "OCRImageObject": ".ocrimageobject", "OCRImageObjectTypedDict": ".ocrimageobject", + "OCRPageConfidenceScores": ".ocrpageconfidencescores", + "OCRPageConfidenceScoresTypedDict": ".ocrpageconfidencescores", "OCRPageDimensions": ".ocrpagedimensions", "OCRPageDimensionsTypedDict": ".ocrpagedimensions", "OCRPageObject": ".ocrpageobject", "OCRPageObjectTypedDict": ".ocrpageobject", + "ConfidenceScoresGranularity": ".ocrrequest", "Document": ".ocrrequest", "DocumentTypedDict": ".ocrrequest", "OCRRequest": ".ocrrequest", "OCRRequestTypedDict": ".ocrrequest", + "Pages": ".ocrrequest", + "PagesTypedDict": ".ocrrequest", "TableFormat": ".ocrrequest", "OCRResponse": ".ocrresponse", "OCRResponseTypedDict": ".ocrresponse", @@ -353,8 +485,11 @@ "OCRUsageInfoTypedDict": ".ocrusageinfo", "Prediction": ".prediction", "PredictionTypedDict": ".prediction", + "ReasoningEffort": ".reasoningeffort", "ReferenceChunk": ".referencechunk", "ReferenceChunkTypedDict": ".referencechunk", + "ReferenceID": ".referencechunk", + "ReferenceIDTypedDict": ".referencechunk", "ResponseFormat": ".responseformat", "ResponseFormatTypedDict": ".responseformat", "ResponseFormats": ".responseformats", @@ -379,15 +514,16 @@ "ToolChoice": ".toolchoice", "ToolChoiceTypedDict": ".toolchoice", "ToolChoiceEnum": ".toolchoiceenum", + "ToolConfiguration": ".toolconfiguration", + "ToolConfigurationTypedDict": ".toolconfiguration", "ToolMessage": ".toolmessage", "ToolMessageContent": ".toolmessage", "ToolMessageContentTypedDict": ".toolmessage", "ToolMessageTypedDict": ".toolmessage", "ToolReferenceChunk": ".toolreferencechunk", + "ToolReferenceChunkTool": ".toolreferencechunk", + "ToolReferenceChunkToolTypedDict": ".toolreferencechunk", "ToolReferenceChunkTypedDict": ".toolreferencechunk", - "ToolUnion": ".toolreferencechunk", - "ToolUnionTypedDict": ".toolreferencechunk", - "ToolTypes": ".tooltypes", "UsageInfo": ".usageinfo", "UsageInfoTypedDict": ".usageinfo", "UserMessage": ".usermessage", @@ -400,6 +536,10 @@ "LocTypedDict": ".validationerror", "ValidationError": ".validationerror", "ValidationErrorTypedDict": ".validationerror", + "WebSearchPremiumTool": ".websearchpremiumtool", + "WebSearchPremiumToolTypedDict": ".websearchpremiumtool", + "WebSearchTool": ".websearchtool", + "WebSearchToolTypedDict": ".websearchtool", } diff --git a/packages/azure/src/mistralai/azure/client/models/apikeyauth.py b/packages/azure/src/mistralai/azure/client/models/apikeyauth.py new file mode 100644 index 00000000..7bce715c --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/apikeyauth.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 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/packages/azure/src/mistralai/azure/client/models/assistantmessage.py b/packages/azure/src/mistralai/azure/client/models/assistantmessage.py index e9ae6e82..f5e3316b 100644 --- a/packages/azure/src/mistralai/azure/client/models/assistantmessage.py +++ b/packages/azure/src/mistralai/azure/client/models/assistantmessage.py @@ -60,7 +60,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/chatcompletionchoice.py b/packages/azure/src/mistralai/azure/client/models/chatcompletionchoice.py index 67b5ba69..7ab8832c 100644 --- a/packages/azure/src/mistralai/azure/client/models/chatcompletionchoice.py +++ b/packages/azure/src/mistralai/azure/client/models/chatcompletionchoice.py @@ -2,9 +2,11 @@ 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 +from .deltamessage import DeltaMessage, DeltaMessageTypedDict +from mistralai.azure.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[ @@ -21,13 +23,32 @@ class ChatCompletionChoiceTypedDict(TypedDict): index: int - message: AssistantMessageTypedDict finish_reason: ChatCompletionChoiceFinishReason + message: NotRequired[AssistantMessageTypedDict] + messages: NotRequired[List[DeltaMessageTypedDict]] class ChatCompletionChoice(BaseModel): index: int - message: AssistantMessage - 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/packages/azure/src/mistralai/azure/client/models/chatcompletionrequest.py b/packages/azure/src/mistralai/azure/client/models/chatcompletionrequest.py index edd0fdc7..90dc0101 100644 --- a/packages/azure/src/mistralai/azure/client/models/chatcompletionrequest.py +++ b/packages/azure/src/mistralai/azure/client/models/chatcompletionrequest.py @@ -2,8 +2,14 @@ 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 @@ -11,6 +17,8 @@ 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.azure.client.types import ( BaseModel, Nullable, @@ -58,6 +66,31 @@ ] +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], @@ -78,26 +111,26 @@ class ChatCompletionRequestTypedDict(TypedDict): 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] + 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[ChatCompletionRequestStopTypedDict] + 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[ToolTypedDict]]] + 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[float] + 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[float] + 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.""" @@ -105,8 +138,10 @@ class ChatCompletionRequestTypedDict(TypedDict): 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]]] safe_prompt: NotRequired[bool] r"""Whether to inject a safety prompt before all conversations.""" @@ -121,7 +156,7 @@ class ChatCompletionRequest(BaseModel): 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 + 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 @@ -130,7 +165,7 @@ class ChatCompletionRequest(BaseModel): 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 + 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 @@ -141,16 +176,16 @@ class ChatCompletionRequest(BaseModel): 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 + 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: Optional[float] = 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: Optional[float] = None + 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 @@ -162,9 +197,13 @@ class ChatCompletionRequest(BaseModel): 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 + safe_prompt: Optional[bool] = None r"""Whether to inject a safety prompt before all conversations.""" @@ -188,19 +227,27 @@ def serialize_model(self, handler): "n", "prediction", "parallel_tool_calls", + "reasoning_effort", "prompt_mode", + "guardrails", "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", ] ) serialized = handler(self) @@ -208,7 +255,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/chatcompletionstreamrequest.py b/packages/azure/src/mistralai/azure/client/models/chatcompletionstreamrequest.py index 2edfbed9..757d6231 100644 --- a/packages/azure/src/mistralai/azure/client/models/chatcompletionstreamrequest.py +++ b/packages/azure/src/mistralai/azure/client/models/chatcompletionstreamrequest.py @@ -2,8 +2,14 @@ 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 @@ -11,6 +17,8 @@ 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.azure.client.types import ( BaseModel, Nullable, @@ -58,6 +66,31 @@ ] +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], @@ -78,25 +111,25 @@ class ChatCompletionStreamRequestTypedDict(TypedDict): 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] + 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[ChatCompletionStreamRequestStopTypedDict] + 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[ToolTypedDict]]] + 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[float] + 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[float] + 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.""" @@ -104,8 +137,10 @@ class ChatCompletionStreamRequestTypedDict(TypedDict): 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]]] safe_prompt: NotRequired[bool] r"""Whether to inject a safety prompt before all conversations.""" @@ -120,7 +155,7 @@ class ChatCompletionStreamRequest(BaseModel): 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 + 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 @@ -128,7 +163,7 @@ class ChatCompletionStreamRequest(BaseModel): stream: Optional[bool] = True - stop: Optional[ChatCompletionStreamRequestStop] = None + 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 @@ -139,16 +174,16 @@ class ChatCompletionStreamRequest(BaseModel): 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 + 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: Optional[float] = 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: Optional[float] = None + 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 @@ -160,9 +195,13 @@ class ChatCompletionStreamRequest(BaseModel): 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 + safe_prompt: Optional[bool] = None r"""Whether to inject a safety prompt before all conversations.""" @@ -186,19 +225,27 @@ def serialize_model(self, handler): "n", "prediction", "parallel_tool_calls", + "reasoning_effort", "prompt_mode", + "guardrails", "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", ] ) serialized = handler(self) @@ -206,7 +253,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/codeinterpretertool.py b/packages/azure/src/mistralai/azure/client/models/codeinterpretertool.py new file mode 100644 index 00000000..0f588be3 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/codeinterpretertool.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +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 +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/packages/azure/src/mistralai/azure/client/models/completionchunk.py b/packages/azure/src/mistralai/azure/client/models/completionchunk.py index 0e64bbc8..f6168f17 100644 --- a/packages/azure/src/mistralai/azure/client/models/completionchunk.py +++ b/packages/azure/src/mistralai/azure/client/models/completionchunk.py @@ -42,7 +42,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/azure/src/mistralai/azure/client/models/completionresponsestreamchoice.py b/packages/azure/src/mistralai/azure/client/models/completionresponsestreamchoice.py index 20a27140..36be8302 100644 --- a/packages/azure/src/mistralai/azure/client/models/completionresponsestreamchoice.py +++ b/packages/azure/src/mistralai/azure/client/models/completionresponsestreamchoice.py @@ -44,7 +44,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: m[k] = val diff --git a/packages/azure/src/mistralai/azure/client/models/customconnector.py b/packages/azure/src/mistralai/azure/client/models/customconnector.py new file mode 100644 index 00000000..e7eac82a --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/customconnector.py @@ -0,0 +1,80 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .apikeyauth import APIKeyAuth, APIKeyAuthTypedDict +from .oauth2tokenauth import OAuth2TokenAuth, OAuth2TokenAuthTypedDict +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +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 Field, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +AuthorizationTypedDict = TypeAliasType( + "AuthorizationTypedDict", Union[OAuth2TokenAuthTypedDict, APIKeyAuthTypedDict] +) + + +Authorization = Annotated[ + Union[APIKeyAuth, OAuth2TokenAuth], Field(discriminator="type") +] + + +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/packages/azure/src/mistralai/azure/client/models/deltamessage.py b/packages/azure/src/mistralai/azure/client/models/deltamessage.py index 567e772f..5bac18c2 100644 --- a/packages/azure/src/mistralai/azure/client/models/deltamessage.py +++ b/packages/azure/src/mistralai/azure/client/models/deltamessage.py @@ -11,7 +11,7 @@ UNSET_SENTINEL, ) from pydantic import model_serializer -from typing import List, Union +from typing import Any, Dict, List, Union from typing_extensions import NotRequired, TypeAliasType, TypedDict @@ -29,6 +29,10 @@ 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): @@ -38,16 +42,27 @@ class DeltaMessage(BaseModel): 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"]) - nullable_fields = set(["role", "content", "tool_calls"]) + 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) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/documentlibrarytool.py b/packages/azure/src/mistralai/azure/client/models/documentlibrarytool.py new file mode 100644 index 00000000..6e2e31e7 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/documentlibrarytool.py @@ -0,0 +1,70 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +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 +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/packages/azure/src/mistralai/azure/client/models/documenturlchunk.py b/packages/azure/src/mistralai/azure/client/models/documenturlchunk.py index 2dea8005..03af5816 100644 --- a/packages/azure/src/mistralai/azure/client/models/documenturlchunk.py +++ b/packages/azure/src/mistralai/azure/client/models/documenturlchunk.py @@ -46,7 +46,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/filechunk.py b/packages/azure/src/mistralai/azure/client/models/filechunk.py index 6baa0cba..772f67e6 100644 --- a/packages/azure/src/mistralai/azure/client/models/filechunk.py +++ b/packages/azure/src/mistralai/azure/client/models/filechunk.py @@ -31,7 +31,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/azure/src/mistralai/azure/client/models/function.py b/packages/azure/src/mistralai/azure/client/models/function.py index 055d3657..3f135ed2 100644 --- a/packages/azure/src/mistralai/azure/client/models/function.py +++ b/packages/azure/src/mistralai/azure/client/models/function.py @@ -31,7 +31,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/azure/src/mistralai/azure/client/models/guardrailconfig.py b/packages/azure/src/mistralai/azure/client/models/guardrailconfig.py new file mode 100644 index 00000000..4feffa67 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/guardrailconfig.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .moderationllmv1config import ModerationLlmv1Config, ModerationLlmv1ConfigTypedDict +from .moderationllmv2config import ModerationLlmv2Config, ModerationLlmv2ConfigTypedDict +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 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/packages/azure/src/mistralai/azure/client/models/imagegenerationtool.py b/packages/azure/src/mistralai/azure/client/models/imagegenerationtool.py new file mode 100644 index 00000000..5c51d688 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/imagegenerationtool.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +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 +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/packages/azure/src/mistralai/azure/client/models/imageurl.py b/packages/azure/src/mistralai/azure/client/models/imageurl.py index bcb4fe43..c1704cd8 100644 --- a/packages/azure/src/mistralai/azure/client/models/imageurl.py +++ b/packages/azure/src/mistralai/azure/client/models/imageurl.py @@ -32,7 +32,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/imageurlchunk.py b/packages/azure/src/mistralai/azure/client/models/imageurlchunk.py index 7213c498..8e8df9a6 100644 --- a/packages/azure/src/mistralai/azure/client/models/imageurlchunk.py +++ b/packages/azure/src/mistralai/azure/client/models/imageurlchunk.py @@ -20,14 +20,14 @@ class ImageURLChunkTypedDict(TypedDict): - r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" + 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\":{\"url\":\"data:image/png;base64,iVBORw0""" + r"""{\"type\":\"image_url\",\"image_url\":\"data:image/png;base64,iVBORw0\"}""" image_url: ImageURLUnion @@ -46,7 +46,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/azure/src/mistralai/azure/client/models/jsonschema.py b/packages/azure/src/mistralai/azure/client/models/jsonschema.py index 99f2fb89..2790728b 100644 --- a/packages/azure/src/mistralai/azure/client/models/jsonschema.py +++ b/packages/azure/src/mistralai/azure/client/models/jsonschema.py @@ -39,7 +39,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/moderationllmaction.py b/packages/azure/src/mistralai/azure/client/models/moderationllmaction.py new file mode 100644 index 00000000..cff03d9a --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/moderationllmaction.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing import Literal + + +ModerationLLMAction = Literal[ + "none", + "block", +] diff --git a/packages/azure/src/mistralai/azure/client/models/moderationllmv1categorythresholds.py b/packages/azure/src/mistralai/azure/client/models/moderationllmv1categorythresholds.py new file mode 100644 index 00000000..e3e9b22f --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/moderationllmv1categorythresholds.py @@ -0,0 +1,93 @@ +"""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 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/packages/azure/src/mistralai/azure/client/models/moderationllmv1config.py b/packages/azure/src/mistralai/azure/client/models/moderationllmv1config.py new file mode 100644 index 00000000..82268870 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/moderationllmv1config.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .moderationllmaction import ModerationLLMAction +from .moderationllmv1categorythresholds import ( + ModerationLlmv1CategoryThresholds, + ModerationLlmv1CategoryThresholdsTypedDict, +) +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 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/packages/azure/src/mistralai/azure/client/models/moderationllmv2categorythresholds.py b/packages/azure/src/mistralai/azure/client/models/moderationllmv2categorythresholds.py new file mode 100644 index 00000000..57af08d8 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/moderationllmv2categorythresholds.py @@ -0,0 +1,103 @@ +"""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 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/packages/azure/src/mistralai/azure/client/models/moderationllmv2config.py b/packages/azure/src/mistralai/azure/client/models/moderationllmv2config.py new file mode 100644 index 00000000..57075e60 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/moderationllmv2config.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .moderationllmaction import ModerationLLMAction +from .moderationllmv2categorythresholds import ( + ModerationLlmv2CategoryThresholds, + ModerationLlmv2CategoryThresholdsTypedDict, +) +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 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/packages/azure/src/mistralai/azure/client/models/oauth2tokenauth.py b/packages/azure/src/mistralai/azure/client/models/oauth2tokenauth.py new file mode 100644 index 00000000..3da345fc --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/oauth2tokenauth.py @@ -0,0 +1,31 @@ +"""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 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/packages/azure/src/mistralai/azure/client/models/ocrconfidencescore.py b/packages/azure/src/mistralai/azure/client/models/ocrconfidencescore.py new file mode 100644 index 00000000..7ac59069 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/ocrconfidencescore.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 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/packages/azure/src/mistralai/azure/client/models/ocrimageobject.py b/packages/azure/src/mistralai/azure/client/models/ocrimageobject.py index a23515b3..91d7ac0e 100644 --- a/packages/azure/src/mistralai/azure/client/models/ocrimageobject.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrimageobject.py @@ -69,7 +69,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/ocrpageconfidencescores.py b/packages/azure/src/mistralai/azure/client/models/ocrpageconfidencescores.py new file mode 100644 index 00000000..2d5d7a1a --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/ocrpageconfidencescores.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .ocrconfidencescore import OCRConfidenceScore, OCRConfidenceScoreTypedDict +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 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/packages/azure/src/mistralai/azure/client/models/ocrpageobject.py b/packages/azure/src/mistralai/azure/client/models/ocrpageobject.py index 434c8988..08b5dbcb 100644 --- a/packages/azure/src/mistralai/azure/client/models/ocrpageobject.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrpageobject.py @@ -2,6 +2,10 @@ 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.azure.client.types import ( @@ -33,6 +37,8 @@ class OCRPageObjectTypedDict(TypedDict): 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): @@ -60,16 +66,21 @@ class OCRPageObject(BaseModel): 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"]) - nullable_fields = set(["header", "footer", "dimensions"]) + 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) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/ocrrequest.py b/packages/azure/src/mistralai/azure/client/models/ocrrequest.py index a2cd3415..731c0cf8 100644 --- a/packages/azure/src/mistralai/azure/client/models/ocrrequest.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrrequest.py @@ -28,19 +28,32 @@ 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: 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""" + 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]] @@ -56,6 +69,8 @@ class OCRRequestTypedDict(TypedDict): 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): @@ -64,10 +79,8 @@ class OCRRequest(BaseModel): 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""" + 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""" @@ -93,11 +106,13 @@ class OCRRequest(BaseModel): 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( [ - "id", "pages", "include_image_base64", "image_limit", @@ -108,6 +123,7 @@ def serialize_model(self, handler): "table_format", "extract_header", "extract_footer", + "confidence_scores_granularity", ] ) nullable_fields = set( @@ -121,6 +137,7 @@ def serialize_model(self, handler): "document_annotation_format", "document_annotation_prompt", "table_format", + "confidence_scores_granularity", ] ) serialized = handler(self) @@ -128,7 +145,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/ocrresponse.py b/packages/azure/src/mistralai/azure/client/models/ocrresponse.py index 3dc09fd7..6e27f574 100644 --- a/packages/azure/src/mistralai/azure/client/models/ocrresponse.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrresponse.py @@ -46,7 +46,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/ocrtableobject.py b/packages/azure/src/mistralai/azure/client/models/ocrtableobject.py index f1de5428..07bc7c13 100644 --- a/packages/azure/src/mistralai/azure/client/models/ocrtableobject.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrtableobject.py @@ -1,10 +1,19 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from mistralai.azure.client.types import BaseModel, UnrecognizedStr +from .ocrconfidencescore import OCRConfidenceScore, OCRConfidenceScoreTypedDict +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) import pydantic -from typing import Literal, Union -from typing_extensions import Annotated, TypedDict +from pydantic import model_serializer +from typing import List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypedDict Format = Union[ @@ -24,6 +33,8 @@ class OCRTableObjectTypedDict(TypedDict): 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): @@ -36,6 +47,34 @@ class OCRTableObject(BaseModel): 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() diff --git a/packages/azure/src/mistralai/azure/client/models/ocrusageinfo.py b/packages/azure/src/mistralai/azure/client/models/ocrusageinfo.py index f63315d2..b5c5f5c1 100644 --- a/packages/azure/src/mistralai/azure/client/models/ocrusageinfo.py +++ b/packages/azure/src/mistralai/azure/client/models/ocrusageinfo.py @@ -35,7 +35,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/prediction.py b/packages/azure/src/mistralai/azure/client/models/prediction.py index 1fa1d782..3d94feb5 100644 --- a/packages/azure/src/mistralai/azure/client/models/prediction.py +++ b/packages/azure/src/mistralai/azure/client/models/prediction.py @@ -37,7 +37,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/azure/src/mistralai/azure/client/models/reasoningeffort.py b/packages/azure/src/mistralai/azure/client/models/reasoningeffort.py new file mode 100644 index 00000000..43ffa02b --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/reasoningeffort.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing import Literal + + +ReasoningEffort = Literal[ + "none", + "high", +] diff --git a/packages/azure/src/mistralai/azure/client/models/referencechunk.py b/packages/azure/src/mistralai/azure/client/models/referencechunk.py index f7af9bf9..debab3ce 100644 --- a/packages/azure/src/mistralai/azure/client/models/referencechunk.py +++ b/packages/azure/src/mistralai/azure/client/models/referencechunk.py @@ -6,17 +6,23 @@ 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 +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[int] + reference_ids: List[ReferenceIDTypedDict] type: Literal["reference"] class ReferenceChunk(BaseModel): - reference_ids: List[int] + reference_ids: List[ReferenceID] type: Annotated[ Annotated[ @@ -33,7 +39,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/azure/src/mistralai/azure/client/models/responseformat.py b/packages/azure/src/mistralai/azure/client/models/responseformat.py index 20fd2b86..50f0b075 100644 --- a/packages/azure/src/mistralai/azure/client/models/responseformat.py +++ b/packages/azure/src/mistralai/azure/client/models/responseformat.py @@ -38,7 +38,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/thinkchunk.py b/packages/azure/src/mistralai/azure/client/models/thinkchunk.py index ec8e7f95..8e52ccc9 100644 --- a/packages/azure/src/mistralai/azure/client/models/thinkchunk.py +++ b/packages/azure/src/mistralai/azure/client/models/thinkchunk.py @@ -4,7 +4,13 @@ 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.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) from mistralai.azure.client.utils import validate_const import pydantic from pydantic import model_serializer @@ -27,6 +33,8 @@ 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.""" @@ -39,21 +47,33 @@ class ThinkChunk(BaseModel): 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(["closed"]) + optional_fields = set(["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) + 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: + 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/tool.py b/packages/azure/src/mistralai/azure/client/models/tool.py index 87329bdb..ecfb5f34 100644 --- a/packages/azure/src/mistralai/azure/client/models/tool.py +++ b/packages/azure/src/mistralai/azure/client/models/tool.py @@ -2,35 +2,32 @@ 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 +from mistralai.azure.client.types import BaseModel, UnrecognizedStr +from mistralai.azure.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: NotRequired[ToolTypes] + type: Union[Literal["function"], UnrecognizedStr] class Tool(BaseModel): function: Function - type: Optional[ToolTypes] = None + type: Annotated[ + Annotated[ + Union[Literal["function"], UnrecognizedStr], + AfterValidator(validate_const("function")), + ], + pydantic.Field(alias="type"), + ] = "function" - @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: + Tool.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/toolcall.py b/packages/azure/src/mistralai/azure/client/models/toolcall.py index ada1ea65..87ccd030 100644 --- a/packages/azure/src/mistralai/azure/client/models/toolcall.py +++ b/packages/azure/src/mistralai/azure/client/models/toolcall.py @@ -2,7 +2,6 @@ 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 @@ -12,7 +11,7 @@ class ToolCallTypedDict(TypedDict): function: FunctionCallTypedDict id: NotRequired[str] - type: NotRequired[ToolTypes] + type: NotRequired[str] index: NotRequired[int] @@ -21,7 +20,7 @@ class ToolCall(BaseModel): id: Optional[str] = "null" - type: Optional[ToolTypes] = None + type: Optional[str] = None index: Optional[int] = 0 @@ -33,7 +32,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/azure/src/mistralai/azure/client/models/toolchoice.py b/packages/azure/src/mistralai/azure/client/models/toolchoice.py index ddb9e141..15d1da1c 100644 --- a/packages/azure/src/mistralai/azure/client/models/toolchoice.py +++ b/packages/azure/src/mistralai/azure/client/models/toolchoice.py @@ -2,7 +2,6 @@ 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 @@ -14,7 +13,7 @@ class ToolChoiceTypedDict(TypedDict): function: FunctionNameTypedDict r"""this restriction of `Function` is used to select a specific function to call""" - type: NotRequired[ToolTypes] + type: NotRequired[str] class ToolChoice(BaseModel): @@ -23,7 +22,7 @@ class ToolChoice(BaseModel): function: FunctionName r"""this restriction of `Function` is used to select a specific function to call""" - type: Optional[ToolTypes] = None + type: Optional[str] = None @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -33,7 +32,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/azure/src/mistralai/azure/client/models/toolconfiguration.py b/packages/azure/src/mistralai/azure/client/models/toolconfiguration.py new file mode 100644 index 00000000..6977679f --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/toolconfiguration.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 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/packages/azure/src/mistralai/azure/client/models/toolmessage.py b/packages/azure/src/mistralai/azure/client/models/toolmessage.py index 670210de..e246d5a2 100644 --- a/packages/azure/src/mistralai/azure/client/models/toolmessage.py +++ b/packages/azure/src/mistralai/azure/client/models/toolmessage.py @@ -53,7 +53,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/toolreferencechunk.py b/packages/azure/src/mistralai/azure/client/models/toolreferencechunk.py index c9db878f..0845fde3 100644 --- a/packages/azure/src/mistralai/azure/client/models/toolreferencechunk.py +++ b/packages/azure/src/mistralai/azure/client/models/toolreferencechunk.py @@ -17,14 +17,18 @@ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -ToolUnionTypedDict = TypeAliasType("ToolUnionTypedDict", Union[BuiltInConnectors, str]) +ToolReferenceChunkToolTypedDict = TypeAliasType( + "ToolReferenceChunkToolTypedDict", Union[BuiltInConnectors, str] +) -ToolUnion = TypeAliasType("ToolUnion", Union[BuiltInConnectors, str]) +ToolReferenceChunkTool = TypeAliasType( + "ToolReferenceChunkTool", Union[BuiltInConnectors, str] +) class ToolReferenceChunkTypedDict(TypedDict): - tool: ToolUnionTypedDict + tool: ToolReferenceChunkToolTypedDict title: str type: Literal["tool_reference"] url: NotRequired[Nullable[str]] @@ -33,7 +37,7 @@ class ToolReferenceChunkTypedDict(TypedDict): class ToolReferenceChunk(BaseModel): - tool: ToolUnion + tool: ToolReferenceChunkTool title: str @@ -60,7 +64,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/tooltypes.py b/packages/azure/src/mistralai/azure/client/models/tooltypes.py deleted file mode 100644 index 1cce7446..00000000 --- a/packages/azure/src/mistralai/azure/client/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.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 index 0f04c87c..9200682a 100644 --- a/packages/azure/src/mistralai/azure/client/models/usageinfo.py +++ b/packages/azure/src/mistralai/azure/client/models/usageinfo.py @@ -59,8 +59,8 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) + 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 diff --git a/packages/azure/src/mistralai/azure/client/models/usermessage.py b/packages/azure/src/mistralai/azure/client/models/usermessage.py index 549b01ca..7dbca134 100644 --- a/packages/azure/src/mistralai/azure/client/models/usermessage.py +++ b/packages/azure/src/mistralai/azure/client/models/usermessage.py @@ -39,7 +39,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: m[k] = val diff --git a/packages/azure/src/mistralai/azure/client/models/validationerror.py b/packages/azure/src/mistralai/azure/client/models/validationerror.py index f0169e18..aaa72f21 100644 --- a/packages/azure/src/mistralai/azure/client/models/validationerror.py +++ b/packages/azure/src/mistralai/azure/client/models/validationerror.py @@ -48,7 +48,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/azure/src/mistralai/azure/client/models/websearchpremiumtool.py b/packages/azure/src/mistralai/azure/client/models/websearchpremiumtool.py new file mode 100644 index 00000000..252d8803 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/websearchpremiumtool.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +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 +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/packages/azure/src/mistralai/azure/client/models/websearchtool.py b/packages/azure/src/mistralai/azure/client/models/websearchtool.py new file mode 100644 index 00000000..363e0331 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/websearchtool.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +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 +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/packages/azure/src/mistralai/azure/client/ocr.py b/packages/azure/src/mistralai/azure/client/ocr.py index b9270f6a..c4f706a9 100644 --- a/packages/azure/src/mistralai/azure/client/ocr.py +++ b/packages/azure/src/mistralai/azure/client/ocr.py @@ -5,7 +5,7 @@ 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 +from typing import Any, Mapping, Optional, Union class Ocr(BaseSDK): @@ -14,8 +14,7 @@ def process( *, model: Nullable[str], document: Union[models.Document, models.DocumentTypedDict], - id: Optional[str] = None, - pages: OptionalNullable[List[int]] = UNSET, + 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, @@ -29,6 +28,9 @@ def process( 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, @@ -38,8 +40,7 @@ def process( :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 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 @@ -49,6 +50,7 @@ def process( :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 @@ -59,6 +61,9 @@ def process( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -66,7 +71,6 @@ def process( request = models.OCRRequest( model=model, - id=id, document=utils.get_pydantic_model(document, models.Document), pages=pages, include_image_base64=include_image_base64, @@ -82,11 +86,12 @@ def process( 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="/ocr", + path="/providers/mistral/azure/ocr", base_url=base_url, url_variables=url_variables, request=request, @@ -121,7 +126,7 @@ def process( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -147,8 +152,7 @@ async def process_async( *, model: Nullable[str], document: Union[models.Document, models.DocumentTypedDict], - id: Optional[str] = None, - pages: OptionalNullable[List[int]] = UNSET, + 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, @@ -162,6 +166,9 @@ async def process_async( 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, @@ -171,8 +178,7 @@ async def process_async( :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 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 @@ -182,6 +188,7 @@ async def process_async( :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 @@ -192,6 +199,9 @@ async def process_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: @@ -199,7 +209,6 @@ async def process_async( request = models.OCRRequest( model=model, - id=id, document=utils.get_pydantic_model(document, models.Document), pages=pages, include_image_base64=include_image_base64, @@ -215,11 +224,12 @@ async def process_async( 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="/ocr", + path="/providers/mistral/azure/ocr", base_url=base_url, url_variables=url_variables, request=request, @@ -254,7 +264,7 @@ async def process_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/packages/azure/src/mistralai/azure/client/utils/eventstreaming.py b/packages/azure/src/mistralai/azure/client/utils/eventstreaming.py index f2052fc2..3bdcd6d3 100644 --- a/packages/azure/src/mistralai/azure/client/utils/eventstreaming.py +++ b/packages/azure/src/mistralai/azure/client/utils/eventstreaming.py @@ -32,9 +32,12 @@ def __init__( 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) + self.generator = stream_events( + response, decoder, sentinel, data_required=data_required + ) self.client_ref = client_ref self._closed = False @@ -68,9 +71,12 @@ def __init__( 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) + self.generator = stream_events_async( + response, decoder, sentinel, data_required=data_required + ) self.client_ref = client_ref self._closed = False @@ -116,6 +122,7 @@ 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 @@ -138,7 +145,11 @@ async def stream_events_async( block = buffer[position:i] position = i + len(seq) event, discard, event_id = _parse_event( - raw=block, decoder=decoder, sentinel=sentinel, event_id=event_id + raw=block, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, ) if event is not None: yield event @@ -151,7 +162,11 @@ async def stream_events_async( position = 0 event, discard, _ = _parse_event( - raw=buffer, decoder=decoder, sentinel=sentinel, event_id=event_id + raw=buffer, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, ) if event is not None: yield event @@ -161,6 +176,7 @@ 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 @@ -183,7 +199,11 @@ def stream_events( block = buffer[position:i] position = i + len(seq) event, discard, event_id = _parse_event( - raw=block, decoder=decoder, sentinel=sentinel, event_id=event_id + raw=block, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, ) if event is not None: yield event @@ -196,7 +216,11 @@ def stream_events( position = 0 event, discard, _ = _parse_event( - raw=buffer, decoder=decoder, sentinel=sentinel, event_id=event_id + raw=buffer, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, ) if event is not None: yield event @@ -208,6 +232,7 @@ def _parse_event( 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) @@ -250,6 +275,10 @@ def _parse_event( 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: diff --git a/packages/azure/src/mistralai/azure/client/utils/metadata.py b/packages/azure/src/mistralai/azure/client/utils/metadata.py index 173b3e5c..5abddd58 100644 --- a/packages/azure/src/mistralai/azure/client/utils/metadata.py +++ b/packages/azure/src/mistralai/azure/client/utils/metadata.py @@ -15,6 +15,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/packages/azure/src/mistralai/azure/client/utils/security.py b/packages/azure/src/mistralai/azure/client/utils/security.py index 17996bd5..42d8d78e 100644 --- a/packages/azure/src/mistralai/azure/client/utils/security.py +++ b/packages/azure/src/mistralai/azure/client/utils/security.py @@ -5,6 +5,7 @@ Any, Dict, List, + Optional, Tuple, ) from pydantic import BaseModel @@ -16,7 +17,9 @@ ) -def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: +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]] = {} @@ -27,7 +30,14 @@ def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: raise TypeError("security must be a pydantic model") sec_fields: Dict[str, FieldInfo] = security.__class__.model_fields - for name in sec_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) @@ -49,6 +59,9 @@ def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: else: _parse_security_scheme(headers, query_params, metadata, name, value) + if not metadata.composite: + return headers, query_params + return headers, query_params @@ -59,15 +72,24 @@ def _parse_security_option( 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) - ) + + 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( diff --git a/packages/azure/src/mistralai/azure/client/utils/serializers.py b/packages/azure/src/mistralai/azure/client/utils/serializers.py index 14321eb4..d2149f8b 100644 --- a/packages/azure/src/mistralai/azure/client/utils/serializers.py +++ b/packages/azure/src/mistralai/azure/client/utils/serializers.py @@ -17,8 +17,7 @@ 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: + if d is None: return None if isinstance(d, Unset): return d @@ -46,8 +45,7 @@ def validate_decimal(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: + if f is None: return None if isinstance(f, Unset): return f @@ -75,8 +73,7 @@ def validate_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: + if i is None: return None if isinstance(i, Unset): return i @@ -104,8 +101,7 @@ def validate_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: + if c is None: return None if v != c: diff --git a/packages/azure/uv.lock b/packages/azure/uv.lock index ac8a5de9..4fd77081 100644 --- a/packages/azure/uv.lock +++ b/packages/azure/uv.lock @@ -7,6 +7,10 @@ resolution-markers = [ "python_full_version < '3.11'", ] +[options] +exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for backwards compatibility when using relative exclude-newer values. +exclude-newer-span = "P7D" + [[package]] name = "annotated-types" version = "0.7.0" @@ -154,7 +158,7 @@ wheels = [ [[package]] name = "mistralai-azure" -version = "2.0.0" +version = "2.1.0" source = { editable = "." } dependencies = [ { name = "httpcore" }, diff --git a/packages/gcp/.gitignore b/packages/gcp/.gitignore index b386de74..a9654890 100644 --- a/packages/gcp/.gitignore +++ b/packages/gcp/.gitignore @@ -4,7 +4,6 @@ **/.speakeasy/temp/ **/.speakeasy/logs/ .speakeasy/reports -README-PYPI.md .venv/ venv/ src/*.egg-info/ diff --git a/packages/gcp/.speakeasy/gen.lock b/packages/gcp/.speakeasy/gen.lock index 08289d3a..eb166f15 100644 --- a/packages/gcp/.speakeasy/gen.lock +++ b/packages/gcp/.speakeasy/gen.lock @@ -1,48 +1,49 @@ lockVersion: 2.0.0 id: ec60f2d8-7869-45c1-918e-773d41a8cf74 management: - docChecksum: 6f32cd54fc5f3d2a609ff3933cbf34b8 + docChecksum: 77634408b308396940276ab2a5724949 docVersion: 1.0.0 - speakeasyVersion: 1.729.0 - generationVersion: 2.841.0 - releaseVersion: 2.0.0 - configChecksum: d208fbfc438189901f0d6546484d5f26 + speakeasyVersion: 1.763.6 + generationVersion: 2.884.13 + releaseVersion: 2.1.0 + configChecksum: f42a555f90ecca4a17e379c855efcb4b 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 + generation_id: d5b7efd4-ee87-4b61-ac4b-42d3fa6730b5 + pristine_commit_hash: 67ca27bd960456dc9531c66d0fb44f21c723b80e + pristine_tree_hash: dc9cd254e0158ad038f5096a54e2c0a6131da35b features: python: additionalDependencies: 1.0.0 additionalProperties: 1.0.1 configurableModuleName: 0.2.0 constsAndDefaults: 1.0.7 - core: 6.0.12 + core: 6.0.22 defaultEnabledRetries: 0.2.0 - enumUnions: 0.1.0 - envVarSecurityUsage: 0.3.2 - examples: 3.0.2 + enumUnions: 0.1.1 + envVarSecurityUsage: 0.3.3 + examples: 3.0.4 flatRequests: 1.0.1 - globalSecurity: 3.0.5 + globalSecurity: 3.0.7 globalSecurityCallbacks: 1.0.0 globalSecurityFlattening: 1.0.0 - globalServerURLs: 3.2.0 + globalServerURLs: 3.2.1 includes: 3.0.0 methodArguments: 1.0.2 nameOverrides: 3.0.3 nullables: 1.0.2 openEnums: 1.0.4 + operationTimeout: 0.3.1 responseFormat: 1.1.0 - retries: 3.0.4 + retries: 3.0.5 sdkHooks: 1.2.1 - serverEvents: 1.0.13 + serverEvents: 1.0.15 serverEventsSentinels: 0.1.0 serverIDs: 3.0.0 - unions: 3.1.4 + unions: 3.1.5 trackedFiles: .gitattributes: id: 24139dae6567 @@ -56,6 +57,10 @@ trackedFiles: id: 7fe2e5327e07 last_write_checksum: sha1:277a46811144643262651853dc6176d21b33573e pristine_git_object: 712a148c3e2305dca4c702851865f9f8c8e674cc + docs/models/apikeyauth.md: + id: 529789e1b079 + last_write_checksum: sha1:edb801076d411a5d6c1f7a3f4fdb4c3612b12ab1 + pristine_git_object: 1fbff10e21eb51df061790f0215cb4916318ebc1 docs/models/arguments.md: id: 7ea5e33709a7 last_write_checksum: sha1:09eea126210d7fd0353e60a76bf1dbed173f13ec @@ -68,22 +73,26 @@ trackedFiles: id: 9f1795bbe642 last_write_checksum: sha1:1ce4066623a8d62d969e5ed3a088d73a9ba26643 pristine_git_object: 047b7cf95f4db203bf2c501680b73ca0562a122d + docs/models/authorization.md: + id: dec4d9809e25 + last_write_checksum: sha1:6bf766a7b49ca2b706bb4eb88ba2d56406e06e1e + pristine_git_object: 11ea5c6a700e7b92f5cbd29e88e41b834f8b8ef4 docs/models/builtinconnectors.md: id: 9d14e972f08a - last_write_checksum: sha1:1f32eb515e32c58685d0bdc15de09656194c508c - pristine_git_object: f96f50444aaa23ca291db2fd0dc69db0d9d149d9 + last_write_checksum: sha1:83b573a69c86ab00e8660c7b6c02c14fdb8e1459 + pristine_git_object: ad9b9823d7e76bb827524701e9995a40dfa83147 docs/models/chatcompletionchoice.md: id: 0d15c59ab501 - last_write_checksum: sha1:a6274a39a4239e054816d08517bf8507cb5c4564 - pristine_git_object: deaa0ea073e1b6c21bd466c10db31db2464066f1 + last_write_checksum: sha1:f3c9fa3cc092674a36bf28552b6900d62871b789 + pristine_git_object: 79d24a335c7ca1acb1469213d60ced2ec4987461 docs/models/chatcompletionchoicefinishreason.md: id: 225764da91d3 - last_write_checksum: sha1:b894d3408cb801e072c3c302a5676ff939d59284 - pristine_git_object: b2f15ecbe88328de95b4961ddb3940fd8a6ee64b + last_write_checksum: sha1:9a0715ecc16437ce4411743e852d8438a313cd41 + pristine_git_object: 53290d8eab975e171c02064fc34097f598633e17 docs/models/chatcompletionrequest.md: id: adffe90369d0 - last_write_checksum: sha1:6374e05aeb66d48137d657acaa89527df2db35c6 - pristine_git_object: 8dbd4a82ad1d7725b9a6ce56daea208ca01b9210 + last_write_checksum: sha1:195c1c434fefe7a6d684622bdd55acc716bef7b5 + pristine_git_object: db61b5c0deafb18c5133e07b9ba69d2b1e8adfe1 docs/models/chatcompletionrequestmessage.md: id: 3f5e170d418c last_write_checksum: sha1:7921c5a508a9f88adc01caab34e26182b8035607 @@ -92,6 +101,10 @@ trackedFiles: 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 @@ -102,8 +115,8 @@ trackedFiles: pristine_git_object: a0465ffbfc5558628953e03fbc53b80bbdc8649b docs/models/chatcompletionstreamrequest.md: id: cf8f29558a68 - last_write_checksum: sha1:e23cf88a5a9b0c99e68d06a8450b8bfb9aee33a2 - pristine_git_object: db76b6c81a71607f94c212a542fe30e082053a90 + last_write_checksum: sha1:3901c8c3e8b2cba3d2510f61e18f47edfda86f7e + pristine_git_object: bd19d37b64d30b110596e438c425c36372faf6e9 docs/models/chatcompletionstreamrequestmessage.md: id: 053a98476cd2 last_write_checksum: sha1:8270692463fab1243d9de4bbef7162daa64e52c5 @@ -112,10 +125,18 @@ trackedFiles: 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/codeinterpretertool.md: + id: f009740c6e54 + last_write_checksum: sha1:a2114d61a98a48b4365a77c0c75c06ca834367ad + pristine_git_object: 6302fc627d7c49442b6c9aec19c70fdceaf7c519 docs/models/completionchunk.md: id: 60cb30423c60 last_write_checksum: sha1:61b976fe2e71236cf7941ee1635decc31bd304b2 @@ -130,8 +151,8 @@ trackedFiles: pristine_git_object: 1532c25b8fc065d486f52d4610a7f757e5340875 docs/models/completionresponsestreamchoicefinishreason.md: id: 5f1fbfc90b8e - last_write_checksum: sha1:20824b4a223cbd3658b32440973a7d47dcd108b9 - pristine_git_object: 0fece473297227c75db4e7ded63417a2f117cac0 + last_write_checksum: sha1:0d6278fdfec974d1e8782c5bfca0fad5300a2125 + pristine_git_object: 7b37dc06c1d30d19ae969fde2170d0cc3ad052ef docs/models/contentchunk.md: id: d2d3a32080cd last_write_checksum: sha1:5839a26cdc412b78caad7fb59df97bdcea57be6d @@ -140,18 +161,26 @@ trackedFiles: id: e8f2f9e54b8e last_write_checksum: sha1:4c14b386f9f89d98f4dd9487ab030f10478c0e63 pristine_git_object: 107f1bd428b1f39b36f75e5a10532bc462967ce5 + docs/models/customconnector.md: + id: 7bcc77607afa + last_write_checksum: sha1:ce9e8ffac3f83e08269fbed5d2dffbfeb9f8649a + pristine_git_object: 0a0b69217abb0fbcbe30fad32c239aea070d3740 docs/models/deltamessage.md: id: 6c5ed6b60968 - last_write_checksum: sha1:00052476b9b2474dbc149f18dd18c71c86d0fc74 - pristine_git_object: e0ee575f3fce7c312114ce8c5390efc5c4854952 + 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/documentlibrarytool.md: + id: 68083b0ef8f3 + last_write_checksum: sha1:76b9f47c399915a338abe929cb10c1b37282eadf + pristine_git_object: 95c3fa52ee3ff29e72bc0240a98c0afaa0cd5f62 docs/models/fimcompletionrequest.md: id: b44677ecc293 - last_write_checksum: sha1:24bcb54d39b3fabd487549a27b4c0a65dd5ffe50 - pristine_git_object: fde0b625c29340e8dce1eb3026ce644b1885e53a + last_write_checksum: sha1:87a83a59fb3772ca6c7e60bcef27ca15f349ce46 + pristine_git_object: c0c52b6634c0a12b7e52686875805164d99b4c64 docs/models/fimcompletionrequeststop.md: id: ea5475297a83 last_write_checksum: sha1:a6cdb4bda01ac58016a71f35da48a5d10df11623 @@ -162,8 +191,8 @@ trackedFiles: pristine_git_object: cd62d0349503fd8b13582d0ba47ab9cff40f6b28 docs/models/fimcompletionstreamrequest.md: id: c881d7e27637 - last_write_checksum: sha1:f8755bc554dd44568c42eb5b6dde04db464647ab - pristine_git_object: ba62d854f030390418597cbd8febae0e1ce27ea8 + last_write_checksum: sha1:3574398ad561e06a8c2c95ffcb1456fe62cf7320 + pristine_git_object: c02b622c7e4113d7ca99ede3d735f17dc2ab26e7 docs/models/fimcompletionstreamrequeststop.md: id: c97a11b764e9 last_write_checksum: sha1:958d5087050fdeb128745884ebcf565b4fdc3886 @@ -180,18 +209,26 @@ trackedFiles: id: 4b3bd62c0f26 last_write_checksum: sha1:754fe32bdffe53c1057b302702f5516f4e551cfb pristine_git_object: 87d7b4852de629015166605b273deb9341202dc0 + docs/models/guardrailconfig.md: + id: f60bf2eefb45 + last_write_checksum: sha1:e8dd384d2fd18d731753ba8d45a2975379c97052 + pristine_git_object: 1276462cc43fbd940f12282b1dca05e6fc7a16f9 docs/models/imagedetail.md: id: f8217529b496 - last_write_checksum: sha1:fdf19ac9459f64616240955cb81a84ef03e775c8 - pristine_git_object: 1e5ba3fd405a14e5e2872cc85504584dca19b726 + last_write_checksum: sha1:165fedf9506a2cef070fd6d910beef431dd2f32d + pristine_git_object: 15cc63e77da0ae4fa6926b8045f58678dff91265 + 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:30b72826963e22cadf76ac0b7604288dbc4fb943 - pristine_git_object: a84dac32b99390e3fd0559714ca43795742192c6 + last_write_checksum: sha1:705bdd81424cc35eeba9f280dda5124d8091d1af + pristine_git_object: 73e1ed5a07333e86310575a80a7baa61dadd61bf docs/models/imageurlunion.md: id: 9d3c691a9db0 last_write_checksum: sha1:4e32bcd7d44746d2ddbfafbef96152bb2bdb2a15 @@ -206,24 +243,56 @@ trackedFiles: pristine_git_object: d6094ac2c6e0326c039dad2f6b89158694ef6aa7 docs/models/mistralpromptmode.md: id: d17d5db4d3b6 - last_write_checksum: sha1:abcb7205c5086169c7d9449d15ac142448a7d258 - pristine_git_object: c3409d03b9646e21a3793372d06dcae6fef95463 + last_write_checksum: sha1:d6b2f03f1d6999a77991735ef1f86ff6cf3f7bd0 + pristine_git_object: 921f81a4379b6a20fab6e97a942023f27ff2eff1 + docs/models/moderationllmaction.md: + id: 26373b4ad9cd + last_write_checksum: sha1:8687fc217e476dab04380a72720a546d1ba94c67 + pristine_git_object: e0077a32956f08393fc440364384f580317625cc + 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/oauth2tokenauth.md: + id: f23959dcc4b0 + last_write_checksum: sha1:ca434f8479c3f5e868db1269e86efa5e0d9070e2 + pristine_git_object: 89f80436474e3c2293bb4fcafce11e626e2cdf79 docs/models/prediction.md: id: 3c70b2262201 last_write_checksum: sha1:ca8a77219e6113f2358a5363e935288d90df0725 pristine_git_object: fae3c1ca4ba2c2ddb3b7de401ecdc8d56dcc7740 + docs/models/reasoningeffort.md: + id: c8fd630d3f07 + last_write_checksum: sha1:b0933ea955ebeacb7fcbdf59be935216d2ab999b + pristine_git_object: 87e0ae7696172b508326028224b10de557057ad7 docs/models/referencechunk.md: id: 07895f9debfd - last_write_checksum: sha1:4384049375a2566c7567599f97ce1ec19e9f6276 - pristine_git_object: d847e24845a399c7ca93d54701832fb65e01b3ab + 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/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 + last_write_checksum: sha1:947c2b47f8a73e5c299585c1109bad626675112e + pristine_git_object: 5d9aeb3e9193e621df527095aedd26fbf5ec5096 docs/models/security.md: id: 452e4d4eb67a last_write_checksum: sha1:ce2871b49c1632d50e22d0b1ebe4999021d52313 @@ -246,28 +315,32 @@ trackedFiles: pristine_git_object: b266619dcb57222ec343f373c43b2b5cef5b8b93 docs/models/thinkchunk.md: id: bca24d7153f6 - last_write_checksum: sha1:2b8ff7737fa7255673ca31da7cb2e6803fce9e02 - pristine_git_object: b07f598ebc5f0e9c041186c081dc98bc21104bdb + last_write_checksum: sha1:db29812dbc6f9be7a385322d25a5cd98bfb3ef1e + pristine_git_object: d825497ee09624b829965d2b5bea2ddc54a32608 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 + last_write_checksum: sha1:2ab2016846da06ab38751176ba80fb6527c2818b + pristine_git_object: 85888d01cf439be601c8d1df4048c90161cf47df docs/models/toolcall.md: id: 80892ea1a051 - last_write_checksum: sha1:cb27b9d36cfe6227978c7a7a01b1349b6bac99d9 - pristine_git_object: 3819236b9f3eee2f6878818cfbbe2817e97f7de2 + last_write_checksum: sha1:621dc83981e13cbcbc21f2e16a34178c322c4566 + pristine_git_object: 9d236e8b289977d2aa7bded0d633b224c5ec9e57 docs/models/toolchoice.md: id: "097076343426" - last_write_checksum: sha1:25b33b34da02c3b46349dc8b6223f9ae18370d16 - pristine_git_object: 373046bbbc834169293b4f4ae8b2e238f952ddde + last_write_checksum: sha1:65a2794a1102fdcba6fa5a3f497630fbaf98f94b + pristine_git_object: a457f96f6e295d590a5ef75f83a5a6c4fdd41c47 docs/models/toolchoiceenum.md: id: 15410de51ffc - last_write_checksum: sha1:ca0cf9bf128bebc8faedd9333cc6a56b30f58130 - pristine_git_object: 0be3d6c54b13a8bf30773398a2c12e0d30d3ae58 + last_write_checksum: sha1:8b5e1a5e3df1e72baad48cd526299a31dc766e39 + pristine_git_object: c97bf91224c7bbb1e5f35d6d9da737313bfd1296 + docs/models/toolconfiguration.md: + id: 06bfa2c4e662 + last_write_checksum: sha1:9b619977375f228c76f09d48d6e2833add6c07e2 + pristine_git_object: 89286a172124ce3473bcb081de6e4db8c95afefa docs/models/toolmessage.md: id: 0553747c37a1 last_write_checksum: sha1:ac61e644ba7c6da607cb479eafd1db78d8e8012e @@ -278,16 +351,12 @@ trackedFiles: 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 + 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/usageinfo.md: id: ec6fe65028a9 last_write_checksum: sha1:cf71fb9676d870eba7c4d10a69636e1db4054adc @@ -308,6 +377,14 @@ trackedFiles: id: 304bdf06ef8b last_write_checksum: sha1:1f297f34069668f6107f2c0389606efe413ff5a8 pristine_git_object: 5bcea5b5d12e72222720af2c014d64ec4bdfee4a + 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 py.typed: id: 258c3ed47ae4 last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 @@ -316,10 +393,6 @@ trackedFiles: 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 @@ -342,16 +415,16 @@ trackedFiles: pristine_git_object: ea95bed210db9180824efddfb1b3e47f5bf96489 src/mistralai/gcp/client/_version.py: id: f87319e32c7b - last_write_checksum: sha1:2c22a5ebb7568968607db20612021af35240f714 - pristine_git_object: 377c9836b5f8bdf65e87ba375232422114af2966 + last_write_checksum: sha1:a8381a446688258017504fe271c6c05db83f5b6f + pristine_git_object: e6a19a24aeb633a7c6741fac4aa1cd935f6eff3d src/mistralai/gcp/client/basesdk.py: id: 4d594572857b - last_write_checksum: sha1:d8ef9e2f4fa97d402eb9f5472ceb80fb39693991 - pristine_git_object: b3edcb0aca1882d0cbe4d499cfba9cb5464c5b58 + last_write_checksum: sha1:09816f367408668addafe77aa5f69e6a089f8fca + pristine_git_object: 1c518adee8029a46ec5d6951cc6804465e1c3355 src/mistralai/gcp/client/chat.py: id: 4c41f05f786e - last_write_checksum: sha1:60b2697e2ecfb62eebed910007e62ab1df565eec - pristine_git_object: 925d69eda2fdac458045cc12327ca72997e07600 + last_write_checksum: sha1:ab6973161c8faa694e5132d7a8838d975ec23e55 + pristine_git_object: 8a9abf59a633510f6086a520e755debd40d9b641 src/mistralai/gcp/client/errors/__init__.py: id: c51c8ed21629 last_write_checksum: sha1:29f08ad600a712ff572843a250839ef92efac19b @@ -378,76 +451,92 @@ trackedFiles: pristine_git_object: 6980924626fa5fbf67fb62a30fd23d5883dbe650 src/mistralai/gcp/client/fim.py: id: 13d2d208e0ef - last_write_checksum: sha1:1027165887446ce0764ad542ca52f61b460c71b8 - pristine_git_object: 4202102ae5218784a10ee93ada5a0643d23a1d0c + last_write_checksum: sha1:cd7d11744022f12d4fa5889746f3861a563537b6 + pristine_git_object: cd5abaf8a8174536cca8ee3e5451fe6ce0379540 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 + last_write_checksum: sha1:f4b9b23318c8e44f32d4becc4ad1afd0faee3715 + pristine_git_object: f7a311a2f7cd41b491e0b5cd4203c711b31873f6 + src/mistralai/gcp/client/models/apikeyauth.py: + id: 6b9f6832e632 + last_write_checksum: sha1:6ec18425d5aa90f6c131763d39a8bf4d74944b7d + pristine_git_object: 99d2ad79e388b0b77baafd431c890e3b9cd1032e src/mistralai/gcp/client/models/assistantmessage.py: id: d39c4bdd289e - last_write_checksum: sha1:c813783bcbeec4e40f12e007d1dde4aed8ec71cf - pristine_git_object: 702ac4708abb95fc18d138500b8353715c2dbc98 + last_write_checksum: sha1:c4714e1d6eea548e68118c44a5fcac63548c7605 + pristine_git_object: 63f3b0dd9b7348e06c63d8ac2bdcc2d7faa59853 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 + last_write_checksum: sha1:022f638fc4c28e3983c804e4b24b7f7a9f6542ea + pristine_git_object: 89f4868b1262e1aac6d0898409b5d2e27ffc209a src/mistralai/gcp/client/models/chatcompletionrequest.py: id: 4694a31c0003 - last_write_checksum: sha1:80fcbbcde773c22c93cf2db63beef2cfe3777497 - pristine_git_object: 8229c5bb13ded84039f3d8ddb95ac0a9c184e1bd + last_write_checksum: sha1:298b0d06dec99a85d086b19314c3361622451bd0 + pristine_git_object: 0e3de41307489a6ee395c535ebbd42303c971c63 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 + last_write_checksum: sha1:6dbe04dd7c8b3f509e0ada777aac7e77c1ad4cb8 + pristine_git_object: 2adc781281387122f81527547624ac6a68a08787 + src/mistralai/gcp/client/models/codeinterpretertool.py: + id: dae8864ee549 + last_write_checksum: sha1:25508d287514c3b28f5902a84e09461e8eef595f + pristine_git_object: 9fdedce7f27cfe6fc8981cdb9fb6df8235c6da9c src/mistralai/gcp/client/models/completionchunk.py: id: 6b9ed8c30877 - last_write_checksum: sha1:f1f091e94e3c1c1aefd3c3bb60c8de8236ab0ead - pristine_git_object: a0b1ae2fa3109a2c2b76bbc483b691d88dc9a15c + last_write_checksum: sha1:c19d80a18060082a73b7e7fcc6af6fccac0cf5d6 + pristine_git_object: 3f8d8c6b62b4ba5d158e0243382110c39c1f3140 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 + last_write_checksum: sha1:03cf7a80e925662eff06a16e55206f0f1f9f09dd + pristine_git_object: 0f189b553a81308dca9e4a96831bbd4a8910962e src/mistralai/gcp/client/models/contentchunk.py: id: 8714d3bf2698 last_write_checksum: sha1:acab1b53b1d324544c6aa6c4126a3fb5265278d2 pristine_git_object: 18d481505e17d2125e380d796b0c406b0e66d601 + src/mistralai/gcp/client/models/customconnector.py: + id: a86074dd071e + last_write_checksum: sha1:52168a13fb6e6a4e1addd6b4efeb8448de2abbd3 + pristine_git_object: 3829972679bba9567d1277e3b6f64851d2d8f2a8 src/mistralai/gcp/client/models/deltamessage.py: id: 404fc85f1a4c - last_write_checksum: sha1:982c2d15a570c7f4d5e1c3b012db46ea3bac609b - pristine_git_object: 63e6a7f3e50c138f235f5a36277aa8668f85cef1 + last_write_checksum: sha1:7e043f7d5335255efbd80813e6cfdf44bf92bd4b + pristine_git_object: 1943aec72be09f7fafdf2e2976d4765962dbd897 + src/mistralai/gcp/client/models/documentlibrarytool.py: + id: 265f6eb0b1b0 + last_write_checksum: sha1:02390e6d5a0061a442453f588447923dfc7e17c9 + pristine_git_object: 36fb81e59dbcd42983f20df16cae29e35e81bd9d src/mistralai/gcp/client/models/fimcompletionrequest.py: id: 5b79e2595d31 - last_write_checksum: sha1:80a2e3d5e10c240869cd96c41936d714cf8bf801 - pristine_git_object: e460f76c59315c22c75194936f1f3b232331f83c + last_write_checksum: sha1:78e0ea727e094b45a444251776aaccd9d273bffe + pristine_git_object: 5b6013f6a4c11591f2c5e0c0c204845e7c2caeb6 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 + last_write_checksum: sha1:13d68fffdc4f0984732b64d12cfcc781ace0a757 + pristine_git_object: d2e86d406c255ecf2ae0242391be81f09c377572 src/mistralai/gcp/client/models/function.py: id: 2285a899b32e - last_write_checksum: sha1:6439f7f781174ae56b2b02ccbb4d02b08d8d5a03 - pristine_git_object: 439e831355444e0f9e82d23636651201f0db4bfc + last_write_checksum: sha1:3f8f9274cb5acacabb8f5bcbfef5bf4070a8f87b + pristine_git_object: 877b72737f1b21319c3d1b20ad7d8335118e1d8b src/mistralai/gcp/client/models/functioncall.py: id: 17bb51f08e5f last_write_checksum: sha1:b5fe2f061ea5f47057ee50011babc80de27e0ee6 @@ -456,38 +545,74 @@ trackedFiles: id: 313a6001145f last_write_checksum: sha1:fe1eefaed314efa788bd15beb63bf6b81abb307e pristine_git_object: 585b9e39762e49356823e211ad86f701bca389b8 + src/mistralai/gcp/client/models/guardrailconfig.py: + id: e3ef48444e1d + last_write_checksum: sha1:4ce14efae5297fe180dfc6478bde73cf5dcd3c45 + pristine_git_object: abc5decaebbc2d40b3a578e0198c7209f93b9ca5 src/mistralai/gcp/client/models/imagedetail.py: id: a28b2f3e2cb5 last_write_checksum: sha1:a4874529961952019eaa86a2fa0989626f537a4c pristine_git_object: 68ed76080716eb1424b13f182479f57e51a4fabf + src/mistralai/gcp/client/models/imagegenerationtool.py: + id: 4839c86ce5cc + last_write_checksum: sha1:e193a8b758b91c5fa57b8839fba5f315773b6254 + pristine_git_object: e6b289207b3cae97db469a46670d0749ed5cc574 src/mistralai/gcp/client/models/imageurl.py: id: 4e330f3eae74 - last_write_checksum: sha1:6c0bee7d7c765fb2611131c7d270041671b428b8 - pristine_git_object: 903d0a1a45eeb7c5e8cde80f624b6e039de1f4cc + last_write_checksum: sha1:19cd630d12f901879c5014b550261cc2f156eb07 + pristine_git_object: 99e555985d4478c286470d7e2430848cd876cdd3 src/mistralai/gcp/client/models/imageurlchunk.py: id: e68a4a393e9b - last_write_checksum: sha1:eae1d0e69a90b2f7513492e4cd0ed68d647f0b5d - pristine_git_object: 4bec0eec882c1eeee8a80f663ff7d686ca677ea0 + last_write_checksum: sha1:54bbaac8e5f3b0d42e7da9463ebe30b6f82b2a94 + pristine_git_object: e939c34b76aeabb53d82abb42d80828010f89e78 src/mistralai/gcp/client/models/jsonschema.py: id: 39c6e7d412a0 - last_write_checksum: sha1:19b34a5e3f5c00d1a1b96f91a6e02f5ad12240c7 - pristine_git_object: 684ac09f0460bef1f26bf0030b79bbc7141ab99b + last_write_checksum: sha1:0a1f92793e57e8357d395f4d99756d1c237baa3a + pristine_git_object: f500fa5636ef18e1eb47a8ea7e7fbe023cd46025 src/mistralai/gcp/client/models/mistralpromptmode.py: id: 8be4a4a683e4 last_write_checksum: sha1:c958567e95490abf3941fde69be69733e8afb90e pristine_git_object: c765e4f1a0b86735255771231377f13d62f3d7a6 + src/mistralai/gcp/client/models/moderationllmaction.py: + id: 27fbed8d6919 + last_write_checksum: sha1:fbc27faa2fbaa51a66bee21935c4bce350291f5e + pristine_git_object: cff03d9aa6de26ce3daa9edbc065ec3f759b5ee6 + src/mistralai/gcp/client/models/moderationllmv1categorythresholds.py: + id: 9c3f2837e5c3 + last_write_checksum: sha1:bcd4b4632002d240091bcf20cc643257e8559de5 + pristine_git_object: 3f5713fe1aa8f988af9964961b803f4ad890536b + src/mistralai/gcp/client/models/moderationllmv1config.py: + id: 348cd52230bd + last_write_checksum: sha1:5f252b76d5c9fe9ebba7cb2bee49a3ab8bacb16a + pristine_git_object: 579acd736d23bb75e8aba284a261a3506e83d0b3 + src/mistralai/gcp/client/models/moderationllmv2categorythresholds.py: + id: a1f948710f49 + last_write_checksum: sha1:1ac252d7c87caf344454a2c839cddeb9e92169d9 + pristine_git_object: 8b9252604ea4786365fa1b7273d6b99acef7c134 + src/mistralai/gcp/client/models/moderationllmv2config.py: + id: 17b6f1e661fd + last_write_checksum: sha1:96fa77b745e084aa25cfb1baf7914e580b89ecc4 + pristine_git_object: 000d2e2c70accf7434f99f803e6b2d5d13ea4c2f + src/mistralai/gcp/client/models/oauth2tokenauth.py: + id: e04fbd0e98a6 + last_write_checksum: sha1:34d2464532aae4a6d025d5d87024c31ee645fca5 + pristine_git_object: d1b4c93503cf990a56ab7641f2eadf5d6d3ab4c7 src/mistralai/gcp/client/models/prediction.py: id: 7a5463285bc8 - last_write_checksum: sha1:67c4a9b06d3e98552409a26960e0afd64f829b53 - pristine_git_object: 2e325289fd6c2a987ad270fd808f7b9a3f423440 + last_write_checksum: sha1:6a375252b2c5bdad129aa10462b8ac7613ef6c1d + pristine_git_object: 1e290f334a502cc643e33f53d30695b75c93c2ec + src/mistralai/gcp/client/models/reasoningeffort.py: + id: 9e62d78449a6 + last_write_checksum: sha1:703d87ae8c89b9fa9284833c45daa77752c3a8e8 + pristine_git_object: 43ffa02b8407ab64d41f23c3a56c02fe275e38de src/mistralai/gcp/client/models/referencechunk.py: id: 523e477f8725 - last_write_checksum: sha1:aade1dc05c2a2672630eb17626e4f49367d6bfe6 - pristine_git_object: 261c4755641093a38f97b17dce3a387623e69ead + last_write_checksum: sha1:5da5e54980082fec24a7f0700d7f4fa32793d342 + pristine_git_object: eca4c4dea0f8672be08727106bdd06110ba38246 src/mistralai/gcp/client/models/responseformat.py: id: 06774bb65b42 - last_write_checksum: sha1:7e64de46ef34718003cf0d198868a193f2122178 - pristine_git_object: f3aa9930e0f8a009dac628300d66c6209a538031 + last_write_checksum: sha1:92b8c399f81f9da7ed503c5fa0c298bdf16dd49c + pristine_git_object: afd1bd307ec231be64094f7263975eb4450b9607 src/mistralai/gcp/client/models/responseformats.py: id: 18112ad0f6db last_write_checksum: sha1:a212e85d286b5b49219f57d071a2232ff8b5263b @@ -510,48 +635,56 @@ trackedFiles: pristine_git_object: 690322725c0f852a005d08c5b722c41709868b22 src/mistralai/gcp/client/models/thinkchunk.py: id: 59a1d1ef2020 - last_write_checksum: sha1:f2f07f8bf1094cff718fb0f3ef760890c54e4003 - pristine_git_object: d534fc1ecc2a127d9ac9ac3d7a7aba7156faf7c2 + last_write_checksum: sha1:5896f44bd4868c2c14b83be15e536e129ad30752 + pristine_git_object: 34397d30a28dd42d06617e1b0863cfef6696a8c8 src/mistralai/gcp/client/models/tool.py: id: 4b27d45e56ad - last_write_checksum: sha1:cb0d879a55218fd7753bdd005be8a155982feb8f - pristine_git_object: 670aa81f8767e7c079105cf5995225168b4d6eb6 + last_write_checksum: sha1:e97109b00c31a731920e963ce0a346c3e8059448 + pristine_git_object: e95b303696e3881c58a9df16e059d22ba2e2b11b src/mistralai/gcp/client/models/toolcall.py: id: e6c25869a579 - last_write_checksum: sha1:f88e69a8e352025ca4b6897f6c16e1f7e4cd7264 - pristine_git_object: 3ea8e283c8f695bcc1fbc734b0074d37c2efeac8 + last_write_checksum: sha1:49733947b95332a77156893623bb58845518cdb8 + pristine_git_object: 4e4c2581af45686e0e4fe3c5cce9670f7f07d0c5 src/mistralai/gcp/client/models/toolchoice.py: id: cb13a9f64c92 - last_write_checksum: sha1:71be72b1aae19aef1f8a461c89b71ad6daa009b7 - pristine_git_object: 6e795fd72792f740c8aa5b4da7d1f516018f2c2e + last_write_checksum: sha1:613b18868534759b45e26e00e5a83c8f8b14b006 + pristine_git_object: 528cc801e876cd978be94027f36b83449136800b src/mistralai/gcp/client/models/toolchoiceenum.py: id: d62e9c92d93c last_write_checksum: sha1:3dbba9a58c5569aafe115f3f7713a52b01ad8620 pristine_git_object: 01f6f677b379f9e3c99db9d1ad248cb0033a2804 + src/mistralai/gcp/client/models/toolconfiguration.py: + id: c64c4cb6272c + last_write_checksum: sha1:f16ad6049988244f20f2ec3454236ae50c4198a1 + pristine_git_object: 724ed8c65f4b77d74d72898d3566843947de5f82 src/mistralai/gcp/client/models/toolmessage.py: id: b3774786c2e9 - last_write_checksum: sha1:3d414da8132467d1472ebe485802ffc78eb6f7e4 - pristine_git_object: ce160391f37ce3568daf2877f8dc1aa0f3694821 + last_write_checksum: sha1:7807f5b2b124643126cf6d141af40924838dba28 + pristine_git_object: a5a9645dda134345f5a023d49c8d5dbe9dd135ec 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 + last_write_checksum: sha1:b70e37ab08799a0332a23856314b3a1a3cdf16b5 + pristine_git_object: eb2b80e409d2b929d6a4018f3ef80a2d61c06ab0 src/mistralai/gcp/client/models/usageinfo.py: id: 3aab1af66cff - last_write_checksum: sha1:c0c949ac48ed35efe1e8fbf820b8e390edd9c3ce - pristine_git_object: cb6feb6e8d173d39b828d8f5b38af75173b4f7f2 + last_write_checksum: sha1:432d75c62a44820c9b068e8e14c15fcfdb0931e8 + pristine_git_object: df40efab5b7a0457b4d8f62d46a7a8820fec8cc4 src/mistralai/gcp/client/models/usermessage.py: id: 9cfa7260463e - last_write_checksum: sha1:780984241b84a7dfe1f6ad6eccace1204bfec8bd - pristine_git_object: e237e900421a9e65fd15aede29ade0e510b189f6 + last_write_checksum: sha1:8d3eb6d719e8fb0bff460c1e7acc5ef2a5633882 + pristine_git_object: 8199f2936c2a2cc1e971400813acc508e4242e2f src/mistralai/gcp/client/models/validationerror.py: id: 6b4f4910ea9c - last_write_checksum: sha1:1fd1ffba68b202465f3a0269d7099b4fee5c85c9 - pristine_git_object: 3ff872c15f6380c3a7f9dc9be1b80be159f752ba + last_write_checksum: sha1:e595fb93b91fd9d1d1b48cb551c277be9c0a9dbd + pristine_git_object: 653b63e906c0a341e4fef6e7d7a253314e545f8c + src/mistralai/gcp/client/models/websearchpremiumtool.py: + id: 0f6734458e65 + last_write_checksum: sha1:64842c599d3ff0161c4b9fbca2dde21b75ab1ac2 + pristine_git_object: e416f96472bc8956d5ff44c061f725e10fa0a317 + src/mistralai/gcp/client/models/websearchtool.py: + id: 40ee5a5ac881 + last_write_checksum: sha1:36287a70e58b48968effec4feb9bc9dbfbb9cd94 + pristine_git_object: 69d6e04373c665012103489006f4e39bd85cd565 src/mistralai/gcp/client/py.typed: id: 98b8ab80ab0d last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 @@ -590,8 +723,8 @@ trackedFiles: pristine_git_object: 3324e1bc2668c54c4d5f5a1a845675319757a828 src/mistralai/gcp/client/utils/eventstreaming.py: id: bb66f0c3e0dc - last_write_checksum: sha1:ffa870a25a7e4e2015bfd7a467ccd3aa1de97f0e - pristine_git_object: f2052fc22d9fd6c663ba3dce019fe234ca37108b + last_write_checksum: sha1:620d78a8b4e3b854e08d136e02e40a01a786bd70 + pristine_git_object: 3bdcd6d3d4fc772cb7f5fca8685dcdc8c85e13e8 src/mistralai/gcp/client/utils/forms.py: id: ebf34781d6bd last_write_checksum: sha1:0ca31459b99f761fcc6d0557a0a38daac4ad50f4 @@ -606,8 +739,8 @@ trackedFiles: pristine_git_object: b661aff65d38b77d035149699aea09b2785d2fc6 src/mistralai/gcp/client/utils/metadata.py: id: ff0e832b8b9c - last_write_checksum: sha1:c6a560bd0c63ab158582f34dadb69433ea73b3d4 - pristine_git_object: 173b3e5ce658675c2f504222a56b3daaaa68107d + last_write_checksum: sha1:e703e5cbb5255144aacf86898d1420529afaaff8 + pristine_git_object: 5abddd588837ac297050ca3b543627faadb350a9 src/mistralai/gcp/client/utils/queryparams.py: id: 133b8408e73e last_write_checksum: sha1:b94c3f314fd3da0d1d215afc2731f48748e2aa59 @@ -622,12 +755,12 @@ trackedFiles: pristine_git_object: af07d4e941007af4213c5ec9047ef8a2fca04e5e src/mistralai/gcp/client/utils/security.py: id: 5273152365f4 - last_write_checksum: sha1:435dd8b180cefcd733e635b9fa45512da091d9c0 - pristine_git_object: 17996bd54b8624009802fbbdf30bcb4225b8dfed + last_write_checksum: sha1:c11eef495b6aaa249178c24c796940cc540b7a00 + pristine_git_object: 42d8d78e9981eed7507670014d99588e27ab325a src/mistralai/gcp/client/utils/serializers.py: id: a7836e553d41 - last_write_checksum: sha1:ce1d8d7f500a9ccba0aeca5057cee9c271f4dfd7 - pristine_git_object: 14321eb479de81d0d9580ec8291e0ff91bf29e57 + last_write_checksum: sha1:61009f2e4ef6613a1a5af813fe020373dae5a492 + pristine_git_object: d2149f8b909cb96628db140ac3cddb1b1e981367 src/mistralai/gcp/client/utils/unions.py: id: 8abba1cf1b6d last_write_checksum: sha1:6e38049f323e0b5fb4bd0e88ab51ec447197ccb0 @@ -664,20 +797,19 @@ examples: stream_fim: speakeasy-default-stream-fim: requestBody: - application/json: {"model": "codestral-latest", "top_p": 1, "stream": true, "prompt": "def", "suffix": "return a+b"} + application/json: {"model": "codestral-latest", "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"} + 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"}]} 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 diff --git a/packages/gcp/.speakeasy/gen.yaml b/packages/gcp/.speakeasy/gen.yaml index 27793130..ebf8a3a0 100644 --- a/packages/gcp/.speakeasy/gen.yaml +++ b/packages/gcp/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 2.0.0 + version: 2.1.0 additionalDependencies: dev: pytest: ^8.2.2 diff --git a/packages/gcp/README-PYPI.md b/packages/gcp/README-PYPI.md new file mode 100644 index 00000000..28a873a0 --- /dev/null +++ b/packages/gcp/README-PYPI.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](https://github.com/mistralai/client-python/blob/main/packages/gcp/docs/sdks/chat/README.md) + +* [stream](https://github.com/mistralai/client-python/blob/main/packages/gcp/docs/sdks/chat/README.md#stream) - Stream chat completion +* [complete](https://github.com/mistralai/client-python/blob/main/packages/gcp/docs/sdks/chat/README.md#complete) - Chat Completion + +### [fim](https://github.com/mistralai/client-python/blob/main/packages/gcp/docs/sdks/fim/README.md) + +* [stream](https://github.com/mistralai/client-python/blob/main/packages/gcp/docs/sdks/fim/README.md#stream) - Stream fim completion +* [complete](https://github.com/mistralai/client-python/blob/main/packages/gcp/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 index 30d3e580..9cf7beb2 100644 --- a/packages/gcp/RELEASES.md +++ b/packages/gcp/RELEASES.md @@ -38,4 +38,14 @@ Based on: ### 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 +- [PyPI v2.0.0] https://pypi.org/project/mistralai-gcp/2.0.0 - packages/gcp + +## 2026-05-22 14:13:02 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.763.6 (2.884.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.1.0] packages/gcp +### Releases +- [PyPI v2.1.0] https://pypi.org/project/mistralai-gcp/2.1.0 - packages/gcp \ No newline at end of file diff --git a/packages/gcp/docs/models/apikeyauth.md b/packages/gcp/docs/models/apikeyauth.md new file mode 100644 index 00000000..1fbff10e --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/authorization.md b/packages/gcp/docs/models/authorization.md new file mode 100644 index 00000000..11ea5c6a --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/builtinconnectors.md b/packages/gcp/docs/models/builtinconnectors.md index f96f5044..ad9b9823 100644 --- a/packages/gcp/docs/models/builtinconnectors.md +++ b/packages/gcp/docs/models/builtinconnectors.md @@ -1,12 +1,17 @@ # BuiltInConnectors +## Example Usage + +```python +from mistralai.gcp.client.models import BuiltInConnectors +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 +- `"web_search"` +- `"web_search_premium"` +- `"code_interpreter"` +- `"image_generation"` +- `"document_library"` diff --git a/packages/gcp/docs/models/chatcompletionchoice.md b/packages/gcp/docs/models/chatcompletionchoice.md index deaa0ea0..79d24a33 100644 --- a/packages/gcp/docs/models/chatcompletionchoice.md +++ b/packages/gcp/docs/models/chatcompletionchoice.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | `index` | *int* | :heavy_check_mark: | N/A | 0 | -| `message` | [models.AssistantMessage](../models/assistantmessage.md) | :heavy_check_mark: | N/A | | +| `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/packages/gcp/docs/models/chatcompletionchoicefinishreason.md b/packages/gcp/docs/models/chatcompletionchoicefinishreason.md index b2f15ecb..53290d8e 100644 --- a/packages/gcp/docs/models/chatcompletionchoicefinishreason.md +++ b/packages/gcp/docs/models/chatcompletionchoicefinishreason.md @@ -1,12 +1,21 @@ # ChatCompletionChoiceFinishReason +## Example Usage + +```python +from mistralai.gcp.client.models import ChatCompletionChoiceFinishReason + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ChatCompletionChoiceFinishReason = "stop" +``` + ## Values -| Name | Value | -| -------------- | -------------- | -| `STOP` | stop | -| `LENGTH` | length | -| `MODEL_LENGTH` | model_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"` +- `"model_length"` +- `"error"` +- `"tool_calls"` diff --git a/packages/gcp/docs/models/chatcompletionrequest.md b/packages/gcp/docs/models/chatcompletionrequest.md index 78cce437..db61b5c0 100644 --- a/packages/gcp/docs/models/chatcompletionrequest.md +++ b/packages/gcp/docs/models/chatcompletionrequest.md @@ -5,21 +5,23 @@ | 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 | +| `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-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. | | +| `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.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 | | +| `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.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. | | +| `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` | *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. | | +| `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. | | -| `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 +| `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 | | \ No newline at end of file diff --git a/packages/gcp/docs/models/chatcompletionrequesttool.md b/packages/gcp/docs/models/chatcompletionrequesttool.md new file mode 100644 index 00000000..572d12ca --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/chatcompletionstreamrequest.md b/packages/gcp/docs/models/chatcompletionstreamrequest.md index a26a85d7..bd19d37b 100644 --- a/packages/gcp/docs/models/chatcompletionstreamrequest.md +++ b/packages/gcp/docs/models/chatcompletionstreamrequest.md @@ -5,21 +5,23 @@ | 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 | +| `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-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. | | +| `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.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 | | +| `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.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. | | +| `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` | *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. | | +| `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. | | -| `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 +| `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 | | \ No newline at end of file diff --git a/packages/gcp/docs/models/chatcompletionstreamrequesttool.md b/packages/gcp/docs/models/chatcompletionstreamrequesttool.md new file mode 100644 index 00000000..48998fcb --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/codeinterpretertool.md b/packages/gcp/docs/models/codeinterpretertool.md new file mode 100644 index 00000000..6302fc62 --- /dev/null +++ b/packages/gcp/docs/models/codeinterpretertool.md @@ -0,0 +1,9 @@ +# CodeInterpreterTool + + +## Fields + +| 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/packages/gcp/docs/models/completionresponsestreamchoicefinishreason.md b/packages/gcp/docs/models/completionresponsestreamchoicefinishreason.md index 0fece473..7b37dc06 100644 --- a/packages/gcp/docs/models/completionresponsestreamchoicefinishreason.md +++ b/packages/gcp/docs/models/completionresponsestreamchoicefinishreason.md @@ -1,11 +1,20 @@ # CompletionResponseStreamChoiceFinishReason +## Example Usage + +```python +from mistralai.gcp.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/packages/gcp/docs/models/customconnector.md b/packages/gcp/docs/models/customconnector.md new file mode 100644 index 00000000..0a0b6921 --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/deltamessage.md b/packages/gcp/docs/models/deltamessage.md index e0ee575f..c2395e1b 100644 --- a/packages/gcp/docs/models/deltamessage.md +++ b/packages/gcp/docs/models/deltamessage.md @@ -3,8 +3,11 @@ ## 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 +| 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/packages/gcp/docs/models/documentlibrarytool.md b/packages/gcp/docs/models/documentlibrarytool.md new file mode 100644 index 00000000..95c3fa52 --- /dev/null +++ b/packages/gcp/docs/models/documentlibrarytool.md @@ -0,0 +1,10 @@ +# DocumentLibraryTool + + +## Fields + +| 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/packages/gcp/docs/models/fimcompletionrequest.md b/packages/gcp/docs/models/fimcompletionrequest.md index fde0b625..c0c52b66 100644 --- a/packages/gcp/docs/models/fimcompletionrequest.md +++ b/packages/gcp/docs/models/fimcompletionrequest.md @@ -7,10 +7,10 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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 | diff --git a/packages/gcp/docs/models/fimcompletionstreamrequest.md b/packages/gcp/docs/models/fimcompletionstreamrequest.md index ba62d854..c02b622c 100644 --- a/packages/gcp/docs/models/fimcompletionstreamrequest.md +++ b/packages/gcp/docs/models/fimcompletionstreamrequest.md @@ -7,10 +7,10 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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 | diff --git a/packages/gcp/docs/models/guardrailconfig.md b/packages/gcp/docs/models/guardrailconfig.md new file mode 100644 index 00000000..1276462c --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/imagedetail.md b/packages/gcp/docs/models/imagedetail.md index 1e5ba3fd..15cc63e7 100644 --- a/packages/gcp/docs/models/imagedetail.md +++ b/packages/gcp/docs/models/imagedetail.md @@ -1,10 +1,19 @@ # ImageDetail +## Example Usage + +```python +from mistralai.gcp.client.models import ImageDetail + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ImageDetail = "low" +``` + ## Values -| Name | Value | -| ------ | ------ | -| `LOW` | low | -| `AUTO` | auto | -| `HIGH` | high | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"low"` +- `"auto"` +- `"high"` diff --git a/packages/gcp/docs/models/imagegenerationtool.md b/packages/gcp/docs/models/imagegenerationtool.md new file mode 100644 index 00000000..b476b6f2 --- /dev/null +++ b/packages/gcp/docs/models/imagegenerationtool.md @@ -0,0 +1,9 @@ +# ImageGenerationTool + + +## Fields + +| 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/packages/gcp/docs/models/imageurlchunk.md b/packages/gcp/docs/models/imageurlchunk.md index a84dac32..73e1ed5a 100644 --- a/packages/gcp/docs/models/imageurlchunk.md +++ b/packages/gcp/docs/models/imageurlchunk.md @@ -1,6 +1,6 @@ # ImageURLChunk -{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0 +{"type":"image_url","image_url":"data:image/png;base64,iVBORw0"} ## Fields diff --git a/packages/gcp/docs/models/mistralpromptmode.md b/packages/gcp/docs/models/mistralpromptmode.md index c3409d03..921f81a4 100644 --- a/packages/gcp/docs/models/mistralpromptmode.md +++ b/packages/gcp/docs/models/mistralpromptmode.md @@ -4,9 +4,18 @@ 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.gcp.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/packages/gcp/docs/models/moderationllmaction.md b/packages/gcp/docs/models/moderationllmaction.md new file mode 100644 index 00000000..e0077a32 --- /dev/null +++ b/packages/gcp/docs/models/moderationllmaction.md @@ -0,0 +1,14 @@ +# ModerationLLMAction + +## Example Usage + +```python +from mistralai.gcp.client.models import ModerationLLMAction +value: ModerationLLMAction = "none" +``` + + +## Values + +- `"none"` +- `"block"` diff --git a/packages/gcp/docs/models/moderationllmv1categorythresholds.md b/packages/gcp/docs/models/moderationllmv1categorythresholds.md new file mode 100644 index 00000000..90ae213f --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/moderationllmv1config.md b/packages/gcp/docs/models/moderationllmv1config.md new file mode 100644 index 00000000..bdb5812b --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/moderationllmv2categorythresholds.md b/packages/gcp/docs/models/moderationllmv2categorythresholds.md new file mode 100644 index 00000000..e95b81b0 --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/moderationllmv2config.md b/packages/gcp/docs/models/moderationllmv2config.md new file mode 100644 index 00000000..e928506c --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/oauth2tokenauth.md b/packages/gcp/docs/models/oauth2tokenauth.md new file mode 100644 index 00000000..89f80436 --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/reasoningeffort.md b/packages/gcp/docs/models/reasoningeffort.md new file mode 100644 index 00000000..87e0ae76 --- /dev/null +++ b/packages/gcp/docs/models/reasoningeffort.md @@ -0,0 +1,14 @@ +# ReasoningEffort + +## Example Usage + +```python +from mistralai.gcp.client.models import ReasoningEffort +value: ReasoningEffort = "none" +``` + + +## Values + +- `"none"` +- `"high"` diff --git a/packages/gcp/docs/models/referencechunk.md b/packages/gcp/docs/models/referencechunk.md index d847e248..0186d3c3 100644 --- a/packages/gcp/docs/models/referencechunk.md +++ b/packages/gcp/docs/models/referencechunk.md @@ -3,7 +3,7 @@ ## 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 +| 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/packages/gcp/docs/models/referenceid.md b/packages/gcp/docs/models/referenceid.md new file mode 100644 index 00000000..1d29397f --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/responseformats.md b/packages/gcp/docs/models/responseformats.md index 2f5f1e55..5d9aeb3e 100644 --- a/packages/gcp/docs/models/responseformats.md +++ b/packages/gcp/docs/models/responseformats.md @@ -1,10 +1,15 @@ # ResponseFormats +## Example Usage + +```python +from mistralai.gcp.client.models import ResponseFormats +value: ResponseFormats = "text" +``` + ## Values -| Name | Value | -| ------------- | ------------- | -| `TEXT` | text | -| `JSON_OBJECT` | json_object | -| `JSON_SCHEMA` | json_schema | \ No newline at end of file +- `"text"` +- `"json_object"` +- `"json_schema"` diff --git a/packages/gcp/docs/models/thinkchunk.md b/packages/gcp/docs/models/thinkchunk.md index b07f598e..d825497e 100644 --- a/packages/gcp/docs/models/thinkchunk.md +++ b/packages/gcp/docs/models/thinkchunk.md @@ -7,4 +7,5 @@ | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | `type` | *Literal["thinking"]* | :heavy_check_mark: | N/A | | `thinking` | List[[models.Thinking](../models/thinking.md)] | :heavy_check_mark: | N/A | +| `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/packages/gcp/docs/models/tool.md b/packages/gcp/docs/models/tool.md index fb661f72..85888d01 100644 --- a/packages/gcp/docs/models/tool.md +++ b/packages/gcp/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/packages/gcp/docs/models/toolcall.md b/packages/gcp/docs/models/toolcall.md index 3819236b..9d236e8b 100644 --- a/packages/gcp/docs/models/toolcall.md +++ b/packages/gcp/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/packages/gcp/docs/models/toolchoice.md b/packages/gcp/docs/models/toolchoice.md index 373046bb..a457f96f 100644 --- a/packages/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 | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `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/packages/gcp/docs/models/toolchoiceenum.md b/packages/gcp/docs/models/toolchoiceenum.md index 0be3d6c5..c97bf912 100644 --- a/packages/gcp/docs/models/toolchoiceenum.md +++ b/packages/gcp/docs/models/toolchoiceenum.md @@ -1,11 +1,16 @@ # ToolChoiceEnum +## Example Usage + +```python +from mistralai.gcp.client.models import ToolChoiceEnum +value: ToolChoiceEnum = "auto" +``` + ## Values -| Name | Value | -| ---------- | ---------- | -| `AUTO` | auto | -| `NONE` | none | -| `ANY` | any | -| `REQUIRED` | required | \ No newline at end of file +- `"auto"` +- `"none"` +- `"any"` +- `"required"` diff --git a/packages/gcp/docs/models/toolconfiguration.md b/packages/gcp/docs/models/toolconfiguration.md new file mode 100644 index 00000000..89286a17 --- /dev/null +++ b/packages/gcp/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/packages/gcp/docs/models/toolreferencechunk.md b/packages/gcp/docs/models/toolreferencechunk.md index 9fc10399..49ea4ca7 100644 --- a/packages/gcp/docs/models/toolreferencechunk.md +++ b/packages/gcp/docs/models/toolreferencechunk.md @@ -3,11 +3,11 @@ ## 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 +| 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/packages/azure/docs/models/toolunion.md b/packages/gcp/docs/models/toolreferencechunktool.md similarity index 87% rename from packages/azure/docs/models/toolunion.md rename to packages/gcp/docs/models/toolreferencechunktool.md index 2dcb3dee..999f7c34 100644 --- a/packages/azure/docs/models/toolunion.md +++ b/packages/gcp/docs/models/toolreferencechunktool.md @@ -1,4 +1,4 @@ -# ToolUnion +# ToolReferenceChunkTool ## Supported Types diff --git a/packages/gcp/docs/models/tooltypes.md b/packages/gcp/docs/models/tooltypes.md deleted file mode 100644 index 84e49253..00000000 --- a/packages/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/gcp/docs/models/websearchpremiumtool.md b/packages/gcp/docs/models/websearchpremiumtool.md new file mode 100644 index 00000000..78b736cd --- /dev/null +++ b/packages/gcp/docs/models/websearchpremiumtool.md @@ -0,0 +1,9 @@ +# WebSearchPremiumTool + + +## Fields + +| 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/packages/gcp/docs/models/websearchtool.md b/packages/gcp/docs/models/websearchtool.md new file mode 100644 index 00000000..4ca7333c --- /dev/null +++ b/packages/gcp/docs/models/websearchtool.md @@ -0,0 +1,9 @@ +# WebSearchTool + + +## Fields + +| 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/packages/gcp/pyproject.toml b/packages/gcp/pyproject.toml index 9a8969c1..bb0d6ead 100644 --- a/packages/gcp/pyproject.toml +++ b/packages/gcp/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mistralai-gcp" -version = "2.0.0" +version = "2.1.0" description = "Python Client SDK for the Mistral AI API in GCP." authors = [{ name = "Mistral" }] requires-python = ">=3.10" @@ -25,6 +25,9 @@ dev = [ "types-python-dateutil>=2.9.0.20240316,<3", ] +[tool.uv] +exclude-newer = "7 days" + [tool.setuptools.package-data] "*" = ["py.typed", "src/mistralai/gcp/client/py.typed"] diff --git a/packages/gcp/src/mistralai/gcp/client/_version.py b/packages/gcp/src/mistralai/gcp/client/_version.py index 377c9836..e6a19a24 100644 --- a/packages/gcp/src/mistralai/gcp/client/_version.py +++ b/packages/gcp/src/mistralai/gcp/client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "mistralai-gcp" -__version__: str = "2.0.0" +__version__: str = "2.1.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" +__gen_version__: str = "2.884.13" +__user_agent__: str = "speakeasy-sdk/python 2.1.0 2.884.13 1.0.0 mistralai-gcp" try: if __package__ is not None: diff --git a/packages/gcp/src/mistralai/gcp/client/basesdk.py b/packages/gcp/src/mistralai/gcp/client/basesdk.py index b3edcb0a..1c518ade 100644 --- a/packages/gcp/src/mistralai/gcp/client/basesdk.py +++ b/packages/gcp/src/mistralai/gcp/client/basesdk.py @@ -7,6 +7,7 @@ AfterErrorContext, AfterSuccessContext, BeforeRequestContext, + HookContext, ) from mistralai.gcp.client.utils import ( RetryConfig, @@ -66,6 +67,7 @@ def _build_request_async( 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( @@ -87,6 +89,7 @@ def _build_request_async( url_override, http_headers, allow_empty_value, + allowed_fields, ) def _build_request( @@ -110,6 +113,7 @@ def _build_request( 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( @@ -131,6 +135,7 @@ def _build_request( url_override, http_headers, allow_empty_value, + allowed_fields, ) def _build_request_with_client( @@ -155,6 +160,7 @@ def _build_request_with_client( 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 = {} @@ -188,7 +194,9 @@ def _build_request_with_client( security = security() if security is not None: - security_headers, security_query_params = utils.get_security(security) + security_headers, security_query_params = utils.get_security( + security, allowed_fields + ) headers = {**headers, **security_headers} query_params = {**query_params, **security_query_params} @@ -225,15 +233,15 @@ def _build_request_with_client( data=serialized_request_body.data, files=serialized_request_body.files, headers=headers, - timeout=timeout, + timeout=timeout if timeout is not None else httpx.USE_CLIENT_DEFAULT, ) def do_request( self, - hook_ctx, - request, - error_status_codes, - stream=False, + hook_ctx: HookContext, + request: httpx.Request, + is_error_status_code: Callable[[int], bool], + stream: bool = False, retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, ) -> httpx.Response: client = self.sdk_configuration.client @@ -245,6 +253,8 @@ 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, @@ -275,19 +285,6 @@ def do(): "" 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: @@ -295,17 +292,27 @@ def do(): else: http_res = do() - if not utils.match_status_codes(error_status_codes, http_res.status_code): + if is_error_status_code(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) + else: 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, + hook_ctx: HookContext, + request: httpx.Request, + is_error_status_code: Callable[[int], bool], + stream: bool = False, retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, ) -> httpx.Response: client = self.sdk_configuration.async_client @@ -320,6 +327,8 @@ async def do(): 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, @@ -353,20 +362,6 @@ async def do(): "" 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: @@ -376,7 +371,20 @@ async def do(): else: http_res = await do() - if not utils.match_status_codes(error_status_codes, http_res.status_code): + if is_error_status_code(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) + else: http_res = await run_sync_in_thread( hooks.after_success, AfterSuccessContext(hook_ctx), http_res ) diff --git a/packages/gcp/src/mistralai/gcp/client/chat.py b/packages/gcp/src/mistralai/gcp/client/chat.py index 925d69ed..8a9abf59 100644 --- a/packages/gcp/src/mistralai/gcp/client/chat.py +++ b/packages/gcp/src/mistralai/gcp/client/chat.py @@ -21,22 +21,25 @@ def stream( List[models.ChatCompletionStreamRequestMessageTypedDict], ], temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, + top_p: OptionalNullable[float] = UNSET, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = True, - stop: Optional[ + stop: OptionalNullable[ Union[ models.ChatCompletionStreamRequestStop, models.ChatCompletionStreamRequestStopTypedDict, ] - ] = None, + ] = 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.Tool], List[models.ToolTypedDict]] + Union[ + List[models.ChatCompletionStreamRequestTool], + List[models.ChatCompletionStreamRequestToolTypedDict], + ] ] = UNSET, tool_choice: Optional[ Union[ @@ -44,14 +47,18 @@ def stream( models.ChatCompletionStreamRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = 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, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -78,7 +85,9 @@ def stream( :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 retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -89,6 +98,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: @@ -109,7 +121,9 @@ def stream( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ChatCompletionStreamRequestTool]] + ), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] ), @@ -120,7 +134,11 @@ def stream( 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]] + ), ) req = self._build_request( @@ -160,7 +178,7 @@ def stream( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -198,22 +216,25 @@ async def stream_async( List[models.ChatCompletionStreamRequestMessageTypedDict], ], temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, + top_p: OptionalNullable[float] = UNSET, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = True, - stop: Optional[ + stop: OptionalNullable[ Union[ models.ChatCompletionStreamRequestStop, models.ChatCompletionStreamRequestStopTypedDict, ] - ] = None, + ] = 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.Tool], List[models.ToolTypedDict]] + Union[ + List[models.ChatCompletionStreamRequestTool], + List[models.ChatCompletionStreamRequestToolTypedDict], + ] ] = UNSET, tool_choice: Optional[ Union[ @@ -221,14 +242,18 @@ async def stream_async( models.ChatCompletionStreamRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = 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, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -255,7 +280,9 @@ async def stream_async( :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 retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -266,6 +293,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: @@ -286,7 +316,9 @@ async def stream_async( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ChatCompletionStreamRequestTool]] + ), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] ), @@ -297,7 +329,11 @@ async def stream_async( 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]] + ), ) req = self._build_request_async( @@ -337,7 +373,7 @@ async def stream_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -375,22 +411,25 @@ def complete( List[models.ChatCompletionRequestMessageTypedDict], ], temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, + top_p: OptionalNullable[float] = UNSET, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = False, - stop: Optional[ + stop: OptionalNullable[ Union[ models.ChatCompletionRequestStop, models.ChatCompletionRequestStopTypedDict, ] - ] = None, + ] = 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.Tool], List[models.ToolTypedDict]] + Union[ + List[models.ChatCompletionRequestTool], + List[models.ChatCompletionRequestToolTypedDict], + ] ] = UNSET, tool_choice: Optional[ Union[ @@ -398,14 +437,18 @@ def complete( models.ChatCompletionRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = 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, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -430,7 +473,9 @@ def complete( :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 retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -441,6 +486,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: @@ -461,7 +509,9 @@ def complete( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ChatCompletionRequestTool]] + ), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.ChatCompletionRequestToolChoice] ), @@ -472,7 +522,11 @@ def complete( 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]] + ), ) req = self._build_request( @@ -512,7 +566,7 @@ def complete( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -542,22 +596,25 @@ async def complete_async( List[models.ChatCompletionRequestMessageTypedDict], ], temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, + top_p: OptionalNullable[float] = UNSET, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = False, - stop: Optional[ + stop: OptionalNullable[ Union[ models.ChatCompletionRequestStop, models.ChatCompletionRequestStopTypedDict, ] - ] = None, + ] = 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.Tool], List[models.ToolTypedDict]] + Union[ + List[models.ChatCompletionRequestTool], + List[models.ChatCompletionRequestToolTypedDict], + ] ] = UNSET, tool_choice: Optional[ Union[ @@ -565,14 +622,18 @@ async def complete_async( models.ChatCompletionRequestToolChoiceTypedDict, ] ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = 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, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -597,7 +658,9 @@ async def complete_async( :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 retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -608,6 +671,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: @@ -628,7 +694,9 @@ async def complete_async( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ChatCompletionRequestTool]] + ), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.ChatCompletionRequestToolChoice] ), @@ -639,7 +707,11 @@ async def complete_async( 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]] + ), ) req = self._build_request_async( @@ -679,7 +751,7 @@ async def complete_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/packages/gcp/src/mistralai/gcp/client/fim.py b/packages/gcp/src/mistralai/gcp/client/fim.py index 4202102a..cd5abaf8 100644 --- a/packages/gcp/src/mistralai/gcp/client/fim.py +++ b/packages/gcp/src/mistralai/gcp/client/fim.py @@ -18,15 +18,15 @@ def stream( model: str, prompt: str, temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = 1, + top_p: OptionalNullable[float] = UNSET, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = True, - stop: Optional[ + stop: OptionalNullable[ Union[ models.FIMCompletionStreamRequestStop, models.FIMCompletionStreamRequestStopTypedDict, ] - ] = None, + ] = UNSET, random_seed: OptionalNullable[int] = UNSET, metadata: OptionalNullable[Dict[str, Any]] = UNSET, suffix: OptionalNullable[str] = UNSET, @@ -61,6 +61,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: @@ -117,7 +120,7 @@ def stream( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -152,15 +155,15 @@ async def stream_async( model: str, prompt: str, temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = 1, + top_p: OptionalNullable[float] = UNSET, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = True, - stop: Optional[ + stop: OptionalNullable[ Union[ models.FIMCompletionStreamRequestStop, models.FIMCompletionStreamRequestStopTypedDict, ] - ] = None, + ] = UNSET, random_seed: OptionalNullable[int] = UNSET, metadata: OptionalNullable[Dict[str, Any]] = UNSET, suffix: OptionalNullable[str] = UNSET, @@ -195,6 +198,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: @@ -251,7 +257,7 @@ async def stream_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -286,15 +292,15 @@ def complete( model: str, prompt: str, temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = 1, + top_p: OptionalNullable[float] = UNSET, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = False, - stop: Optional[ + stop: OptionalNullable[ Union[ models.FIMCompletionRequestStop, models.FIMCompletionRequestStopTypedDict, ] - ] = None, + ] = UNSET, random_seed: OptionalNullable[int] = UNSET, metadata: OptionalNullable[Dict[str, Any]] = UNSET, suffix: OptionalNullable[str] = UNSET, @@ -329,6 +335,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: @@ -385,7 +394,7 @@ def complete( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -412,15 +421,15 @@ async def complete_async( model: str, prompt: str, temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = 1, + top_p: OptionalNullable[float] = UNSET, max_tokens: OptionalNullable[int] = UNSET, stream: Optional[bool] = False, - stop: Optional[ + stop: OptionalNullable[ Union[ models.FIMCompletionRequestStop, models.FIMCompletionRequestStopTypedDict, ] - ] = None, + ] = UNSET, random_seed: OptionalNullable[int] = UNSET, metadata: OptionalNullable[Dict[str, Any]] = UNSET, suffix: OptionalNullable[str] = UNSET, @@ -455,6 +464,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: @@ -511,7 +523,7 @@ async def complete_async( security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/packages/gcp/src/mistralai/gcp/client/models/__init__.py b/packages/gcp/src/mistralai/gcp/client/models/__init__.py index e42ed4bb..f7a311a2 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/__init__.py +++ b/packages/gcp/src/mistralai/gcp/client/models/__init__.py @@ -5,6 +5,7 @@ from mistralai.gcp.client.utils.dynamic_imports import lazy_getattr, lazy_dir if TYPE_CHECKING: + from .apikeyauth import APIKeyAuth, APIKeyAuthTypedDict from .assistantmessage import ( AssistantMessage, AssistantMessageContent, @@ -23,8 +24,10 @@ ChatCompletionRequestMessageTypedDict, ChatCompletionRequestStop, ChatCompletionRequestStopTypedDict, + ChatCompletionRequestTool, ChatCompletionRequestToolChoice, ChatCompletionRequestToolChoiceTypedDict, + ChatCompletionRequestToolTypedDict, ChatCompletionRequestTypedDict, ) from .chatcompletionresponse import ( @@ -37,10 +40,13 @@ ChatCompletionStreamRequestMessageTypedDict, ChatCompletionStreamRequestStop, ChatCompletionStreamRequestStopTypedDict, + ChatCompletionStreamRequestTool, ChatCompletionStreamRequestToolChoice, ChatCompletionStreamRequestToolChoiceTypedDict, + ChatCompletionStreamRequestToolTypedDict, ChatCompletionStreamRequestTypedDict, ) + from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict from .completionchunk import CompletionChunk, CompletionChunkTypedDict from .completionevent import CompletionEvent, CompletionEventTypedDict from .completionresponsestreamchoice import ( @@ -49,12 +55,19 @@ CompletionResponseStreamChoiceTypedDict, ) from .contentchunk import ContentChunk, ContentChunkTypedDict, UnknownContentChunk + from .customconnector import ( + Authorization, + AuthorizationTypedDict, + CustomConnector, + CustomConnectorTypedDict, + ) from .deltamessage import ( DeltaMessage, DeltaMessageContent, DeltaMessageContentTypedDict, DeltaMessageTypedDict, ) + from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict from .fimcompletionrequest import ( FIMCompletionRequest, FIMCompletionRequestStop, @@ -79,7 +92,9 @@ FunctionCallTypedDict, ) from .functionname import FunctionName, FunctionNameTypedDict + from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict from .imagedetail import ImageDetail + from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict from .imageurl import ImageURL, ImageURLTypedDict from .imageurlchunk import ( ImageURLChunk, @@ -89,8 +104,32 @@ ) from .jsonschema import JSONSchema, JSONSchemaTypedDict from .mistralpromptmode import MistralPromptMode + 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 .oauth2tokenauth import OAuth2TokenAuth, OAuth2TokenAuthTypedDict from .prediction import Prediction, PredictionTypedDict - from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict + from .reasoningeffort import ReasoningEffort + from .referencechunk import ( + ReferenceChunk, + ReferenceChunkTypedDict, + ReferenceID, + ReferenceIDTypedDict, + ) from .responseformat import ResponseFormat, ResponseFormatTypedDict from .responseformats import ResponseFormats from .security import Security, SecurityTypedDict @@ -110,6 +149,7 @@ from .toolcall import ToolCall, ToolCallTypedDict from .toolchoice import ToolChoice, ToolChoiceTypedDict from .toolchoiceenum import ToolChoiceEnum + from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict from .toolmessage import ( ToolMessage, ToolMessageContent, @@ -118,11 +158,10 @@ ) from .toolreferencechunk import ( ToolReferenceChunk, + ToolReferenceChunkTool, + ToolReferenceChunkToolTypedDict, ToolReferenceChunkTypedDict, - ToolUnion, - ToolUnionTypedDict, ) - from .tooltypes import ToolTypes from .usageinfo import UsageInfo, UsageInfoTypedDict from .usermessage import ( UserMessage, @@ -138,14 +177,23 @@ ValidationError, ValidationErrorTypedDict, ) + from .websearchpremiumtool import ( + WebSearchPremiumTool, + WebSearchPremiumToolTypedDict, + ) + from .websearchtool import WebSearchTool, WebSearchToolTypedDict __all__ = [ + "APIKeyAuth", + "APIKeyAuthTypedDict", "Arguments", "ArgumentsTypedDict", "AssistantMessage", "AssistantMessageContent", "AssistantMessageContentTypedDict", "AssistantMessageTypedDict", + "Authorization", + "AuthorizationTypedDict", "BuiltInConnectors", "ChatCompletionChoice", "ChatCompletionChoiceFinishReason", @@ -155,8 +203,10 @@ "ChatCompletionRequestMessageTypedDict", "ChatCompletionRequestStop", "ChatCompletionRequestStopTypedDict", + "ChatCompletionRequestTool", "ChatCompletionRequestToolChoice", "ChatCompletionRequestToolChoiceTypedDict", + "ChatCompletionRequestToolTypedDict", "ChatCompletionRequestTypedDict", "ChatCompletionResponse", "ChatCompletionResponseTypedDict", @@ -165,9 +215,13 @@ "ChatCompletionStreamRequestMessageTypedDict", "ChatCompletionStreamRequestStop", "ChatCompletionStreamRequestStopTypedDict", + "ChatCompletionStreamRequestTool", "ChatCompletionStreamRequestToolChoice", "ChatCompletionStreamRequestToolChoiceTypedDict", + "ChatCompletionStreamRequestToolTypedDict", "ChatCompletionStreamRequestTypedDict", + "CodeInterpreterTool", + "CodeInterpreterToolTypedDict", "CompletionChunk", "CompletionChunkTypedDict", "CompletionEvent", @@ -179,10 +233,14 @@ "ContentChunkTypedDict", "Context", "ContextTypedDict", + "CustomConnector", + "CustomConnectorTypedDict", "DeltaMessage", "DeltaMessageContent", "DeltaMessageContentTypedDict", "DeltaMessageTypedDict", + "DocumentLibraryTool", + "DocumentLibraryToolTypedDict", "FIMCompletionRequest", "FIMCompletionRequestStop", "FIMCompletionRequestStopTypedDict", @@ -199,7 +257,11 @@ "FunctionName", "FunctionNameTypedDict", "FunctionTypedDict", + "GuardrailConfig", + "GuardrailConfigTypedDict", "ImageDetail", + "ImageGenerationTool", + "ImageGenerationToolTypedDict", "ImageURL", "ImageURLChunk", "ImageURLChunkTypedDict", @@ -211,10 +273,24 @@ "Loc", "LocTypedDict", "MistralPromptMode", + "ModerationLLMAction", + "ModerationLlmv1CategoryThresholds", + "ModerationLlmv1CategoryThresholdsTypedDict", + "ModerationLlmv1Config", + "ModerationLlmv1ConfigTypedDict", + "ModerationLlmv2CategoryThresholds", + "ModerationLlmv2CategoryThresholdsTypedDict", + "ModerationLlmv2Config", + "ModerationLlmv2ConfigTypedDict", + "OAuth2TokenAuth", + "OAuth2TokenAuthTypedDict", "Prediction", "PredictionTypedDict", + "ReasoningEffort", "ReferenceChunk", "ReferenceChunkTypedDict", + "ReferenceID", + "ReferenceIDTypedDict", "ResponseFormat", "ResponseFormatTypedDict", "ResponseFormats", @@ -238,16 +314,17 @@ "ToolChoice", "ToolChoiceEnum", "ToolChoiceTypedDict", + "ToolConfiguration", + "ToolConfigurationTypedDict", "ToolMessage", "ToolMessageContent", "ToolMessageContentTypedDict", "ToolMessageTypedDict", "ToolReferenceChunk", + "ToolReferenceChunkTool", + "ToolReferenceChunkToolTypedDict", "ToolReferenceChunkTypedDict", "ToolTypedDict", - "ToolTypes", - "ToolUnion", - "ToolUnionTypedDict", "UnknownContentChunk", "UsageInfo", "UsageInfoTypedDict", @@ -257,9 +334,15 @@ "UserMessageTypedDict", "ValidationError", "ValidationErrorTypedDict", + "WebSearchPremiumTool", + "WebSearchPremiumToolTypedDict", + "WebSearchTool", + "WebSearchToolTypedDict", ] _dynamic_imports: dict[str, str] = { + "APIKeyAuth": ".apikeyauth", + "APIKeyAuthTypedDict": ".apikeyauth", "AssistantMessage": ".assistantmessage", "AssistantMessageContent": ".assistantmessage", "AssistantMessageContentTypedDict": ".assistantmessage", @@ -273,8 +356,10 @@ "ChatCompletionRequestMessageTypedDict": ".chatcompletionrequest", "ChatCompletionRequestStop": ".chatcompletionrequest", "ChatCompletionRequestStopTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestTool": ".chatcompletionrequest", "ChatCompletionRequestToolChoice": ".chatcompletionrequest", "ChatCompletionRequestToolChoiceTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestToolTypedDict": ".chatcompletionrequest", "ChatCompletionRequestTypedDict": ".chatcompletionrequest", "ChatCompletionResponse": ".chatcompletionresponse", "ChatCompletionResponseTypedDict": ".chatcompletionresponse", @@ -283,9 +368,13 @@ "ChatCompletionStreamRequestMessageTypedDict": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestStop": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestStopTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestTool": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestToolChoice": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestToolChoiceTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestToolTypedDict": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestTypedDict": ".chatcompletionstreamrequest", + "CodeInterpreterTool": ".codeinterpretertool", + "CodeInterpreterToolTypedDict": ".codeinterpretertool", "CompletionChunk": ".completionchunk", "CompletionChunkTypedDict": ".completionchunk", "CompletionEvent": ".completionevent", @@ -296,10 +385,16 @@ "ContentChunk": ".contentchunk", "ContentChunkTypedDict": ".contentchunk", "UnknownContentChunk": ".contentchunk", + "Authorization": ".customconnector", + "AuthorizationTypedDict": ".customconnector", + "CustomConnector": ".customconnector", + "CustomConnectorTypedDict": ".customconnector", "DeltaMessage": ".deltamessage", "DeltaMessageContent": ".deltamessage", "DeltaMessageContentTypedDict": ".deltamessage", "DeltaMessageTypedDict": ".deltamessage", + "DocumentLibraryTool": ".documentlibrarytool", + "DocumentLibraryToolTypedDict": ".documentlibrarytool", "FIMCompletionRequest": ".fimcompletionrequest", "FIMCompletionRequestStop": ".fimcompletionrequest", "FIMCompletionRequestStopTypedDict": ".fimcompletionrequest", @@ -318,7 +413,11 @@ "FunctionCallTypedDict": ".functioncall", "FunctionName": ".functionname", "FunctionNameTypedDict": ".functionname", + "GuardrailConfig": ".guardrailconfig", + "GuardrailConfigTypedDict": ".guardrailconfig", "ImageDetail": ".imagedetail", + "ImageGenerationTool": ".imagegenerationtool", + "ImageGenerationToolTypedDict": ".imagegenerationtool", "ImageURL": ".imageurl", "ImageURLTypedDict": ".imageurl", "ImageURLChunk": ".imageurlchunk", @@ -328,10 +427,24 @@ "JSONSchema": ".jsonschema", "JSONSchemaTypedDict": ".jsonschema", "MistralPromptMode": ".mistralpromptmode", + "ModerationLLMAction": ".moderationllmaction", + "ModerationLlmv1CategoryThresholds": ".moderationllmv1categorythresholds", + "ModerationLlmv1CategoryThresholdsTypedDict": ".moderationllmv1categorythresholds", + "ModerationLlmv1Config": ".moderationllmv1config", + "ModerationLlmv1ConfigTypedDict": ".moderationllmv1config", + "ModerationLlmv2CategoryThresholds": ".moderationllmv2categorythresholds", + "ModerationLlmv2CategoryThresholdsTypedDict": ".moderationllmv2categorythresholds", + "ModerationLlmv2Config": ".moderationllmv2config", + "ModerationLlmv2ConfigTypedDict": ".moderationllmv2config", + "OAuth2TokenAuth": ".oauth2tokenauth", + "OAuth2TokenAuthTypedDict": ".oauth2tokenauth", "Prediction": ".prediction", "PredictionTypedDict": ".prediction", + "ReasoningEffort": ".reasoningeffort", "ReferenceChunk": ".referencechunk", "ReferenceChunkTypedDict": ".referencechunk", + "ReferenceID": ".referencechunk", + "ReferenceIDTypedDict": ".referencechunk", "ResponseFormat": ".responseformat", "ResponseFormatTypedDict": ".responseformat", "ResponseFormats": ".responseformats", @@ -356,15 +469,16 @@ "ToolChoice": ".toolchoice", "ToolChoiceTypedDict": ".toolchoice", "ToolChoiceEnum": ".toolchoiceenum", + "ToolConfiguration": ".toolconfiguration", + "ToolConfigurationTypedDict": ".toolconfiguration", "ToolMessage": ".toolmessage", "ToolMessageContent": ".toolmessage", "ToolMessageContentTypedDict": ".toolmessage", "ToolMessageTypedDict": ".toolmessage", "ToolReferenceChunk": ".toolreferencechunk", + "ToolReferenceChunkTool": ".toolreferencechunk", + "ToolReferenceChunkToolTypedDict": ".toolreferencechunk", "ToolReferenceChunkTypedDict": ".toolreferencechunk", - "ToolUnion": ".toolreferencechunk", - "ToolUnionTypedDict": ".toolreferencechunk", - "ToolTypes": ".tooltypes", "UsageInfo": ".usageinfo", "UsageInfoTypedDict": ".usageinfo", "UserMessage": ".usermessage", @@ -377,6 +491,10 @@ "LocTypedDict": ".validationerror", "ValidationError": ".validationerror", "ValidationErrorTypedDict": ".validationerror", + "WebSearchPremiumTool": ".websearchpremiumtool", + "WebSearchPremiumToolTypedDict": ".websearchpremiumtool", + "WebSearchTool": ".websearchtool", + "WebSearchToolTypedDict": ".websearchtool", } diff --git a/packages/gcp/src/mistralai/gcp/client/models/apikeyauth.py b/packages/gcp/src/mistralai/gcp/client/models/apikeyauth.py new file mode 100644 index 00000000..99d2ad79 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/apikeyauth.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 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/packages/gcp/src/mistralai/gcp/client/models/assistantmessage.py b/packages/gcp/src/mistralai/gcp/client/models/assistantmessage.py index 702ac470..63f3b0dd 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/assistantmessage.py +++ b/packages/gcp/src/mistralai/gcp/client/models/assistantmessage.py @@ -60,7 +60,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/gcp/src/mistralai/gcp/client/models/chatcompletionchoice.py b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionchoice.py index ae5a2fbf..89f4868b 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/chatcompletionchoice.py +++ b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionchoice.py @@ -2,9 +2,11 @@ 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 +from .deltamessage import DeltaMessage, DeltaMessageTypedDict +from mistralai.gcp.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[ @@ -21,13 +23,32 @@ class ChatCompletionChoiceTypedDict(TypedDict): index: int - message: AssistantMessageTypedDict finish_reason: ChatCompletionChoiceFinishReason + message: NotRequired[AssistantMessageTypedDict] + messages: NotRequired[List[DeltaMessageTypedDict]] class ChatCompletionChoice(BaseModel): index: int - message: AssistantMessage - 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/packages/gcp/src/mistralai/gcp/client/models/chatcompletionrequest.py b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionrequest.py index 8229c5bb..0e3de413 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/chatcompletionrequest.py +++ b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionrequest.py @@ -2,8 +2,14 @@ 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 @@ -11,6 +17,8 @@ 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.gcp.client.types import ( BaseModel, Nullable, @@ -58,6 +66,31 @@ ] +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], @@ -78,26 +111,26 @@ class ChatCompletionRequestTypedDict(TypedDict): 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] + 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[ChatCompletionRequestStopTypedDict] + 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[ToolTypedDict]]] + 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[float] + 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[float] + 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.""" @@ -105,8 +138,10 @@ class ChatCompletionRequestTypedDict(TypedDict): 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]]] class ChatCompletionRequest(BaseModel): @@ -119,7 +154,7 @@ class ChatCompletionRequest(BaseModel): 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 + 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 @@ -128,7 +163,7 @@ class ChatCompletionRequest(BaseModel): 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 + 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 @@ -139,16 +174,16 @@ class ChatCompletionRequest(BaseModel): 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 + 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: Optional[float] = 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: Optional[float] = None + 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 @@ -160,9 +195,13 @@ class ChatCompletionRequest(BaseModel): 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 + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -182,18 +221,26 @@ def serialize_model(self, handler): "n", "prediction", "parallel_tool_calls", + "reasoning_effort", "prompt_mode", + "guardrails", ] ) nullable_fields = set( [ "temperature", + "top_p", "max_tokens", + "stop", "random_seed", "metadata", "tools", + "presence_penalty", + "frequency_penalty", "n", + "reasoning_effort", "prompt_mode", + "guardrails", ] ) serialized = handler(self) @@ -201,7 +248,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/gcp/src/mistralai/gcp/client/models/chatcompletionstreamrequest.py b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionstreamrequest.py index 3c228d2e..2adc7812 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/chatcompletionstreamrequest.py +++ b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionstreamrequest.py @@ -2,8 +2,14 @@ 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 @@ -11,6 +17,8 @@ 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.gcp.client.types import ( BaseModel, Nullable, @@ -58,6 +66,31 @@ ] +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], @@ -78,25 +111,25 @@ class ChatCompletionStreamRequestTypedDict(TypedDict): 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] + 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[ChatCompletionStreamRequestStopTypedDict] + 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[ToolTypedDict]]] + 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[float] + 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[float] + 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.""" @@ -104,8 +137,10 @@ class ChatCompletionStreamRequestTypedDict(TypedDict): 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]]] class ChatCompletionStreamRequest(BaseModel): @@ -118,7 +153,7 @@ class ChatCompletionStreamRequest(BaseModel): 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 + 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 @@ -126,7 +161,7 @@ class ChatCompletionStreamRequest(BaseModel): stream: Optional[bool] = True - stop: Optional[ChatCompletionStreamRequestStop] = None + 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 @@ -137,16 +172,16 @@ class ChatCompletionStreamRequest(BaseModel): 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 + 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: Optional[float] = 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: Optional[float] = None + 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 @@ -158,9 +193,13 @@ class ChatCompletionStreamRequest(BaseModel): 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 + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -180,18 +219,26 @@ def serialize_model(self, handler): "n", "prediction", "parallel_tool_calls", + "reasoning_effort", "prompt_mode", + "guardrails", ] ) nullable_fields = set( [ "temperature", + "top_p", "max_tokens", + "stop", "random_seed", "metadata", "tools", + "presence_penalty", + "frequency_penalty", "n", + "reasoning_effort", "prompt_mode", + "guardrails", ] ) serialized = handler(self) @@ -199,7 +246,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/gcp/src/mistralai/gcp/client/models/codeinterpretertool.py b/packages/gcp/src/mistralai/gcp/client/models/codeinterpretertool.py new file mode 100644 index 00000000..9fdedce7 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/codeinterpretertool.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +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 +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/packages/gcp/src/mistralai/gcp/client/models/completionchunk.py b/packages/gcp/src/mistralai/gcp/client/models/completionchunk.py index a0b1ae2f..3f8d8c6b 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/completionchunk.py +++ b/packages/gcp/src/mistralai/gcp/client/models/completionchunk.py @@ -42,7 +42,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/gcp/src/mistralai/gcp/client/models/completionresponsestreamchoice.py b/packages/gcp/src/mistralai/gcp/client/models/completionresponsestreamchoice.py index e58d4c88..0f189b55 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/completionresponsestreamchoice.py +++ b/packages/gcp/src/mistralai/gcp/client/models/completionresponsestreamchoice.py @@ -44,7 +44,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: m[k] = val diff --git a/packages/gcp/src/mistralai/gcp/client/models/customconnector.py b/packages/gcp/src/mistralai/gcp/client/models/customconnector.py new file mode 100644 index 00000000..38299726 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/customconnector.py @@ -0,0 +1,80 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .apikeyauth import APIKeyAuth, APIKeyAuthTypedDict +from .oauth2tokenauth import OAuth2TokenAuth, OAuth2TokenAuthTypedDict +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +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 Field, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +AuthorizationTypedDict = TypeAliasType( + "AuthorizationTypedDict", Union[OAuth2TokenAuthTypedDict, APIKeyAuthTypedDict] +) + + +Authorization = Annotated[ + Union[APIKeyAuth, OAuth2TokenAuth], Field(discriminator="type") +] + + +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/packages/gcp/src/mistralai/gcp/client/models/deltamessage.py b/packages/gcp/src/mistralai/gcp/client/models/deltamessage.py index 63e6a7f3..1943aec7 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/deltamessage.py +++ b/packages/gcp/src/mistralai/gcp/client/models/deltamessage.py @@ -11,7 +11,7 @@ UNSET_SENTINEL, ) from pydantic import model_serializer -from typing import List, Union +from typing import Any, Dict, List, Union from typing_extensions import NotRequired, TypeAliasType, TypedDict @@ -29,6 +29,10 @@ 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): @@ -38,16 +42,27 @@ class DeltaMessage(BaseModel): 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"]) - nullable_fields = set(["role", "content", "tool_calls"]) + 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) + 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 diff --git a/packages/gcp/src/mistralai/gcp/client/models/documentlibrarytool.py b/packages/gcp/src/mistralai/gcp/client/models/documentlibrarytool.py new file mode 100644 index 00000000..36fb81e5 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/documentlibrarytool.py @@ -0,0 +1,70 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +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 +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/packages/gcp/src/mistralai/gcp/client/models/fimcompletionrequest.py b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionrequest.py index e460f76c..5b6013f6 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/fimcompletionrequest.py +++ b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionrequest.py @@ -32,13 +32,13 @@ class FIMCompletionRequestTypedDict(TypedDict): 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] + 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[FIMCompletionRequestStopTypedDict] + 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.""" @@ -59,7 +59,7 @@ class FIMCompletionRequest(BaseModel): 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 + 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 @@ -68,7 +68,7 @@ class FIMCompletionRequest(BaseModel): 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 + 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 @@ -100,7 +100,9 @@ def serialize_model(self, handler): nullable_fields = set( [ "temperature", + "top_p", "max_tokens", + "stop", "random_seed", "metadata", "suffix", @@ -112,7 +114,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/gcp/src/mistralai/gcp/client/models/fimcompletionstreamrequest.py b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionstreamrequest.py index fffc3054..d2e86d40 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/fimcompletionstreamrequest.py +++ b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionstreamrequest.py @@ -32,12 +32,12 @@ class FIMCompletionStreamRequestTypedDict(TypedDict): 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] + 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[FIMCompletionStreamRequestStopTypedDict] + 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.""" @@ -58,7 +58,7 @@ class FIMCompletionStreamRequest(BaseModel): 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 + 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 @@ -66,7 +66,7 @@ class FIMCompletionStreamRequest(BaseModel): stream: Optional[bool] = True - stop: Optional[FIMCompletionStreamRequestStop] = None + 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 @@ -98,7 +98,9 @@ def serialize_model(self, handler): nullable_fields = set( [ "temperature", + "top_p", "max_tokens", + "stop", "random_seed", "metadata", "suffix", @@ -110,7 +112,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/gcp/src/mistralai/gcp/client/models/function.py b/packages/gcp/src/mistralai/gcp/client/models/function.py index 439e8313..877b7273 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/function.py +++ b/packages/gcp/src/mistralai/gcp/client/models/function.py @@ -31,7 +31,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/gcp/src/mistralai/gcp/client/models/guardrailconfig.py b/packages/gcp/src/mistralai/gcp/client/models/guardrailconfig.py new file mode 100644 index 00000000..abc5deca --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/guardrailconfig.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .moderationllmv1config import ModerationLlmv1Config, ModerationLlmv1ConfigTypedDict +from .moderationllmv2config import ModerationLlmv2Config, ModerationLlmv2ConfigTypedDict +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 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/packages/gcp/src/mistralai/gcp/client/models/imagegenerationtool.py b/packages/gcp/src/mistralai/gcp/client/models/imagegenerationtool.py new file mode 100644 index 00000000..e6b28920 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/imagegenerationtool.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +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 +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/packages/gcp/src/mistralai/gcp/client/models/imageurl.py b/packages/gcp/src/mistralai/gcp/client/models/imageurl.py index 903d0a1a..99e55598 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/imageurl.py +++ b/packages/gcp/src/mistralai/gcp/client/models/imageurl.py @@ -32,7 +32,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/gcp/src/mistralai/gcp/client/models/imageurlchunk.py b/packages/gcp/src/mistralai/gcp/client/models/imageurlchunk.py index 4bec0eec..e939c34b 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/imageurlchunk.py +++ b/packages/gcp/src/mistralai/gcp/client/models/imageurlchunk.py @@ -19,14 +19,14 @@ class ImageURLChunkTypedDict(TypedDict): - r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" + 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\":{\"url\":\"data:image/png;base64,iVBORw0""" + r"""{\"type\":\"image_url\",\"image_url\":\"data:image/png;base64,iVBORw0\"}""" image_url: ImageURLUnion diff --git a/packages/gcp/src/mistralai/gcp/client/models/jsonschema.py b/packages/gcp/src/mistralai/gcp/client/models/jsonschema.py index 684ac09f..f500fa56 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/jsonschema.py +++ b/packages/gcp/src/mistralai/gcp/client/models/jsonschema.py @@ -39,7 +39,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/gcp/src/mistralai/gcp/client/models/moderationllmaction.py b/packages/gcp/src/mistralai/gcp/client/models/moderationllmaction.py new file mode 100644 index 00000000..cff03d9a --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/moderationllmaction.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing import Literal + + +ModerationLLMAction = Literal[ + "none", + "block", +] diff --git a/packages/gcp/src/mistralai/gcp/client/models/moderationllmv1categorythresholds.py b/packages/gcp/src/mistralai/gcp/client/models/moderationllmv1categorythresholds.py new file mode 100644 index 00000000..3f5713fe --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/moderationllmv1categorythresholds.py @@ -0,0 +1,93 @@ +"""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_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/packages/gcp/src/mistralai/gcp/client/models/moderationllmv1config.py b/packages/gcp/src/mistralai/gcp/client/models/moderationllmv1config.py new file mode 100644 index 00000000..579acd73 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/moderationllmv1config.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .moderationllmaction import ModerationLLMAction +from .moderationllmv1categorythresholds import ( + ModerationLlmv1CategoryThresholds, + ModerationLlmv1CategoryThresholdsTypedDict, +) +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 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/packages/gcp/src/mistralai/gcp/client/models/moderationllmv2categorythresholds.py b/packages/gcp/src/mistralai/gcp/client/models/moderationllmv2categorythresholds.py new file mode 100644 index 00000000..8b925260 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/moderationllmv2categorythresholds.py @@ -0,0 +1,103 @@ +"""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_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/packages/gcp/src/mistralai/gcp/client/models/moderationllmv2config.py b/packages/gcp/src/mistralai/gcp/client/models/moderationllmv2config.py new file mode 100644 index 00000000..000d2e2c --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/moderationllmv2config.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .moderationllmaction import ModerationLLMAction +from .moderationllmv2categorythresholds import ( + ModerationLlmv2CategoryThresholds, + ModerationLlmv2CategoryThresholdsTypedDict, +) +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 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/packages/gcp/src/mistralai/gcp/client/models/oauth2tokenauth.py b/packages/gcp/src/mistralai/gcp/client/models/oauth2tokenauth.py new file mode 100644 index 00000000..d1b4c935 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/oauth2tokenauth.py @@ -0,0 +1,31 @@ +"""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 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/packages/gcp/src/mistralai/gcp/client/models/prediction.py b/packages/gcp/src/mistralai/gcp/client/models/prediction.py index 2e325289..1e290f33 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/prediction.py +++ b/packages/gcp/src/mistralai/gcp/client/models/prediction.py @@ -37,7 +37,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/gcp/src/mistralai/gcp/client/models/reasoningeffort.py b/packages/gcp/src/mistralai/gcp/client/models/reasoningeffort.py new file mode 100644 index 00000000..43ffa02b --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/reasoningeffort.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing import Literal + + +ReasoningEffort = Literal[ + "none", + "high", +] diff --git a/packages/gcp/src/mistralai/gcp/client/models/referencechunk.py b/packages/gcp/src/mistralai/gcp/client/models/referencechunk.py index 261c4755..eca4c4de 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/referencechunk.py +++ b/packages/gcp/src/mistralai/gcp/client/models/referencechunk.py @@ -6,17 +6,23 @@ 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 +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[int] + reference_ids: List[ReferenceIDTypedDict] type: Literal["reference"] class ReferenceChunk(BaseModel): - reference_ids: List[int] + reference_ids: List[ReferenceID] type: Annotated[ Annotated[ @@ -33,7 +39,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/gcp/src/mistralai/gcp/client/models/responseformat.py b/packages/gcp/src/mistralai/gcp/client/models/responseformat.py index f3aa9930..afd1bd30 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/responseformat.py +++ b/packages/gcp/src/mistralai/gcp/client/models/responseformat.py @@ -38,7 +38,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/gcp/src/mistralai/gcp/client/models/thinkchunk.py b/packages/gcp/src/mistralai/gcp/client/models/thinkchunk.py index d534fc1e..34397d30 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/thinkchunk.py +++ b/packages/gcp/src/mistralai/gcp/client/models/thinkchunk.py @@ -4,7 +4,13 @@ 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.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) from mistralai.gcp.client.utils import validate_const import pydantic from pydantic import model_serializer @@ -27,6 +33,8 @@ 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.""" @@ -39,21 +47,33 @@ class ThinkChunk(BaseModel): 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(["closed"]) + optional_fields = set(["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) + 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: + 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/tool.py b/packages/gcp/src/mistralai/gcp/client/models/tool.py index 670aa81f..e95b3036 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/tool.py +++ b/packages/gcp/src/mistralai/gcp/client/models/tool.py @@ -2,35 +2,32 @@ 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 +from mistralai.gcp.client.types import BaseModel, UnrecognizedStr +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, TypedDict class ToolTypedDict(TypedDict): function: FunctionTypedDict - type: NotRequired[ToolTypes] + type: Union[Literal["function"], UnrecognizedStr] class Tool(BaseModel): function: Function - type: Optional[ToolTypes] = None + type: Annotated[ + Annotated[ + Union[Literal["function"], UnrecognizedStr], + AfterValidator(validate_const("function")), + ], + pydantic.Field(alias="type"), + ] = "function" - @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: + Tool.model_rebuild() +except NameError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/toolcall.py b/packages/gcp/src/mistralai/gcp/client/models/toolcall.py index 3ea8e283..4e4c2581 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/toolcall.py +++ b/packages/gcp/src/mistralai/gcp/client/models/toolcall.py @@ -2,7 +2,6 @@ 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 @@ -12,7 +11,7 @@ class ToolCallTypedDict(TypedDict): function: FunctionCallTypedDict id: NotRequired[str] - type: NotRequired[ToolTypes] + type: NotRequired[str] index: NotRequired[int] @@ -21,7 +20,7 @@ class ToolCall(BaseModel): id: Optional[str] = "null" - type: Optional[ToolTypes] = None + type: Optional[str] = None index: Optional[int] = 0 @@ -33,7 +32,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/gcp/src/mistralai/gcp/client/models/toolchoice.py b/packages/gcp/src/mistralai/gcp/client/models/toolchoice.py index 6e795fd7..528cc801 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/toolchoice.py +++ b/packages/gcp/src/mistralai/gcp/client/models/toolchoice.py @@ -2,7 +2,6 @@ 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 @@ -14,7 +13,7 @@ class ToolChoiceTypedDict(TypedDict): function: FunctionNameTypedDict r"""this restriction of `Function` is used to select a specific function to call""" - type: NotRequired[ToolTypes] + type: NotRequired[str] class ToolChoice(BaseModel): @@ -23,7 +22,7 @@ class ToolChoice(BaseModel): function: FunctionName r"""this restriction of `Function` is used to select a specific function to call""" - type: Optional[ToolTypes] = None + type: Optional[str] = None @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -33,7 +32,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/gcp/src/mistralai/gcp/client/models/toolconfiguration.py b/packages/gcp/src/mistralai/gcp/client/models/toolconfiguration.py new file mode 100644 index 00000000..724ed8c6 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/toolconfiguration.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, + 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/packages/gcp/src/mistralai/gcp/client/models/toolmessage.py b/packages/gcp/src/mistralai/gcp/client/models/toolmessage.py index ce160391..a5a9645d 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/toolmessage.py +++ b/packages/gcp/src/mistralai/gcp/client/models/toolmessage.py @@ -53,7 +53,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/gcp/src/mistralai/gcp/client/models/toolreferencechunk.py b/packages/gcp/src/mistralai/gcp/client/models/toolreferencechunk.py index 0a2a7fa3..eb2b80e4 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/toolreferencechunk.py +++ b/packages/gcp/src/mistralai/gcp/client/models/toolreferencechunk.py @@ -17,14 +17,18 @@ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -ToolUnionTypedDict = TypeAliasType("ToolUnionTypedDict", Union[BuiltInConnectors, str]) +ToolReferenceChunkToolTypedDict = TypeAliasType( + "ToolReferenceChunkToolTypedDict", Union[BuiltInConnectors, str] +) -ToolUnion = TypeAliasType("ToolUnion", Union[BuiltInConnectors, str]) +ToolReferenceChunkTool = TypeAliasType( + "ToolReferenceChunkTool", Union[BuiltInConnectors, str] +) class ToolReferenceChunkTypedDict(TypedDict): - tool: ToolUnionTypedDict + tool: ToolReferenceChunkToolTypedDict title: str type: Literal["tool_reference"] url: NotRequired[Nullable[str]] @@ -33,7 +37,7 @@ class ToolReferenceChunkTypedDict(TypedDict): class ToolReferenceChunk(BaseModel): - tool: ToolUnion + tool: ToolReferenceChunkTool title: str @@ -60,7 +64,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + 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 diff --git a/packages/gcp/src/mistralai/gcp/client/models/tooltypes.py b/packages/gcp/src/mistralai/gcp/client/models/tooltypes.py deleted file mode 100644 index fd1aa13d..00000000 --- a/packages/gcp/src/mistralai/gcp/client/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.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 index cb6feb6e..df40efab 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/usageinfo.py +++ b/packages/gcp/src/mistralai/gcp/client/models/usageinfo.py @@ -59,8 +59,8 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) + 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 diff --git a/packages/gcp/src/mistralai/gcp/client/models/usermessage.py b/packages/gcp/src/mistralai/gcp/client/models/usermessage.py index e237e900..8199f293 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/usermessage.py +++ b/packages/gcp/src/mistralai/gcp/client/models/usermessage.py @@ -39,7 +39,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: m[k] = val diff --git a/packages/gcp/src/mistralai/gcp/client/models/validationerror.py b/packages/gcp/src/mistralai/gcp/client/models/validationerror.py index 3ff872c1..653b63e9 100644 --- a/packages/gcp/src/mistralai/gcp/client/models/validationerror.py +++ b/packages/gcp/src/mistralai/gcp/client/models/validationerror.py @@ -48,7 +48,7 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n - val = serialized.get(k) + val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: diff --git a/packages/gcp/src/mistralai/gcp/client/models/websearchpremiumtool.py b/packages/gcp/src/mistralai/gcp/client/models/websearchpremiumtool.py new file mode 100644 index 00000000..e416f964 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/websearchpremiumtool.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +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 +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/packages/gcp/src/mistralai/gcp/client/models/websearchtool.py b/packages/gcp/src/mistralai/gcp/client/models/websearchtool.py new file mode 100644 index 00000000..69d6e043 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/websearchtool.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +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 +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/packages/gcp/src/mistralai/gcp/client/utils/eventstreaming.py b/packages/gcp/src/mistralai/gcp/client/utils/eventstreaming.py index f2052fc2..3bdcd6d3 100644 --- a/packages/gcp/src/mistralai/gcp/client/utils/eventstreaming.py +++ b/packages/gcp/src/mistralai/gcp/client/utils/eventstreaming.py @@ -32,9 +32,12 @@ def __init__( 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) + self.generator = stream_events( + response, decoder, sentinel, data_required=data_required + ) self.client_ref = client_ref self._closed = False @@ -68,9 +71,12 @@ def __init__( 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) + self.generator = stream_events_async( + response, decoder, sentinel, data_required=data_required + ) self.client_ref = client_ref self._closed = False @@ -116,6 +122,7 @@ 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 @@ -138,7 +145,11 @@ async def stream_events_async( block = buffer[position:i] position = i + len(seq) event, discard, event_id = _parse_event( - raw=block, decoder=decoder, sentinel=sentinel, event_id=event_id + raw=block, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, ) if event is not None: yield event @@ -151,7 +162,11 @@ async def stream_events_async( position = 0 event, discard, _ = _parse_event( - raw=buffer, decoder=decoder, sentinel=sentinel, event_id=event_id + raw=buffer, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, ) if event is not None: yield event @@ -161,6 +176,7 @@ 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 @@ -183,7 +199,11 @@ def stream_events( block = buffer[position:i] position = i + len(seq) event, discard, event_id = _parse_event( - raw=block, decoder=decoder, sentinel=sentinel, event_id=event_id + raw=block, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, ) if event is not None: yield event @@ -196,7 +216,11 @@ def stream_events( position = 0 event, discard, _ = _parse_event( - raw=buffer, decoder=decoder, sentinel=sentinel, event_id=event_id + raw=buffer, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, ) if event is not None: yield event @@ -208,6 +232,7 @@ def _parse_event( 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) @@ -250,6 +275,10 @@ def _parse_event( 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: diff --git a/packages/gcp/src/mistralai/gcp/client/utils/metadata.py b/packages/gcp/src/mistralai/gcp/client/utils/metadata.py index 173b3e5c..5abddd58 100644 --- a/packages/gcp/src/mistralai/gcp/client/utils/metadata.py +++ b/packages/gcp/src/mistralai/gcp/client/utils/metadata.py @@ -15,6 +15,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/packages/gcp/src/mistralai/gcp/client/utils/security.py b/packages/gcp/src/mistralai/gcp/client/utils/security.py index 17996bd5..42d8d78e 100644 --- a/packages/gcp/src/mistralai/gcp/client/utils/security.py +++ b/packages/gcp/src/mistralai/gcp/client/utils/security.py @@ -5,6 +5,7 @@ Any, Dict, List, + Optional, Tuple, ) from pydantic import BaseModel @@ -16,7 +17,9 @@ ) -def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: +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]] = {} @@ -27,7 +30,14 @@ def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: raise TypeError("security must be a pydantic model") sec_fields: Dict[str, FieldInfo] = security.__class__.model_fields - for name in sec_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) @@ -49,6 +59,9 @@ def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: else: _parse_security_scheme(headers, query_params, metadata, name, value) + if not metadata.composite: + return headers, query_params + return headers, query_params @@ -59,15 +72,24 @@ def _parse_security_option( 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) - ) + + 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( diff --git a/packages/gcp/src/mistralai/gcp/client/utils/serializers.py b/packages/gcp/src/mistralai/gcp/client/utils/serializers.py index 14321eb4..d2149f8b 100644 --- a/packages/gcp/src/mistralai/gcp/client/utils/serializers.py +++ b/packages/gcp/src/mistralai/gcp/client/utils/serializers.py @@ -17,8 +17,7 @@ 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: + if d is None: return None if isinstance(d, Unset): return d @@ -46,8 +45,7 @@ def validate_decimal(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: + if f is None: return None if isinstance(f, Unset): return f @@ -75,8 +73,7 @@ def validate_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: + if i is None: return None if isinstance(i, Unset): return i @@ -104,8 +101,7 @@ def validate_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: + if c is None: return None if v != c: diff --git a/packages/gcp/uv.lock b/packages/gcp/uv.lock index 3fca8e89..89b92c92 100644 --- a/packages/gcp/uv.lock +++ b/packages/gcp/uv.lock @@ -7,6 +7,10 @@ resolution-markers = [ "python_full_version < '3.11'", ] +[options] +exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for backwards compatibility when using relative exclude-newer values. +exclude-newer-span = "P7D" + [[package]] name = "annotated-types" version = "0.7.0" @@ -277,7 +281,7 @@ wheels = [ [[package]] name = "mistralai-gcp" -version = "2.0.0" +version = "2.1.0" source = { editable = "." } dependencies = [ { name = "eval-type-backport" }, diff --git a/pyproject.toml b/pyproject.toml index f79b279f..be262286 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mistralai" -version = "2.4.5" +version = "2.4.7" description = "Python Client SDK for the Mistral AI API." authors = [{ name = "Mistral" }] requires-python = ">=3.10" @@ -32,6 +32,7 @@ realtime = [ workflow_payload_offloading_azure = [ "azure-storage-blob[aio]>=12.28.0,<13.0.0", + "azure-identity[aio]>=1.25.0,<2.0.0", ] workflow_payload_offloading_gcs = [ "gcloud-aio-storage>=9.3.0,<10.0.0", @@ -77,6 +78,7 @@ lint = [ ] [tool.uv] +exclude-newer = "7 days" default-groups = [ "dev", "lint", diff --git a/src/mistralai/client/_version.py b/src/mistralai/client/_version.py index 9f9ae8c6..1a977e80 100644 --- a/src/mistralai/client/_version.py +++ b/src/mistralai/client/_version.py @@ -4,10 +4,10 @@ import importlib.metadata __title__: str = "mistralai" -__version__: str = "2.4.5" +__version__: str = "2.4.7" __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" +__gen_version__: str = "2.884.13" +__user_agent__: str = "speakeasy-sdk/python 2.4.7 2.884.13 1.0.0 mistralai" try: if __package__ is not None: diff --git a/src/mistralai/client/accesses.py b/src/mistralai/client/accesses.py index 5d859a39..90aef2e7 100644 --- a/src/mistralai/client/accesses.py +++ b/src/mistralai/client/accesses.py @@ -85,7 +85,7 @@ def list( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -178,7 +178,7 @@ async def list_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -288,7 +288,7 @@ def update_or_create( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -398,7 +398,7 @@ async def update_or_create_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -433,7 +433,7 @@ def delete( ) -> 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. + Given a library id, you can delete the access level of an entity. An owner cannot delete their own access. You have to be the owner of the library to delete an access other than yours. Warning: the response will change from 200 (returning the deleted sharing) to 204 No Content in a future version. :param library_id: :param share_with_uuid: The id of the entity (user, workspace or organization) to share with @@ -505,7 +505,7 @@ def delete( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -540,7 +540,7 @@ async def delete_async( ) -> 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. + Given a library id, you can delete the access level of an entity. An owner cannot delete their own access. You have to be the owner of the library to delete an access other than yours. Warning: the response will change from 200 (returning the deleted sharing) to 204 No Content in a future version. :param library_id: :param share_with_uuid: The id of the entity (user, workspace or organization) to share with @@ -612,7 +612,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/agents.py b/src/mistralai/client/agents.py index 1bcd8c54..86c31b3e 100644 --- a/src/mistralai/client/agents.py +++ b/src/mistralai/client/agents.py @@ -176,7 +176,7 @@ def complete( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -360,7 +360,7 @@ async def complete_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -546,7 +546,7 @@ def stream( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -740,7 +740,7 @@ async def stream_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) diff --git a/src/mistralai/client/basesdk.py b/src/mistralai/client/basesdk.py index 4a27eb2f..b305e63e 100644 --- a/src/mistralai/client/basesdk.py +++ b/src/mistralai/client/basesdk.py @@ -8,6 +8,7 @@ AfterErrorContext, AfterSuccessContext, BeforeRequestContext, + HookContext, ) from mistralai.client.utils import ( RetryConfig, @@ -238,10 +239,10 @@ def _build_request_with_client( def do_request( self, - hook_ctx, - request, - error_status_codes, - stream=False, + hook_ctx: HookContext, + request: httpx.Request, + is_error_status_code: Callable[[int], bool], + stream: bool = False, retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, ) -> httpx.Response: client = self.sdk_configuration.client @@ -285,19 +286,6 @@ def do(): "" 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: @@ -305,17 +293,27 @@ def do(): else: http_res = do() - if not utils.match_status_codes(error_status_codes, http_res.status_code): + if is_error_status_code(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) + else: 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, + hook_ctx: HookContext, + request: httpx.Request, + is_error_status_code: Callable[[int], bool], + stream: bool = False, retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, ) -> httpx.Response: client = self.sdk_configuration.async_client @@ -365,20 +363,6 @@ async def do(): "" 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: @@ -388,7 +372,20 @@ async def do(): else: http_res = await do() - if not utils.match_status_codes(error_status_codes, http_res.status_code): + if is_error_status_code(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) + else: http_res = await run_sync_in_thread( hooks.after_success, AfterSuccessContext(hook_ctx), http_res ) diff --git a/src/mistralai/client/batch_jobs.py b/src/mistralai/client/batch_jobs.py index 2bf50fd3..456e285b 100644 --- a/src/mistralai/client/batch_jobs.py +++ b/src/mistralai/client/batch_jobs.py @@ -108,7 +108,7 @@ def list( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -219,7 +219,7 @@ async def list_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -336,7 +336,7 @@ def create( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -453,7 +453,7 @@ async def create_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -546,7 +546,7 @@ def get( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -639,7 +639,7 @@ async def get_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -726,7 +726,7 @@ def delete( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -813,7 +813,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -900,7 +900,7 @@ def cancel( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -987,7 +987,7 @@ async def cancel_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/beta_agents.py b/src/mistralai/client/beta_agents.py index 64baf53b..3c0661b6 100644 --- a/src/mistralai/client/beta_agents.py +++ b/src/mistralai/client/beta_agents.py @@ -130,7 +130,7 @@ def create( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -268,7 +268,7 @@ async def create_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -382,7 +382,7 @@ def list( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -496,7 +496,7 @@ async def list_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -597,7 +597,7 @@ def get( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -698,7 +698,7 @@ async def get_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -848,7 +848,7 @@ def update( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -998,7 +998,7 @@ async def update_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1089,7 +1089,7 @@ def delete( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1180,7 +1180,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1276,7 +1276,7 @@ def update_version( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1372,7 +1372,7 @@ async def update_version_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1471,7 +1471,7 @@ def list_versions( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1570,7 +1570,7 @@ async def list_versions_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1666,7 +1666,7 @@ def get_version( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1762,7 +1762,7 @@ async def get_version_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1861,7 +1861,7 @@ def create_version_alias( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1960,7 +1960,7 @@ async def create_version_alias_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2053,7 +2053,7 @@ def list_version_aliases( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2146,7 +2146,7 @@ async def list_version_aliases_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2242,7 +2242,7 @@ def delete_version_alias( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2338,7 +2338,7 @@ async def delete_version_alias_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/campaigns.py b/src/mistralai/client/campaigns.py index c9f28794..460b0b5a 100644 --- a/src/mistralai/client/campaigns.py +++ b/src/mistralai/client/campaigns.py @@ -96,7 +96,7 @@ def create( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -204,7 +204,7 @@ async def create_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -303,7 +303,7 @@ def list( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -402,7 +402,7 @@ async def list_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -495,7 +495,7 @@ def fetch( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -588,7 +588,7 @@ async def fetch_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -681,7 +681,7 @@ def delete( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -774,7 +774,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -867,7 +867,7 @@ def fetch_status( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -960,7 +960,7 @@ async def fetch_status_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1059,7 +1059,7 @@ def list_events( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1160,7 +1160,7 @@ async def list_events_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/chat.py b/src/mistralai/client/chat.py index 9deff9a0..74a9221a 100644 --- a/src/mistralai/client/chat.py +++ b/src/mistralai/client/chat.py @@ -270,7 +270,7 @@ def complete( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -463,7 +463,7 @@ async def complete_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -658,7 +658,7 @@ def stream( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -861,7 +861,7 @@ async def stream_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) diff --git a/src/mistralai/client/chat_completion_events.py b/src/mistralai/client/chat_completion_events.py index af4124f0..ef737912 100644 --- a/src/mistralai/client/chat_completion_events.py +++ b/src/mistralai/client/chat_completion_events.py @@ -115,7 +115,7 @@ def search( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -230,7 +230,7 @@ async def search_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -335,7 +335,7 @@ def search_ids( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -440,7 +440,7 @@ async def search_ids_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -535,7 +535,7 @@ def fetch( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -628,7 +628,7 @@ async def fetch_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -721,7 +721,7 @@ def fetch_similar_events( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -816,7 +816,7 @@ async def fetch_similar_events_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -927,7 +927,7 @@ def judge( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1036,7 +1036,7 @@ async def judge_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/classifiers.py b/src/mistralai/client/classifiers.py index ddb2d0b1..36329ea6 100644 --- a/src/mistralai/client/classifiers.py +++ b/src/mistralai/client/classifiers.py @@ -95,7 +95,7 @@ def moderate( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -198,7 +198,7 @@ async def moderate_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -300,7 +300,7 @@ def moderate_chat( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -402,7 +402,7 @@ async def moderate_chat_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -505,7 +505,7 @@ def classify( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -608,7 +608,7 @@ async def classify_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -705,7 +705,7 @@ def classify_chat( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -802,7 +802,7 @@ async def classify_chat_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/connectors.py b/src/mistralai/client/connectors.py index 793c9f8a..dc8df3e8 100644 --- a/src/mistralai/client/connectors.py +++ b/src/mistralai/client/connectors.py @@ -116,7 +116,7 @@ def create( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -240,7 +240,7 @@ async def create_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -343,7 +343,7 @@ def list( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -446,7 +446,7 @@ async def list_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -545,7 +545,7 @@ def get_auth_url( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -644,7 +644,7 @@ async def get_auth_url_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -665,6 +665,1296 @@ async def get_auth_url_async( raise errors.SDKError("Unexpected response received", http_res) + def activate_for_organization( + self, + *, + connector_id: str, + requires_confirmation: OptionalNullable[ + Union[models.RequiresConfirmation, models.RequiresConfirmationTypedDict] + ] = UNSET, + skip_confirmation: OptionalNullable[ + Union[models.SkipConfirmation, models.SkipConfirmationTypedDict] + ] = UNSET, + include: OptionalNullable[List[str]] = UNSET, + exclude: 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.MessageResponse: + r"""Activate a connector for an organization. + + Enable a connector at the organization level so all members can use it. + + :param connector_id: + :param requires_confirmation: + :param skip_confirmation: + :param include: + :param exclude: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorActivateForOrganizationV1Request( + connector_id=connector_id, + tool_execution_configuration=models.ToolExecutionConfiguration( + requires_confirmation=utils.get_pydantic_model( + requires_confirmation, OptionalNullable[models.RequiresConfirmation] + ), + skip_confirmation=utils.get_pydantic_model( + skip_confirmation, OptionalNullable[models.SkipConfirmation] + ), + include=include, + exclude=exclude, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/connectors/{connector_id}/organization/activate", + 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.tool_execution_configuration if request is not None else None, + True, + True, + "json", + OptionalNullable[models.ToolExecutionConfiguration], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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_activate_for_organization_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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 activate_for_organization_async( + self, + *, + connector_id: str, + requires_confirmation: OptionalNullable[ + Union[models.RequiresConfirmation, models.RequiresConfirmationTypedDict] + ] = UNSET, + skip_confirmation: OptionalNullable[ + Union[models.SkipConfirmation, models.SkipConfirmationTypedDict] + ] = UNSET, + include: OptionalNullable[List[str]] = UNSET, + exclude: 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.MessageResponse: + r"""Activate a connector for an organization. + + Enable a connector at the organization level so all members can use it. + + :param connector_id: + :param requires_confirmation: + :param skip_confirmation: + :param include: + :param exclude: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorActivateForOrganizationV1Request( + connector_id=connector_id, + tool_execution_configuration=models.ToolExecutionConfiguration( + requires_confirmation=utils.get_pydantic_model( + requires_confirmation, OptionalNullable[models.RequiresConfirmation] + ), + skip_confirmation=utils.get_pydantic_model( + skip_confirmation, OptionalNullable[models.SkipConfirmation] + ), + include=include, + exclude=exclude, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/connectors/{connector_id}/organization/activate", + 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.tool_execution_configuration if request is not None else None, + True, + True, + "json", + OptionalNullable[models.ToolExecutionConfiguration], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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_activate_for_organization_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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 deactivate_for_organization( + 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"""Deactivate a connector for an organization. + + Disable a connector at the organization level. + + :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.ConnectorDeactivateForOrganizationV1Request( + connector_id=connector_id, + ) + + req = self._build_request( + method="POST", + path="/v1/connectors/{connector_id}/organization/deactivate", + 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_deactivate_for_organization_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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 deactivate_for_organization_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"""Deactivate a connector for an organization. + + Disable a connector at the organization level. + + :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.ConnectorDeactivateForOrganizationV1Request( + connector_id=connector_id, + ) + + req = self._build_request_async( + method="POST", + path="/v1/connectors/{connector_id}/organization/deactivate", + 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_deactivate_for_organization_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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 activate_for_workspace( + self, + *, + connector_id: str, + requires_confirmation: OptionalNullable[ + Union[models.RequiresConfirmation, models.RequiresConfirmationTypedDict] + ] = UNSET, + skip_confirmation: OptionalNullable[ + Union[models.SkipConfirmation, models.SkipConfirmationTypedDict] + ] = UNSET, + include: OptionalNullable[List[str]] = UNSET, + exclude: 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.MessageResponse: + r"""Activate a connector for a workspace. + + Enable a connector at the workspace level so all members of the workspace can use it. + + :param connector_id: + :param requires_confirmation: + :param skip_confirmation: + :param include: + :param exclude: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorActivateForWorkspaceV1Request( + connector_id=connector_id, + tool_execution_configuration=models.ToolExecutionConfiguration( + requires_confirmation=utils.get_pydantic_model( + requires_confirmation, OptionalNullable[models.RequiresConfirmation] + ), + skip_confirmation=utils.get_pydantic_model( + skip_confirmation, OptionalNullable[models.SkipConfirmation] + ), + include=include, + exclude=exclude, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/connectors/{connector_id}/workspace/activate", + 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.tool_execution_configuration if request is not None else None, + True, + True, + "json", + OptionalNullable[models.ToolExecutionConfiguration], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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_activate_for_workspace_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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 activate_for_workspace_async( + self, + *, + connector_id: str, + requires_confirmation: OptionalNullable[ + Union[models.RequiresConfirmation, models.RequiresConfirmationTypedDict] + ] = UNSET, + skip_confirmation: OptionalNullable[ + Union[models.SkipConfirmation, models.SkipConfirmationTypedDict] + ] = UNSET, + include: OptionalNullable[List[str]] = UNSET, + exclude: 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.MessageResponse: + r"""Activate a connector for a workspace. + + Enable a connector at the workspace level so all members of the workspace can use it. + + :param connector_id: + :param requires_confirmation: + :param skip_confirmation: + :param include: + :param exclude: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorActivateForWorkspaceV1Request( + connector_id=connector_id, + tool_execution_configuration=models.ToolExecutionConfiguration( + requires_confirmation=utils.get_pydantic_model( + requires_confirmation, OptionalNullable[models.RequiresConfirmation] + ), + skip_confirmation=utils.get_pydantic_model( + skip_confirmation, OptionalNullable[models.SkipConfirmation] + ), + include=include, + exclude=exclude, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/connectors/{connector_id}/workspace/activate", + 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.tool_execution_configuration if request is not None else None, + True, + True, + "json", + OptionalNullable[models.ToolExecutionConfiguration], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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_activate_for_workspace_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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 deactivate_for_workspace( + 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"""Deactivate a connector for a workspace. + + Disable a connector at the workspace level. + + :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.ConnectorDeactivateForWorkspaceV1Request( + connector_id=connector_id, + ) + + req = self._build_request( + method="POST", + path="/v1/connectors/{connector_id}/workspace/deactivate", + 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_deactivate_for_workspace_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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 deactivate_for_workspace_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"""Deactivate a connector for a workspace. + + Disable a connector at the workspace level. + + :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.ConnectorDeactivateForWorkspaceV1Request( + connector_id=connector_id, + ) + + req = self._build_request_async( + method="POST", + path="/v1/connectors/{connector_id}/workspace/deactivate", + 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_deactivate_for_workspace_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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 activate_for_user( + self, + *, + connector_id: str, + requires_confirmation: OptionalNullable[ + Union[models.RequiresConfirmation, models.RequiresConfirmationTypedDict] + ] = UNSET, + skip_confirmation: OptionalNullable[ + Union[models.SkipConfirmation, models.SkipConfirmationTypedDict] + ] = UNSET, + include: OptionalNullable[List[str]] = UNSET, + exclude: 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.MessageResponse: + r"""Activate a connector for the current user. + + Enable a connector for the calling user only. + + :param connector_id: + :param requires_confirmation: + :param skip_confirmation: + :param include: + :param exclude: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorActivateForUserV1Request( + connector_id=connector_id, + tool_execution_configuration=models.ToolExecutionConfiguration( + requires_confirmation=utils.get_pydantic_model( + requires_confirmation, OptionalNullable[models.RequiresConfirmation] + ), + skip_confirmation=utils.get_pydantic_model( + skip_confirmation, OptionalNullable[models.SkipConfirmation] + ), + include=include, + exclude=exclude, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/connectors/{connector_id}/user/activate", + 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.tool_execution_configuration if request is not None else None, + True, + True, + "json", + OptionalNullable[models.ToolExecutionConfiguration], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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_activate_for_user_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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 activate_for_user_async( + self, + *, + connector_id: str, + requires_confirmation: OptionalNullable[ + Union[models.RequiresConfirmation, models.RequiresConfirmationTypedDict] + ] = UNSET, + skip_confirmation: OptionalNullable[ + Union[models.SkipConfirmation, models.SkipConfirmationTypedDict] + ] = UNSET, + include: OptionalNullable[List[str]] = UNSET, + exclude: 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.MessageResponse: + r"""Activate a connector for the current user. + + Enable a connector for the calling user only. + + :param connector_id: + :param requires_confirmation: + :param skip_confirmation: + :param include: + :param exclude: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorActivateForUserV1Request( + connector_id=connector_id, + tool_execution_configuration=models.ToolExecutionConfiguration( + requires_confirmation=utils.get_pydantic_model( + requires_confirmation, OptionalNullable[models.RequiresConfirmation] + ), + skip_confirmation=utils.get_pydantic_model( + skip_confirmation, OptionalNullable[models.SkipConfirmation] + ), + include=include, + exclude=exclude, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/connectors/{connector_id}/user/activate", + 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.tool_execution_configuration if request is not None else None, + True, + True, + "json", + OptionalNullable[models.ToolExecutionConfiguration], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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_activate_for_user_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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 deactivate_for_user( + 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"""Deactivate a connector for the current user. + + Disable a connector for the calling user only. + + :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.ConnectorDeactivateForUserV1Request( + connector_id=connector_id, + ) + + req = self._build_request( + method="POST", + path="/v1/connectors/{connector_id}/user/deactivate", + 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_deactivate_for_user_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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 deactivate_for_user_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"""Deactivate a connector for the current user. + + Disable a connector for the calling user only. + + :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.ConnectorDeactivateForUserV1Request( + connector_id=connector_id, + ) + + req = self._build_request_async( + method="POST", + path="/v1/connectors/{connector_id}/user/deactivate", + 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_deactivate_for_user_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + 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 call_tool( self, *, @@ -755,7 +2045,7 @@ def call_tool( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -866,7 +2156,7 @@ async def call_tool_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -974,7 +2264,7 @@ def list_tools( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1084,7 +2374,7 @@ async def list_tools_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1179,7 +2469,7 @@ def get_authentication_methods( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1268,7 +2558,7 @@ async def get_authentication_methods_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1363,7 +2653,7 @@ def list_organization_credentials( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1462,7 +2752,7 @@ async def list_organization_credentials_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1577,7 +2867,7 @@ def create_or_update_organization_credentials( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1692,7 +2982,7 @@ async def create_or_update_organization_credentials_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1791,7 +3081,7 @@ def list_workspace_credentials( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1890,7 +3180,7 @@ async def list_workspace_credentials_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2005,7 +3295,7 @@ def create_or_update_workspace_credentials( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2120,7 +3410,7 @@ async def create_or_update_workspace_credentials_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2219,7 +3509,7 @@ def list_user_credentials( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2318,7 +3608,7 @@ async def list_user_credentials_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2433,7 +3723,7 @@ def create_or_update_user_credentials( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2548,7 +3838,7 @@ async def create_or_update_user_credentials_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2644,7 +3934,7 @@ def delete_organization_credentials( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2740,7 +4030,7 @@ async def delete_organization_credentials_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2836,7 +4126,7 @@ def delete_workspace_credentials( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2932,7 +4222,7 @@ async def delete_workspace_credentials_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -3028,7 +4318,7 @@ def delete_user_credentials( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -3124,7 +4414,7 @@ async def delete_user_credentials_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -3149,8 +4439,8 @@ def get( self, *, connector_id_or_name: str, + fetch_user_data: Optional[bool] = False, 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, @@ -3161,8 +4451,8 @@ def get( Get a connector by its ID or name. :param connector_id_or_name: + :param fetch_user_data: Fetch the user-level data associated with the connector (e.g. connection credentials). :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 @@ -3182,8 +4472,8 @@ def get( base_url = self._get_url(base_url, url_variables) request = models.ConnectorGetV1Request( + fetch_user_data=fetch_user_data, fetch_customer_data=fetch_customer_data, - fetch_connection_secrets=fetch_connection_secrets, connector_id_or_name=connector_id_or_name, ) @@ -3223,7 +4513,7 @@ def get( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -3248,8 +4538,8 @@ async def get_async( self, *, connector_id_or_name: str, + fetch_user_data: Optional[bool] = False, 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, @@ -3260,8 +4550,8 @@ async def get_async( Get a connector by its ID or name. :param connector_id_or_name: + :param fetch_user_data: Fetch the user-level data associated with the connector (e.g. connection credentials). :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 @@ -3281,8 +4571,8 @@ async def get_async( base_url = self._get_url(base_url, url_variables) request = models.ConnectorGetV1Request( + fetch_user_data=fetch_user_data, fetch_customer_data=fetch_customer_data, - fetch_connection_secrets=fetch_connection_secrets, connector_id_or_name=connector_id_or_name, ) @@ -3322,7 +4612,7 @@ async def get_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -3352,6 +4642,7 @@ def update( description: OptionalNullable[str] = UNSET, icon_url: OptionalNullable[str] = UNSET, system_prompt: OptionalNullable[str] = UNSET, + protocol: OptionalNullable[models.ConnectorProtocol] = UNSET, connection_config: OptionalNullable[Dict[str, Any]] = UNSET, connection_secrets: OptionalNullable[Dict[str, Any]] = UNSET, server: OptionalNullable[str] = UNSET, @@ -3374,6 +4665,7 @@ def update( :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 protocol: Protocol of 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. @@ -3405,6 +4697,7 @@ def update( description=description, icon_url=icon_url, system_prompt=system_prompt, + protocol=protocol, connection_config=connection_config, connection_secrets=connection_secrets, server=server, @@ -3458,7 +4751,7 @@ def update( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -3488,6 +4781,7 @@ async def update_async( description: OptionalNullable[str] = UNSET, icon_url: OptionalNullable[str] = UNSET, system_prompt: OptionalNullable[str] = UNSET, + protocol: OptionalNullable[models.ConnectorProtocol] = UNSET, connection_config: OptionalNullable[Dict[str, Any]] = UNSET, connection_secrets: OptionalNullable[Dict[str, Any]] = UNSET, server: OptionalNullable[str] = UNSET, @@ -3510,6 +4804,7 @@ async def update_async( :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 protocol: Protocol of 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. @@ -3541,6 +4836,7 @@ async def update_async( description=description, icon_url=icon_url, system_prompt=system_prompt, + protocol=protocol, connection_config=connection_config, connection_secrets=connection_secrets, server=server, @@ -3594,7 +4890,7 @@ async def update_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -3687,7 +4983,7 @@ def delete( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -3780,7 +5076,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/conversations.py b/src/mistralai/client/conversations.py index 0e0bca0d..33b9e0cf 100644 --- a/src/mistralai/client/conversations.py +++ b/src/mistralai/client/conversations.py @@ -505,7 +505,7 @@ def start( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -659,7 +659,7 @@ async def start_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -758,7 +758,7 @@ def list( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -859,7 +859,7 @@ async def list_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -954,7 +954,7 @@ def get( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1047,7 +1047,7 @@ async def get_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1140,7 +1140,7 @@ def delete( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1233,7 +1233,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1368,7 +1368,7 @@ def append( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1503,7 +1503,7 @@ async def append_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1596,7 +1596,7 @@ def get_history( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1689,7 +1689,7 @@ async def get_history_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1782,7 +1782,7 @@ def get_messages( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1875,7 +1875,7 @@ async def get_messages_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2020,7 +2020,7 @@ def restart( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2165,7 +2165,7 @@ async def restart_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2319,7 +2319,7 @@ def start_stream( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -2480,7 +2480,7 @@ async def start_stream_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -2622,7 +2622,7 @@ def append_stream( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -2764,7 +2764,7 @@ async def append_stream_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -2916,7 +2916,7 @@ def restart_stream( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -3068,7 +3068,7 @@ async def restart_stream_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) diff --git a/src/mistralai/client/datasets.py b/src/mistralai/client/datasets.py index 437b42fd..078bb18b 100644 --- a/src/mistralai/client/datasets.py +++ b/src/mistralai/client/datasets.py @@ -101,7 +101,7 @@ def create( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -200,7 +200,7 @@ async def create_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -299,7 +299,7 @@ def list( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -398,7 +398,7 @@ async def list_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -491,7 +491,7 @@ def fetch( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -584,7 +584,7 @@ async def fetch_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -677,7 +677,7 @@ def delete( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -770,7 +770,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -878,7 +878,7 @@ def update( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -986,7 +986,7 @@ async def update_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1087,7 +1087,7 @@ def list_records( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1188,7 +1188,7 @@ async def list_records_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1296,7 +1296,7 @@ def create_record( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1404,7 +1404,7 @@ async def create_record_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1509,7 +1509,7 @@ def import_from_campaign( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1614,7 +1614,7 @@ async def import_from_campaign_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1719,7 +1719,7 @@ def import_from_explorer( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1824,7 +1824,7 @@ async def import_from_explorer_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1929,7 +1929,7 @@ def import_from_file( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2034,7 +2034,7 @@ async def import_from_file_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2139,7 +2139,7 @@ def import_from_playground( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2244,7 +2244,7 @@ async def import_from_playground_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2349,7 +2349,7 @@ def import_from_dataset_records( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2454,7 +2454,7 @@ async def import_from_dataset_records_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2547,7 +2547,7 @@ def export_to_jsonl( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2640,7 +2640,7 @@ async def export_to_jsonl_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2736,7 +2736,7 @@ def fetch_task( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2832,7 +2832,7 @@ async def fetch_task_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2933,7 +2933,7 @@ def list_tasks( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -3036,7 +3036,7 @@ async def list_tasks_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/deployments.py b/src/mistralai/client/deployments.py index 26e9c565..086e95a2 100644 --- a/src/mistralai/client/deployments.py +++ b/src/mistralai/client/deployments.py @@ -84,7 +84,7 @@ def list_deployments( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -178,7 +178,7 @@ async def list_deployments_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -269,7 +269,7 @@ def get_deployment( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -360,7 +360,7 @@ async def get_deployment_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/documents.py b/src/mistralai/client/documents.py index 2a555d3e..a3c8b07b 100644 --- a/src/mistralai/client/documents.py +++ b/src/mistralai/client/documents.py @@ -2,12 +2,14 @@ # @generated-id: bcc17286c31c 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, Mapping, Optional, Union +from typing_extensions import deprecated class Documents(BaseSDK): @@ -36,7 +38,7 @@ def list( :param search: :param page_size: :param page: - :param filters_attributes: + :param filters_attributes: Deprecated: this parameter will be removed in a future version. :param sort_by: :param sort_order: :param retries: Override the default retry configuration for this method @@ -103,7 +105,7 @@ def list( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -147,7 +149,7 @@ async def list_async( :param search: :param page_size: :param page: - :param filters_attributes: + :param filters_attributes: Deprecated: this parameter will be removed in a future version. :param sort_by: :param sort_order: :param retries: Override the default retry configuration for this method @@ -214,7 +216,7 @@ async def list_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -323,7 +325,7 @@ def upload( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -432,7 +434,7 @@ async def upload_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -528,7 +530,7 @@ def get( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -624,7 +626,7 @@ async def get_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -654,6 +656,242 @@ def update( attributes: OptionalNullable[ Union[Dict[str, models.Attributes], Dict[str, models.AttributesTypedDict]] ] = UNSET, + expires_at: 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.Document: + r"""Update the metadata of a specific document. + + Given a library and a document in that library, update the name and/or attributes of that document. + + :param library_id: + :param document_id: + :param name: + :param attributes: + :param expires_at: If set, the document will be automatically deleted after this date. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.LibrariesDocumentsPatchV1Request( + library_id=library_id, + document_id=document_id, + update_document_request=models.UpdateDocumentRequest( + name=name, + attributes=attributes, + expires_at=expires_at, + ), + ) + + req = self._build_request( + method="PATCH", + path="/v1/libraries/{library_id}/documents/{document_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_document_request, + False, + False, + "json", + models.UpdateDocumentRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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="libraries_documents_patch_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Document, 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, + *, + library_id: str, + document_id: str, + name: Optional[str] = None, + attributes: OptionalNullable[ + Union[Dict[str, models.Attributes], Dict[str, models.AttributesTypedDict]] + ] = UNSET, + expires_at: 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.Document: + r"""Update the metadata of a specific document. + + Given a library and a document in that library, update the name and/or attributes of that document. + + :param library_id: + :param document_id: + :param name: + :param attributes: + :param expires_at: If set, the document will be automatically deleted after this date. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.LibrariesDocumentsPatchV1Request( + library_id=library_id, + document_id=document_id, + update_document_request=models.UpdateDocumentRequest( + name=name, + attributes=attributes, + expires_at=expires_at, + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/v1/libraries/{library_id}/documents/{document_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_document_request, + False, + False, + "json", + models.UpdateDocumentRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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="libraries_documents_patch_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Document, 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 ** - Use the PATCH method instead. This PUT endpoint will be removed in a future version.." + ) + def libraries_documents_update_v1( + self, + *, + library_id: str, + document_id: str, + name: Optional[str] = None, + attributes: OptionalNullable[ + Union[Dict[str, models.Attributes], Dict[str, models.AttributesTypedDict]] + ] = UNSET, + expires_at: OptionalNullable[datetime] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -667,6 +905,7 @@ def update( :param document_id: :param name: :param attributes: + :param expires_at: If set, the document will be automatically deleted after this date. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -691,6 +930,7 @@ def update( update_document_request=models.UpdateDocumentRequest( name=name, attributes=attributes, + expires_at=expires_at, ), ) @@ -737,7 +977,7 @@ def update( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -758,7 +998,10 @@ def update( raise errors.SDKError("Unexpected response received", http_res) - async def update_async( + @deprecated( + "warning: ** DEPRECATED ** - Use the PATCH method instead. This PUT endpoint will be removed in a future version.." + ) + async def libraries_documents_update_v1_async( self, *, library_id: str, @@ -767,6 +1010,7 @@ async def update_async( attributes: OptionalNullable[ Union[Dict[str, models.Attributes], Dict[str, models.AttributesTypedDict]] ] = UNSET, + expires_at: OptionalNullable[datetime] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -780,6 +1024,7 @@ async def update_async( :param document_id: :param name: :param attributes: + :param expires_at: If set, the document will be automatically deleted after this date. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -804,6 +1049,7 @@ async def update_async( update_document_request=models.UpdateDocumentRequest( name=name, attributes=attributes, + expires_at=expires_at, ), ) @@ -850,7 +1096,7 @@ async def update_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -946,7 +1192,7 @@ def delete( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1042,7 +1288,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1144,7 +1390,7 @@ def text_content( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1246,7 +1492,7 @@ async def text_content_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1342,7 +1588,7 @@ def status( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1438,7 +1684,7 @@ async def status_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1534,7 +1780,7 @@ def get_signed_url( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1630,7 +1876,7 @@ async def get_signed_url_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1726,7 +1972,7 @@ def extracted_text_signed_url( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1822,7 +2068,7 @@ async def extracted_text_signed_url_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1918,7 +2164,7 @@ def reprocess( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2014,7 +2260,7 @@ async def reprocess_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/embeddings.py b/src/mistralai/client/embeddings.py index 64337b4f..17eb9a57 100644 --- a/src/mistralai/client/embeddings.py +++ b/src/mistralai/client/embeddings.py @@ -105,7 +105,7 @@ def create( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -218,7 +218,7 @@ async def create_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/events.py b/src/mistralai/client/events.py index 3a4c4722..4ebb6505 100644 --- a/src/mistralai/client/events.py +++ b/src/mistralai/client/events.py @@ -116,7 +116,7 @@ def get_stream_events( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -252,7 +252,7 @@ async def get_stream_events_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -365,7 +365,7 @@ def get_workflow_events( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -468,7 +468,7 @@ async def get_workflow_events_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/executions.py b/src/mistralai/client/executions.py index e4b9f90b..aa22f09e 100644 --- a/src/mistralai/client/executions.py +++ b/src/mistralai/client/executions.py @@ -81,7 +81,7 @@ def get_workflow_execution( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -172,7 +172,7 @@ async def get_workflow_execution_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -266,7 +266,7 @@ def get_workflow_execution_history( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -360,7 +360,7 @@ async def get_workflow_execution_history_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -473,7 +473,7 @@ def signal_workflow_execution( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -586,7 +586,7 @@ async def signal_workflow_execution_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -699,7 +699,7 @@ def query_workflow_execution( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -812,7 +812,7 @@ async def query_workflow_execution_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -903,7 +903,7 @@ def terminate_workflow_execution( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -994,7 +994,7 @@ async def terminate_workflow_execution_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1088,7 +1088,7 @@ def batch_terminate_workflow_executions( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1182,7 +1182,7 @@ async def batch_terminate_workflow_executions_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1273,7 +1273,7 @@ def cancel_workflow_execution( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1364,7 +1364,7 @@ async def cancel_workflow_execution_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1458,7 +1458,7 @@ def batch_cancel_workflow_executions( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1552,7 +1552,7 @@ async def batch_cancel_workflow_executions_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1664,7 +1664,7 @@ def reset_workflow( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1776,7 +1776,7 @@ async def reset_workflow_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1889,7 +1889,7 @@ def update_workflow_execution( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2002,7 +2002,7 @@ async def update_workflow_execution_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2093,7 +2093,7 @@ def get_workflow_execution_trace_otel( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2186,7 +2186,7 @@ async def get_workflow_execution_trace_otel_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2279,7 +2279,7 @@ def get_workflow_execution_trace_summary( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2372,7 +2372,7 @@ async def get_workflow_execution_trace_summary_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2471,7 +2471,7 @@ def get_workflow_execution_trace_events( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2570,7 +2570,7 @@ async def get_workflow_execution_trace_events_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2671,7 +2671,7 @@ def stream( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -2781,7 +2781,7 @@ async def stream_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) diff --git a/src/mistralai/client/fields.py b/src/mistralai/client/fields.py index 17441ca6..5e701da9 100644 --- a/src/mistralai/client/fields.py +++ b/src/mistralai/client/fields.py @@ -74,7 +74,7 @@ def list( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -162,7 +162,7 @@ async def list_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -260,7 +260,7 @@ def fetch_options( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -358,7 +358,7 @@ async def fetch_options_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -469,7 +469,7 @@ def fetch_option_counts( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -580,7 +580,7 @@ async def fetch_option_counts_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/files.py b/src/mistralai/client/files.py index e4549c75..5f8396f5 100644 --- a/src/mistralai/client/files.py +++ b/src/mistralai/client/files.py @@ -112,7 +112,7 @@ def upload( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -225,7 +225,7 @@ async def upload_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -333,7 +333,7 @@ def list( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -441,7 +441,7 @@ async def list_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -528,7 +528,7 @@ def retrieve( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -615,7 +615,7 @@ async def retrieve_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -702,7 +702,7 @@ def delete( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -789,7 +789,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -876,7 +876,7 @@ def download( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -965,7 +965,7 @@ async def download_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -1055,7 +1055,7 @@ def get_signed_url( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1143,7 +1143,7 @@ async def get_signed_url_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/fim.py b/src/mistralai/client/fim.py index d25f79b1..d868bcff 100644 --- a/src/mistralai/client/fim.py +++ b/src/mistralai/client/fim.py @@ -126,7 +126,7 @@ def complete( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -260,7 +260,7 @@ async def complete_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -394,7 +394,7 @@ def stream( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -536,7 +536,7 @@ async def stream_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) diff --git a/src/mistralai/client/fine_tuning_jobs.py b/src/mistralai/client/fine_tuning_jobs.py index a6bf93a3..708cc537 100644 --- a/src/mistralai/client/fine_tuning_jobs.py +++ b/src/mistralai/client/fine_tuning_jobs.py @@ -113,7 +113,7 @@ def list( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -229,7 +229,7 @@ async def list_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -375,7 +375,7 @@ def create( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -523,7 +523,7 @@ async def create_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -612,7 +612,7 @@ def get( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -701,7 +701,7 @@ async def get_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -790,7 +790,7 @@ def cancel( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -879,7 +879,7 @@ async def cancel_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -968,7 +968,7 @@ def start( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1057,7 +1057,7 @@ async def start_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/ingestion_pipeline_configurations.py b/src/mistralai/client/ingestion_pipeline_configurations.py index adef39f9..dfd139ba 100644 --- a/src/mistralai/client/ingestion_pipeline_configurations.py +++ b/src/mistralai/client/ingestion_pipeline_configurations.py @@ -77,7 +77,7 @@ def list( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -159,7 +159,7 @@ async def list_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -258,7 +258,7 @@ def register( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -363,7 +363,7 @@ async def register_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -469,7 +469,7 @@ def update_run_info( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -575,7 +575,7 @@ async def update_run_info_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/judges.py b/src/mistralai/client/judges.py index 52c8899e..187eed0d 100644 --- a/src/mistralai/client/judges.py +++ b/src/mistralai/client/judges.py @@ -101,7 +101,7 @@ def create( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -214,7 +214,7 @@ async def create_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -319,7 +319,7 @@ def list( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -424,7 +424,7 @@ async def list_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -517,7 +517,7 @@ def fetch( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -610,7 +610,7 @@ async def fetch_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -703,7 +703,7 @@ def delete( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -796,7 +796,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -920,7 +920,7 @@ def update( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1044,7 +1044,7 @@ async def update_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1154,7 +1154,7 @@ def judge_conversation( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1264,7 +1264,7 @@ async def judge_conversation_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/libraries.py b/src/mistralai/client/libraries.py index 928c1ea8..3076d09c 100644 --- a/src/mistralai/client/libraries.py +++ b/src/mistralai/client/libraries.py @@ -11,6 +11,7 @@ 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 +from typing_extensions import deprecated class Libraries(BaseSDK): @@ -51,7 +52,7 @@ def list( :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 filter_owned_by_me: Deprecated: this parameter will be removed in a future 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 @@ -113,7 +114,7 @@ def list( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -153,7 +154,7 @@ async def list_async( :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 filter_owned_by_me: Deprecated: this parameter will be removed in a future 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 @@ -215,7 +216,7 @@ async def list_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -320,7 +321,7 @@ def create( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -425,7 +426,7 @@ async def create_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -518,7 +519,7 @@ def get( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -611,7 +612,7 @@ async def get_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -643,7 +644,7 @@ def delete( ) -> 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. + Given a library id, deletes it together with all documents that have been uploaded to that library. Warning: the response will change from 200 (returning the deleted library) to 204 No Content in a future version. :param library_id: :param retries: Override the default retry configuration for this method @@ -704,7 +705,7 @@ def delete( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -736,7 +737,7 @@ async def delete_async( ) -> 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. + Given a library id, deletes it together with all documents that have been uploaded to that library. Warning: the response will change from 200 (returning the deleted library) to 204 No Content in a future version. :param library_id: :param retries: Override the default retry configuration for this method @@ -797,7 +798,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -833,6 +834,225 @@ def update( Given a library id, you can update the name and description. + :param library_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.LibrariesPatchV1Request( + library_id=library_id, + update_library_request=models.UpdateLibraryRequest( + name=name, + description=description, + ), + ) + + req = self._build_request( + method="PATCH", + path="/v1/libraries/{library_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_library_request, + False, + False, + "json", + models.UpdateLibraryRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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="libraries_patch_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Library, 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, + *, + library_id: str, + 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.Library: + r"""Update a library. + + Given a library id, you can update the name and description. + + :param library_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.LibrariesPatchV1Request( + library_id=library_id, + update_library_request=models.UpdateLibraryRequest( + name=name, + description=description, + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/v1/libraries/{library_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_library_request, + False, + False, + "json", + models.UpdateLibraryRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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="libraries_patch_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Library, 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 ** - Use the PATCH method instead. This PUT endpoint will be removed in a future version.." + ) + def libraries_update_v1( + self, + *, + library_id: str, + 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.Library: + r"""Update a library. + + Given a library id, you can update the name and description. + :param library_id: :param name: :param description: @@ -905,7 +1125,7 @@ def update( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -926,7 +1146,10 @@ def update( raise errors.SDKError("Unexpected response received", http_res) - async def update_async( + @deprecated( + "warning: ** DEPRECATED ** - Use the PATCH method instead. This PUT endpoint will be removed in a future version.." + ) + async def libraries_update_v1_async( self, *, library_id: str, @@ -1013,7 +1236,7 @@ async def update_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/metrics.py b/src/mistralai/client/metrics.py index 60597c40..d3814d6b 100644 --- a/src/mistralai/client/metrics.py +++ b/src/mistralai/client/metrics.py @@ -109,7 +109,7 @@ def get_workflow_metrics( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -227,7 +227,7 @@ async def get_workflow_metrics_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/models/__init__.py b/src/mistralai/client/models/__init__.py index ab36240c..6121091f 100644 --- a/src/mistralai/client/models/__init__.py +++ b/src/mistralai/client/models/__init__.py @@ -9,6 +9,13 @@ Or, OrTypedDict, ) +from .logicalexpression import ( + Expression, + ExpressionTypedDict, + LogicalExpression, + LogicalExpressionType, + LogicalExpressionTypedDict, +) from typing import Any, TYPE_CHECKING from mistralai.client.utils.dynamic_imports import lazy_getattr, lazy_dir @@ -348,6 +355,15 @@ ClassifierTrainingParameters, ClassifierTrainingParametersTypedDict, ) + from .clientcapabilities import ClientCapabilities, ClientCapabilitiesTypedDict + from .clienttaskscapability import ( + ClientTasksCapability, + ClientTasksCapabilityTypedDict, + ) + from .clienttasksrequestscapability import ( + ClientTasksRequestsCapability, + ClientTasksRequestsCapabilityTypedDict, + ) from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict from .completionargs import CompletionArgs, CompletionArgsTypedDict from .completionargsstop import CompletionArgsStop, CompletionArgsStopTypedDict @@ -388,11 +404,28 @@ CompletionTrainingParameters, CompletionTrainingParametersTypedDict, ) + from .connectionconfigtype import ConnectionConfigType from .connectioncredentials import ( ConnectionCredentials, ConnectionCredentialsTypedDict, ) + from .connectionpreference import ( + ConnectionPreference, + ConnectionPreferenceTypedDict, + ) from .connector import Connector, ConnectorTypedDict + from .connector_activate_for_organization_v1op import ( + ConnectorActivateForOrganizationV1Request, + ConnectorActivateForOrganizationV1RequestTypedDict, + ) + from .connector_activate_for_user_v1op import ( + ConnectorActivateForUserV1Request, + ConnectorActivateForUserV1RequestTypedDict, + ) + from .connector_activate_for_workspace_v1op import ( + ConnectorActivateForWorkspaceV1Request, + ConnectorActivateForWorkspaceV1RequestTypedDict, + ) from .connector_call_tool_v1op import ( ConnectorCallToolV1Request, ConnectorCallToolV1RequestTypedDict, @@ -409,6 +442,18 @@ ConnectorCreateOrUpdateWorkspaceCredentialsV1Request, ConnectorCreateOrUpdateWorkspaceCredentialsV1RequestTypedDict, ) + from .connector_deactivate_for_organization_v1op import ( + ConnectorDeactivateForOrganizationV1Request, + ConnectorDeactivateForOrganizationV1RequestTypedDict, + ) + from .connector_deactivate_for_user_v1op import ( + ConnectorDeactivateForUserV1Request, + ConnectorDeactivateForUserV1RequestTypedDict, + ) + from .connector_deactivate_for_workspace_v1op import ( + ConnectorDeactivateForWorkspaceV1Request, + ConnectorDeactivateForWorkspaceV1RequestTypedDict, + ) from .connector_delete_organization_credentials_v1op import ( ConnectorDeleteOrganizationCredentialsV1Request, ConnectorDeleteOrganizationCredentialsV1RequestTypedDict, @@ -471,6 +516,8 @@ ConnectorCallToolRequest, ConnectorCallToolRequestTypedDict, ) + from .connectorlocale import ConnectorLocale, ConnectorLocaleTypedDict + from .connectorprotocol import ConnectorProtocol from .connectorsqueryfilters import ( ConnectorsQueryFilters, ConnectorsQueryFiltersTypedDict, @@ -492,6 +539,7 @@ ConnectorToolResultMetadata, ConnectorToolResultMetadataTypedDict, ) + from .consumertype import ConsumerType from .contentchunk import ContentChunk, ContentChunkTypedDict, UnknownContentChunk from .conversationappendrequest import ( ConversationAppendRequest, @@ -625,6 +673,21 @@ CreateLibraryRequestTypedDict, OwnerType, ) + from .createsearchindexinforequest import ( + CreateSearchIndexInfoRequest, + CreateSearchIndexInfoRequestIndex, + CreateSearchIndexInfoRequestIndexTypedDict, + CreateSearchIndexInfoRequestStatus, + CreateSearchIndexInfoRequestTypedDict, + ) + from .createvespaschemarequest import ( + CreateVespaSchemaRequest, + CreateVespaSchemaRequestTypedDict, + ) + from .createvespasearchindexinforequest import ( + CreateVespaSearchIndexInfoRequest, + CreateVespaSearchIndexInfoRequestTypedDict, + ) from .credentialscreateorupdate import ( CredentialsCreateOrUpdate, CredentialsCreateOrUpdateTypedDict, @@ -750,6 +813,10 @@ from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict from .documenttextcontent import DocumentTextContent, DocumentTextContentTypedDict from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict + from .elicitationcapability import ( + ElicitationCapability, + ElicitationCapabilityTypedDict, + ) from .embeddedresource import ( EmbeddedResource, EmbeddedResourceTypedDict, @@ -770,6 +837,7 @@ ) from .encodedpayloadoptions import EncodedPayloadOptions from .encodingformat import EncodingFormat + from .encryptedpatchvalue import EncryptedPatchValue, EncryptedPatchValueTypedDict from .entitytype import EntityType from .event import Event, EventTypedDict from .eventprogressstatus import EventProgressStatus @@ -985,6 +1053,17 @@ GetRunV1WorkflowsRunsRunIDGetRequest, GetRunV1WorkflowsRunsRunIDGetRequestTypedDict, ) + from .get_schedule_v1_workflows_schedules_schedule_id_getop import ( + GetScheduleV1WorkflowsSchedulesScheduleIDGetRequest, + GetScheduleV1WorkflowsSchedulesScheduleIDGetRequestTypedDict, + ) + from .get_schedules_v1_workflows_schedules_getop import ( + GetSchedulesV1WorkflowsSchedulesGetRequest, + GetSchedulesV1WorkflowsSchedulesGetRequestTypedDict, + GetSchedulesV1WorkflowsSchedulesGetResponse, + GetSchedulesV1WorkflowsSchedulesGetResponseTypedDict, + GetSchedulesV1WorkflowsSchedulesGetStatus, + ) from .get_similar_chat_completion_events_v1_observability_chat_completion_events_event_id_similar_events_getop import ( GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequest, GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequestTypedDict, @@ -1167,7 +1246,12 @@ ) from .jsonpatch import JSONPatch, JSONPatchTypedDict, UnknownJSONPatch from .jsonpatchadd import JSONPatchAdd, JSONPatchAddTypedDict - from .jsonpatchappend import JSONPatchAppend, JSONPatchAppendTypedDict + from .jsonpatchappend import ( + JSONPatchAppend, + JSONPatchAppendTypedDict, + JSONPatchAppendValue, + JSONPatchAppendValueTypedDict, + ) from .jsonpatchpayloadresponse import ( JSONPatchPayloadResponse, JSONPatchPayloadResponseTypedDict, @@ -1258,6 +1342,10 @@ LibrariesDocumentsListV1Request, LibrariesDocumentsListV1RequestTypedDict, ) + from .libraries_documents_patch_v1op import ( + LibrariesDocumentsPatchV1Request, + LibrariesDocumentsPatchV1RequestTypedDict, + ) from .libraries_documents_reprocess_v1op import ( LibrariesDocumentsReprocessV1Request, LibrariesDocumentsReprocessV1RequestTypedDict, @@ -1280,6 +1368,10 @@ LibrariesListV1Request, LibrariesListV1RequestTypedDict, ) + from .libraries_patch_v1op import ( + LibrariesPatchV1Request, + LibrariesPatchV1RequestTypedDict, + ) from .libraries_share_create_v1op import ( LibrariesShareCreateV1Request, LibrariesShareCreateV1RequestTypedDict, @@ -1371,10 +1463,36 @@ ListWorkflowEventResponseTypedDict, ) from .locationtype import LocationType + from .mcpprompt import MCPPrompt, MCPPromptTypedDict + from .mcpresource import MCPResource, MCPResourceTypedDict + from .mcpserverauthenticationrequirement import ( + MCPServerAuthenticationRequirement, + MCPServerAuthenticationRequirementTypedDict, + ) + from .mcpservercard import ( + MCPServerCard, + MCPServerCardTypedDict, + Prompts, + PromptsTypedDict, + Resources, + ResourcesTypedDict, + Tools, + ToolsTypedDict, + ) + from .mcpservercardmeta import MCPServerCardMeta, MCPServerCardMetaTypedDict from .mcpservericon import MCPServerIcon, MCPServerIconTypedDict + from .mcpserverremote import ( + MCPServerRemote, + MCPServerRemoteType, + MCPServerRemoteTypedDict, + ) + from .mcpserverremoteheader import ( + MCPServerRemoteHeader, + MCPServerRemoteHeaderTypedDict, + ) + from .mcpserverrepository import MCPServerRepository, MCPServerRepositoryTypedDict 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, @@ -1499,6 +1617,10 @@ ) from .paginationinfo import PaginationInfo, PaginationInfoTypedDict from .paginationresponse import PaginationResponse, PaginationResponseTypedDict + from .partialscheduledefinition import ( + PartialScheduleDefinition, + PartialScheduleDefinitionTypedDict, + ) from .pause_schedule_v1_workflows_schedules_schedule_id_pause_postop import ( PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequest, PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequestTypedDict, @@ -1526,11 +1648,17 @@ from .prediction import Prediction, PredictionTypedDict from .processingstatus import ProcessingStatus, ProcessingStatusTypedDict from .processstatus import ProcessStatus + from .promptargument import PromptArgument, PromptArgumentTypedDict + from .promptscapability import PromptsCapability, PromptsCapabilityTypedDict from .prompttokensdetails import PromptTokensDetails, PromptTokensDetailsTypedDict from .publicauthenticationmethod import ( PublicAuthenticationMethod, PublicAuthenticationMethodTypedDict, ) + from .publicconnectionconfig import ( + PublicConnectionConfig, + PublicConnectionConfigTypedDict, + ) from .query_workflow_execution_v1_workflows_executions_execution_id_queries_postop import ( QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequest, QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequestTypedDict, @@ -1602,6 +1730,8 @@ ) from .resetinvocationbody import ResetInvocationBody, ResetInvocationBodyTypedDict from .resourcelink import ResourceLink, ResourceLinkTypedDict + from .resourcescapability import ResourcesCapability, ResourcesCapabilityTypedDict + from .resourcetype import ResourceType from .resourcevisibility import ResourceVisibility from .responsedoneevent import ResponseDoneEvent, ResponseDoneEventTypedDict from .responseerrorevent import ResponseErrorEvent, ResponseErrorEventTypedDict @@ -1623,7 +1753,9 @@ UnknownResponseRetrieveModelV1ModelsModelIDGet, ) from .roles import Roles + from .rootscapability import RootsCapability, RootsCapabilityTypedDict from .sampletype import SampleType + from .samplingcapability import SamplingCapability, SamplingCapabilityTypedDict from .scalarmetric import ( ScalarMetric, ScalarMetricTypedDict, @@ -1664,7 +1796,25 @@ SearchChatCompletionEventsResponse, SearchChatCompletionEventsResponseTypedDict, ) + from .searchindexresponse import ( + SearchIndexResponse, + SearchIndexResponseIndex, + SearchIndexResponseIndexTypedDict, + SearchIndexResponseStatus, + SearchIndexResponseTypedDict, + UnknownSearchIndexResponseIndex, + ) from .security import Security, SecurityTypedDict + from .servercapabilities import ServerCapabilities, ServerCapabilitiesTypedDict + from .serverlocale import ServerLocale, ServerLocaleTypedDict + from .servertaskscapability import ( + ServerTasksCapability, + ServerTasksCapabilityTypedDict, + ) + from .servertasksrequestscapability import ( + ServerTasksRequestsCapability, + ServerTasksRequestsCapabilityTypedDict, + ) from .shareenum import ShareEnum from .sharing import Sharing, SharingTypedDict from .sharingdelete import SharingDelete, SharingDeleteTypedDict @@ -1733,6 +1883,18 @@ SystemMessageContentChunks, SystemMessageContentChunksTypedDict, ) + from .taskselicitationcapability import ( + TasksElicitationCapability, + TasksElicitationCapabilityTypedDict, + ) + from .taskssamplingcapability import ( + TasksSamplingCapability, + TasksSamplingCapabilityTypedDict, + ) + from .taskstoolscapability import ( + TasksToolsCapability, + TasksToolsCapabilityTypedDict, + ) from .tempogettraceresponse import ( TempoGetTraceResponse, TempoGetTraceResponseTypedDict, @@ -1806,6 +1968,14 @@ from .toolchoiceenum import ToolChoiceEnum from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict from .toolexecution import TaskSupport, ToolExecution, ToolExecutionTypedDict + from .toolexecutionconfiguration import ( + RequiresConfirmation, + RequiresConfirmationTypedDict, + SkipConfirmation, + SkipConfirmationTypedDict, + ToolExecutionConfiguration, + ToolExecutionConfigurationTypedDict, + ) from .toolexecutiondeltaevent import ( ToolExecutionDeltaEvent, ToolExecutionDeltaEventName, @@ -1842,13 +2012,14 @@ ToolMessageContentTypedDict, ToolMessageTypedDict, ) + from .toolproperties import ToolProperties, ToolPropertiesTypedDict from .toolreferencechunk import ( ToolReferenceChunk, ToolReferenceChunkTool, ToolReferenceChunkToolTypedDict, ToolReferenceChunkTypedDict, ) - from .tooltype import ToolType + from .toolscapability import ToolsCapability, ToolsCapabilityTypedDict from .trainingfile import TrainingFile, TrainingFileTypedDict from .transcriptionresponse import ( TranscriptionResponse, @@ -1882,8 +2053,7 @@ TranscriptionStreamTextDelta, TranscriptionStreamTextDeltaTypedDict, ) - from .turbinetoollocale import TurbineToolLocale, TurbineToolLocaleTypedDict - from .turbinetoolmeta import TurbineToolMeta, TurbineToolMetaTypedDict + from .turbinemeta import TurbineMeta, TurbineMetaTypedDict from .unarchive_workflow_v1_workflows_workflow_identifier_unarchive_putop import ( UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequest, UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequestTypedDict, @@ -1916,6 +2086,10 @@ UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequest, UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequestTypedDict, ) + from .update_schedule_v1_workflows_schedules_schedule_id_patchop import ( + UpdateScheduleV1WorkflowsSchedulesScheduleIDPatchRequest, + UpdateScheduleV1WorkflowsSchedulesScheduleIDPatchRequestTypedDict, + ) from .update_voice_v1_audio_voices_voice_id_patchop import ( UpdateVoiceV1AudioVoicesVoiceIDPatchRequest, UpdateVoiceV1AudioVoicesVoiceIDPatchRequestTypedDict, @@ -1995,6 +2169,12 @@ ValidationError, ValidationErrorTypedDict, ) + from .vespaschemaresponse import VespaSchemaResponse, VespaSchemaResponseTypedDict + from .vespasearchindexinforesponse import ( + VespaSearchIndexInfoResponse, + VespaSearchIndexInfoResponseTypedDict, + ) + from .voiceappearance import VoiceAppearance, VoiceAppearanceTypedDict from .voicecreaterequest import VoiceCreateRequest, VoiceCreateRequestTypedDict from .voicelistresponse import VoiceListResponse, VoiceListResponseTypedDict from .voiceresponse import VoiceResponse, VoiceResponseTypedDict @@ -2018,6 +2198,23 @@ WorkflowBasicDefinition, WorkflowBasicDefinitionTypedDict, ) + from .workflowbulkarchiverequest import ( + WorkflowBulkArchiveRequest, + WorkflowBulkArchiveRequestTypedDict, + ) + from .workflowbulkarchiveresponse import ( + WorkflowBulkArchiveResponse, + WorkflowBulkArchiveResponseTypedDict, + ) + from .workflowbulkerror import WorkflowBulkError, WorkflowBulkErrorTypedDict + from .workflowbulkunarchiverequest import ( + WorkflowBulkUnarchiveRequest, + WorkflowBulkUnarchiveRequestTypedDict, + ) + from .workflowbulkunarchiveresponse import ( + WorkflowBulkUnarchiveResponse, + WorkflowBulkUnarchiveResponseTypedDict, + ) from .workflowcodedefinition import ( WorkflowCodeDefinition, WorkflowCodeDefinitionTypedDict, @@ -2153,6 +2350,10 @@ WorkflowScheduleResponse, WorkflowScheduleResponseTypedDict, ) + from .workflowscheduleupdaterequest import ( + WorkflowScheduleUpdateRequest, + WorkflowScheduleUpdateRequestTypedDict, + ) from .workflowtaskfailedattributes import ( WorkflowTaskFailedAttributes, WorkflowTaskFailedAttributesTypedDict, @@ -2187,6 +2388,7 @@ WorkflowWithWorkerStatusTypedDict, ) # Pydantic models with forward references FilterGroup.model_rebuild() +LogicalExpression.model_rebuild() __all__ = [ @@ -2424,6 +2626,12 @@ "ClassifierTargetTypedDict", "ClassifierTrainingParameters", "ClassifierTrainingParametersTypedDict", + "ClientCapabilities", + "ClientCapabilitiesTypedDict", + "ClientTasksCapability", + "ClientTasksCapabilityTypedDict", + "ClientTasksRequestsCapability", + "ClientTasksRequestsCapabilityTypedDict", "CodeInterpreterTool", "CodeInterpreterToolTypedDict", "CompletionArgs", @@ -2457,9 +2665,18 @@ "CompletionTrainingParametersTypedDict", "ConfidenceScoresGranularity", "Confirmation", + "ConnectionConfigType", "ConnectionCredentials", "ConnectionCredentialsTypedDict", + "ConnectionPreference", + "ConnectionPreferenceTypedDict", "Connector", + "ConnectorActivateForOrganizationV1Request", + "ConnectorActivateForOrganizationV1RequestTypedDict", + "ConnectorActivateForUserV1Request", + "ConnectorActivateForUserV1RequestTypedDict", + "ConnectorActivateForWorkspaceV1Request", + "ConnectorActivateForWorkspaceV1RequestTypedDict", "ConnectorAuthenticationHeader", "ConnectorAuthenticationHeaderTypedDict", "ConnectorCallToolRequest", @@ -2472,6 +2689,12 @@ "ConnectorCreateOrUpdateUserCredentialsV1RequestTypedDict", "ConnectorCreateOrUpdateWorkspaceCredentialsV1Request", "ConnectorCreateOrUpdateWorkspaceCredentialsV1RequestTypedDict", + "ConnectorDeactivateForOrganizationV1Request", + "ConnectorDeactivateForOrganizationV1RequestTypedDict", + "ConnectorDeactivateForUserV1Request", + "ConnectorDeactivateForUserV1RequestTypedDict", + "ConnectorDeactivateForWorkspaceV1Request", + "ConnectorDeactivateForWorkspaceV1RequestTypedDict", "ConnectorDeleteOrganizationCredentialsV1Request", "ConnectorDeleteOrganizationCredentialsV1RequestTypedDict", "ConnectorDeleteUserCredentialsV1Request", @@ -2496,6 +2719,9 @@ "ConnectorListV1RequestTypedDict", "ConnectorListWorkspaceCredentialsV1Request", "ConnectorListWorkspaceCredentialsV1RequestTypedDict", + "ConnectorLocale", + "ConnectorLocaleTypedDict", + "ConnectorProtocol", "ConnectorTool", "ConnectorToolCallMetadata", "ConnectorToolCallMetadataTypedDict", @@ -2513,6 +2739,7 @@ "ConnectorUpdateV1RequestTypedDict", "ConnectorsQueryFilters", "ConnectorsQueryFiltersTypedDict", + "ConsumerType", "ContentChunk", "ContentChunkTypedDict", "Context", @@ -2600,6 +2827,15 @@ "CreateJudgeRequestTypedDict", "CreateLibraryRequest", "CreateLibraryRequestTypedDict", + "CreateSearchIndexInfoRequest", + "CreateSearchIndexInfoRequestIndex", + "CreateSearchIndexInfoRequestIndexTypedDict", + "CreateSearchIndexInfoRequestStatus", + "CreateSearchIndexInfoRequestTypedDict", + "CreateVespaSchemaRequest", + "CreateVespaSchemaRequestTypedDict", + "CreateVespaSearchIndexInfoRequest", + "CreateVespaSearchIndexInfoRequestTypedDict", "CredentialsCreateOrUpdate", "CredentialsCreateOrUpdateTypedDict", "CredentialsResponse", @@ -2684,6 +2920,8 @@ "DocumentUnionTypedDict", "DocumentUpload", "DocumentUploadTypedDict", + "ElicitationCapability", + "ElicitationCapabilityTypedDict", "EmbeddedResource", "EmbeddedResourceTypedDict", "EmbeddingDtype", @@ -2697,6 +2935,8 @@ "EmbeddingResponseTypedDict", "EncodedPayloadOptions", "EncodingFormat", + "EncryptedPatchValue", + "EncryptedPatchValueTypedDict", "EntityType", "Entry", "EntryTypedDict", @@ -2715,6 +2955,8 @@ "ExportDatasetResponseTypedDict", "ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequest", "ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequestTypedDict", + "Expression", + "ExpressionTypedDict", "FIMCompletionRequest", "FIMCompletionRequestStop", "FIMCompletionRequestStopTypedDict", @@ -2833,6 +3075,13 @@ "GetRunHistoryV1WorkflowsRunsRunIDHistoryGetRequestTypedDict", "GetRunV1WorkflowsRunsRunIDGetRequest", "GetRunV1WorkflowsRunsRunIDGetRequestTypedDict", + "GetScheduleV1WorkflowsSchedulesScheduleIDGetRequest", + "GetScheduleV1WorkflowsSchedulesScheduleIDGetRequestTypedDict", + "GetSchedulesV1WorkflowsSchedulesGetRequest", + "GetSchedulesV1WorkflowsSchedulesGetRequestTypedDict", + "GetSchedulesV1WorkflowsSchedulesGetResponse", + "GetSchedulesV1WorkflowsSchedulesGetResponseTypedDict", + "GetSchedulesV1WorkflowsSchedulesGetStatus", "GetSignedURLResponse", "GetSignedURLResponseTypedDict", "GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequest", @@ -2911,6 +3160,8 @@ "JSONPatchAddTypedDict", "JSONPatchAppend", "JSONPatchAppendTypedDict", + "JSONPatchAppendValue", + "JSONPatchAppendValueTypedDict", "JSONPatchPayloadResponse", "JSONPatchPayloadResponseTypedDict", "JSONPatchPayloadValueResponse", @@ -3002,6 +3253,8 @@ "LibrariesDocumentsGetV1RequestTypedDict", "LibrariesDocumentsListV1Request", "LibrariesDocumentsListV1RequestTypedDict", + "LibrariesDocumentsPatchV1Request", + "LibrariesDocumentsPatchV1RequestTypedDict", "LibrariesDocumentsReprocessV1Request", "LibrariesDocumentsReprocessV1RequestTypedDict", "LibrariesDocumentsUpdateV1Request", @@ -3012,6 +3265,8 @@ "LibrariesGetV1RequestTypedDict", "LibrariesListV1Request", "LibrariesListV1RequestTypedDict", + "LibrariesPatchV1Request", + "LibrariesPatchV1RequestTypedDict", "LibrariesShareCreateV1Request", "LibrariesShareCreateV1RequestTypedDict", "LibrariesShareDeleteV1Request", @@ -3070,14 +3325,32 @@ "Loc", "LocTypedDict", "LocationType", + "LogicalExpression", + "LogicalExpressionType", + "LogicalExpressionTypedDict", + "MCPPrompt", + "MCPPromptTypedDict", + "MCPResource", + "MCPResourceTypedDict", + "MCPServerAuthenticationRequirement", + "MCPServerAuthenticationRequirementTypedDict", + "MCPServerCard", + "MCPServerCardMeta", + "MCPServerCardMetaTypedDict", + "MCPServerCardTypedDict", "MCPServerIcon", "MCPServerIconTypedDict", + "MCPServerRemote", + "MCPServerRemoteHeader", + "MCPServerRemoteHeaderTypedDict", + "MCPServerRemoteType", + "MCPServerRemoteTypedDict", + "MCPServerRepository", + "MCPServerRepositoryTypedDict", "MCPTool", "MCPToolMeta", "MCPToolMetaTypedDict", "MCPToolTypedDict", - "MCPUIToolMeta", - "MCPUIToolMetaTypedDict", "MessageEntries", "MessageEntriesTypedDict", "MessageInputContentChunks", @@ -3186,6 +3459,8 @@ "PaginationInfoTypedDict", "PaginationResponse", "PaginationResponseTypedDict", + "PartialScheduleDefinition", + "PartialScheduleDefinitionTypedDict", "PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequest", "PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequestTypedDict", "Payload", @@ -3205,10 +3480,18 @@ "ProcessStatus", "ProcessingStatus", "ProcessingStatusTypedDict", + "PromptArgument", + "PromptArgumentTypedDict", "PromptTokensDetails", "PromptTokensDetailsTypedDict", + "Prompts", + "PromptsCapability", + "PromptsCapabilityTypedDict", + "PromptsTypedDict", "PublicAuthenticationMethod", "PublicAuthenticationMethodTypedDict", + "PublicConnectionConfig", + "PublicConnectionConfigTypedDict", "QueryDefinition", "QueryDefinitionTypedDict", "QueryInvocationBody", @@ -3247,6 +3530,8 @@ "ReferenceID", "ReferenceIDTypedDict", "RequestSource", + "RequiresConfirmation", + "RequiresConfirmationTypedDict", "ResetInvocationBody", "ResetInvocationBodyTypedDict", "ResetWorkflowV1WorkflowsExecutionsExecutionIDResetPostRequest", @@ -3254,8 +3539,13 @@ "Resource", "ResourceLink", "ResourceLinkTypedDict", + "ResourceType", "ResourceTypedDict", "ResourceVisibility", + "Resources", + "ResourcesCapability", + "ResourcesCapabilityTypedDict", + "ResourcesTypedDict", "Response", "ResponseConnectorListToolsV1", "ResponseConnectorListToolsV1TypedDict", @@ -3283,8 +3573,12 @@ "RetrieveModelV1ModelsModelIDGetRequestTypedDict", "Role", "Roles", + "RootsCapability", + "RootsCapabilityTypedDict", "SSETypes", "SampleType", + "SamplingCapability", + "SamplingCapabilityTypedDict", "ScalarMetric", "ScalarMetricTypedDict", "ScalarMetricValue", @@ -3315,8 +3609,21 @@ "SearchChatCompletionEventsRequestTypedDict", "SearchChatCompletionEventsResponse", "SearchChatCompletionEventsResponseTypedDict", + "SearchIndexResponse", + "SearchIndexResponseIndex", + "SearchIndexResponseIndexTypedDict", + "SearchIndexResponseStatus", + "SearchIndexResponseTypedDict", "Security", "SecurityTypedDict", + "ServerCapabilities", + "ServerCapabilitiesTypedDict", + "ServerLocale", + "ServerLocaleTypedDict", + "ServerTasksCapability", + "ServerTasksCapabilityTypedDict", + "ServerTasksRequestsCapability", + "ServerTasksRequestsCapabilityTypedDict", "ShareEnum", "Sharing", "SharingDelete", @@ -3336,6 +3643,8 @@ "SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIDSignalsPostRequestTypedDict", "SignalWorkflowResponse", "SignalWorkflowResponseTypedDict", + "SkipConfirmation", + "SkipConfirmationTypedDict", "Source", "SpeechOutputFormat", "SpeechRequest", @@ -3372,6 +3681,12 @@ "SystemMessageTypedDict", "TableFormat", "TaskSupport", + "TasksElicitationCapability", + "TasksElicitationCapabilityTypedDict", + "TasksSamplingCapability", + "TasksSamplingCapabilityTypedDict", + "TasksToolsCapability", + "TasksToolsCapabilityTypedDict", "TempoGetTraceResponse", "TempoGetTraceResponseTypedDict", "TempoTraceAttribute", @@ -3435,6 +3750,8 @@ "ToolConfiguration", "ToolConfigurationTypedDict", "ToolExecution", + "ToolExecutionConfiguration", + "ToolExecutionConfigurationTypedDict", "ToolExecutionDeltaEvent", "ToolExecutionDeltaEventName", "ToolExecutionDeltaEventNameTypedDict", @@ -3460,12 +3777,17 @@ "ToolMessageContent", "ToolMessageContentTypedDict", "ToolMessageTypedDict", + "ToolProperties", + "ToolPropertiesTypedDict", "ToolReferenceChunk", "ToolReferenceChunkTool", "ToolReferenceChunkToolTypedDict", "ToolReferenceChunkTypedDict", - "ToolType", "ToolTypedDict", + "Tools", + "ToolsCapability", + "ToolsCapabilityTypedDict", + "ToolsTypedDict", "TrainingFile", "TrainingFileTypedDict", "TranscriptionResponse", @@ -3485,10 +3807,8 @@ "TranscriptionStreamSegmentDeltaTypedDict", "TranscriptionStreamTextDelta", "TranscriptionStreamTextDeltaTypedDict", - "TurbineToolLocale", - "TurbineToolLocaleTypedDict", - "TurbineToolMeta", - "TurbineToolMetaTypedDict", + "TurbineMeta", + "TurbineMetaTypedDict", "UnarchiveModelResponse", "UnarchiveModelResponseTypedDict", "UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequest", @@ -3516,6 +3836,7 @@ "UnknownPayload", "UnknownResponse", "UnknownResponseRetrieveModelV1ModelsModelIDGet", + "UnknownSearchIndexResponseIndex", "UnknownSpeechV1AudioSpeechPostData", "UnknownTranscriptionStreamEventsData", "UnscheduleWorkflowV1WorkflowsSchedulesScheduleIDDeleteRequest", @@ -3560,6 +3881,8 @@ "UpdateRunInfoTypedDict", "UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequest", "UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequestTypedDict", + "UpdateScheduleV1WorkflowsSchedulesScheduleIDPatchRequest", + "UpdateScheduleV1WorkflowsSchedulesScheduleIDPatchRequestTypedDict", "UpdateVoiceV1AudioVoicesVoiceIDPatchRequest", "UpdateVoiceV1AudioVoicesVoiceIDPatchRequestTypedDict", "UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIDUpdatesPostRequest", @@ -3578,7 +3901,12 @@ "UserMessageTypedDict", "ValidationError", "ValidationErrorTypedDict", - "Visibility", + "VespaSchemaResponse", + "VespaSchemaResponseTypedDict", + "VespaSearchIndexInfoResponse", + "VespaSearchIndexInfoResponseTypedDict", + "VoiceAppearance", + "VoiceAppearanceTypedDict", "VoiceCreateRequest", "VoiceCreateRequestTypedDict", "VoiceListResponse", @@ -3600,6 +3928,16 @@ "WorkflowArchiveResponseTypedDict", "WorkflowBasicDefinition", "WorkflowBasicDefinitionTypedDict", + "WorkflowBulkArchiveRequest", + "WorkflowBulkArchiveRequestTypedDict", + "WorkflowBulkArchiveResponse", + "WorkflowBulkArchiveResponseTypedDict", + "WorkflowBulkError", + "WorkflowBulkErrorTypedDict", + "WorkflowBulkUnarchiveRequest", + "WorkflowBulkUnarchiveRequestTypedDict", + "WorkflowBulkUnarchiveResponse", + "WorkflowBulkUnarchiveResponseTypedDict", "WorkflowCodeDefinition", "WorkflowCodeDefinitionTypedDict", "WorkflowEventType", @@ -3674,6 +4012,8 @@ "WorkflowScheduleRequestTypedDict", "WorkflowScheduleResponse", "WorkflowScheduleResponseTypedDict", + "WorkflowScheduleUpdateRequest", + "WorkflowScheduleUpdateRequestTypedDict", "WorkflowTaskFailedAttributes", "WorkflowTaskFailedAttributesTypedDict", "WorkflowTaskFailedResponse", @@ -3925,6 +4265,12 @@ "ClassifierTargetResultTypedDict": ".classifiertargetresult", "ClassifierTrainingParameters": ".classifiertrainingparameters", "ClassifierTrainingParametersTypedDict": ".classifiertrainingparameters", + "ClientCapabilities": ".clientcapabilities", + "ClientCapabilitiesTypedDict": ".clientcapabilities", + "ClientTasksCapability": ".clienttaskscapability", + "ClientTasksCapabilityTypedDict": ".clienttaskscapability", + "ClientTasksRequestsCapability": ".clienttasksrequestscapability", + "ClientTasksRequestsCapabilityTypedDict": ".clienttasksrequestscapability", "CodeInterpreterTool": ".codeinterpretertool", "CodeInterpreterToolTypedDict": ".codeinterpretertool", "CompletionArgs": ".completionargs", @@ -3960,10 +4306,19 @@ "CompletionResponseStreamChoiceTypedDict": ".completionresponsestreamchoice", "CompletionTrainingParameters": ".completiontrainingparameters", "CompletionTrainingParametersTypedDict": ".completiontrainingparameters", + "ConnectionConfigType": ".connectionconfigtype", "ConnectionCredentials": ".connectioncredentials", "ConnectionCredentialsTypedDict": ".connectioncredentials", + "ConnectionPreference": ".connectionpreference", + "ConnectionPreferenceTypedDict": ".connectionpreference", "Connector": ".connector", "ConnectorTypedDict": ".connector", + "ConnectorActivateForOrganizationV1Request": ".connector_activate_for_organization_v1op", + "ConnectorActivateForOrganizationV1RequestTypedDict": ".connector_activate_for_organization_v1op", + "ConnectorActivateForUserV1Request": ".connector_activate_for_user_v1op", + "ConnectorActivateForUserV1RequestTypedDict": ".connector_activate_for_user_v1op", + "ConnectorActivateForWorkspaceV1Request": ".connector_activate_for_workspace_v1op", + "ConnectorActivateForWorkspaceV1RequestTypedDict": ".connector_activate_for_workspace_v1op", "ConnectorCallToolV1Request": ".connector_call_tool_v1op", "ConnectorCallToolV1RequestTypedDict": ".connector_call_tool_v1op", "ConnectorCreateOrUpdateOrganizationCredentialsV1Request": ".connector_create_or_update_organization_credentials_v1op", @@ -3972,6 +4327,12 @@ "ConnectorCreateOrUpdateUserCredentialsV1RequestTypedDict": ".connector_create_or_update_user_credentials_v1op", "ConnectorCreateOrUpdateWorkspaceCredentialsV1Request": ".connector_create_or_update_workspace_credentials_v1op", "ConnectorCreateOrUpdateWorkspaceCredentialsV1RequestTypedDict": ".connector_create_or_update_workspace_credentials_v1op", + "ConnectorDeactivateForOrganizationV1Request": ".connector_deactivate_for_organization_v1op", + "ConnectorDeactivateForOrganizationV1RequestTypedDict": ".connector_deactivate_for_organization_v1op", + "ConnectorDeactivateForUserV1Request": ".connector_deactivate_for_user_v1op", + "ConnectorDeactivateForUserV1RequestTypedDict": ".connector_deactivate_for_user_v1op", + "ConnectorDeactivateForWorkspaceV1Request": ".connector_deactivate_for_workspace_v1op", + "ConnectorDeactivateForWorkspaceV1RequestTypedDict": ".connector_deactivate_for_workspace_v1op", "ConnectorDeleteOrganizationCredentialsV1Request": ".connector_delete_organization_credentials_v1op", "ConnectorDeleteOrganizationCredentialsV1RequestTypedDict": ".connector_delete_organization_credentials_v1op", "ConnectorDeleteUserCredentialsV1Request": ".connector_delete_user_credentials_v1op", @@ -4004,6 +4365,9 @@ "ConnectorAuthenticationHeaderTypedDict": ".connectorauthenticationheader", "ConnectorCallToolRequest": ".connectorcalltoolrequest", "ConnectorCallToolRequestTypedDict": ".connectorcalltoolrequest", + "ConnectorLocale": ".connectorlocale", + "ConnectorLocaleTypedDict": ".connectorlocale", + "ConnectorProtocol": ".connectorprotocol", "ConnectorsQueryFilters": ".connectorsqueryfilters", "ConnectorsQueryFiltersTypedDict": ".connectorsqueryfilters", "ConnectorTool": ".connectortool", @@ -4019,6 +4383,7 @@ "ConnectorToolLocaleTypedDict": ".connectortoollocale", "ConnectorToolResultMetadata": ".connectortoolresultmetadata", "ConnectorToolResultMetadataTypedDict": ".connectortoolresultmetadata", + "ConsumerType": ".consumertype", "ContentChunk": ".contentchunk", "ContentChunkTypedDict": ".contentchunk", "UnknownContentChunk": ".contentchunk", @@ -4111,6 +4476,15 @@ "CreateLibraryRequest": ".createlibraryrequest", "CreateLibraryRequestTypedDict": ".createlibraryrequest", "OwnerType": ".createlibraryrequest", + "CreateSearchIndexInfoRequest": ".createsearchindexinforequest", + "CreateSearchIndexInfoRequestIndex": ".createsearchindexinforequest", + "CreateSearchIndexInfoRequestIndexTypedDict": ".createsearchindexinforequest", + "CreateSearchIndexInfoRequestStatus": ".createsearchindexinforequest", + "CreateSearchIndexInfoRequestTypedDict": ".createsearchindexinforequest", + "CreateVespaSchemaRequest": ".createvespaschemarequest", + "CreateVespaSchemaRequestTypedDict": ".createvespaschemarequest", + "CreateVespaSearchIndexInfoRequest": ".createvespasearchindexinforequest", + "CreateVespaSearchIndexInfoRequestTypedDict": ".createvespasearchindexinforequest", "CredentialsCreateOrUpdate": ".credentialscreateorupdate", "CredentialsCreateOrUpdateTypedDict": ".credentialscreateorupdate", "CredentialsResponse": ".credentialsresponse", @@ -4197,6 +4571,8 @@ "DocumentTextContentTypedDict": ".documenttextcontent", "DocumentURLChunk": ".documenturlchunk", "DocumentURLChunkTypedDict": ".documenturlchunk", + "ElicitationCapability": ".elicitationcapability", + "ElicitationCapabilityTypedDict": ".elicitationcapability", "EmbeddedResource": ".embeddedresource", "EmbeddedResourceTypedDict": ".embeddedresource", "Resource": ".embeddedresource", @@ -4212,6 +4588,8 @@ "EmbeddingResponseDataTypedDict": ".embeddingresponsedata", "EncodedPayloadOptions": ".encodedpayloadoptions", "EncodingFormat": ".encodingformat", + "EncryptedPatchValue": ".encryptedpatchvalue", + "EncryptedPatchValueTypedDict": ".encryptedpatchvalue", "EntityType": ".entitytype", "Event": ".event", "EventTypedDict": ".event", @@ -4353,6 +4731,13 @@ "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", + "GetScheduleV1WorkflowsSchedulesScheduleIDGetRequest": ".get_schedule_v1_workflows_schedules_schedule_id_getop", + "GetScheduleV1WorkflowsSchedulesScheduleIDGetRequestTypedDict": ".get_schedule_v1_workflows_schedules_schedule_id_getop", + "GetSchedulesV1WorkflowsSchedulesGetRequest": ".get_schedules_v1_workflows_schedules_getop", + "GetSchedulesV1WorkflowsSchedulesGetRequestTypedDict": ".get_schedules_v1_workflows_schedules_getop", + "GetSchedulesV1WorkflowsSchedulesGetResponse": ".get_schedules_v1_workflows_schedules_getop", + "GetSchedulesV1WorkflowsSchedulesGetResponseTypedDict": ".get_schedules_v1_workflows_schedules_getop", + "GetSchedulesV1WorkflowsSchedulesGetStatus": ".get_schedules_v1_workflows_schedules_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", @@ -4477,6 +4862,8 @@ "JSONPatchAddTypedDict": ".jsonpatchadd", "JSONPatchAppend": ".jsonpatchappend", "JSONPatchAppendTypedDict": ".jsonpatchappend", + "JSONPatchAppendValue": ".jsonpatchappend", + "JSONPatchAppendValueTypedDict": ".jsonpatchappend", "JSONPatchPayloadResponse": ".jsonpatchpayloadresponse", "JSONPatchPayloadResponseTypedDict": ".jsonpatchpayloadresponse", "JSONPatchPayloadValueResponse": ".jsonpatchpayloadvalueresponse", @@ -4535,6 +4922,8 @@ "LibrariesDocumentsGetV1RequestTypedDict": ".libraries_documents_get_v1op", "LibrariesDocumentsListV1Request": ".libraries_documents_list_v1op", "LibrariesDocumentsListV1RequestTypedDict": ".libraries_documents_list_v1op", + "LibrariesDocumentsPatchV1Request": ".libraries_documents_patch_v1op", + "LibrariesDocumentsPatchV1RequestTypedDict": ".libraries_documents_patch_v1op", "LibrariesDocumentsReprocessV1Request": ".libraries_documents_reprocess_v1op", "LibrariesDocumentsReprocessV1RequestTypedDict": ".libraries_documents_reprocess_v1op", "LibrariesDocumentsUpdateV1Request": ".libraries_documents_update_v1op", @@ -4547,6 +4936,8 @@ "LibrariesGetV1RequestTypedDict": ".libraries_get_v1op", "LibrariesListV1Request": ".libraries_list_v1op", "LibrariesListV1RequestTypedDict": ".libraries_list_v1op", + "LibrariesPatchV1Request": ".libraries_patch_v1op", + "LibrariesPatchV1RequestTypedDict": ".libraries_patch_v1op", "LibrariesShareCreateV1Request": ".libraries_share_create_v1op", "LibrariesShareCreateV1RequestTypedDict": ".libraries_share_create_v1op", "LibrariesShareDeleteV1Request": ".libraries_share_delete_v1op", @@ -4604,15 +4995,35 @@ "ListWorkflowEventResponseEventTypedDict": ".listworkfloweventresponse", "ListWorkflowEventResponseTypedDict": ".listworkfloweventresponse", "LocationType": ".locationtype", + "MCPPrompt": ".mcpprompt", + "MCPPromptTypedDict": ".mcpprompt", + "MCPResource": ".mcpresource", + "MCPResourceTypedDict": ".mcpresource", + "MCPServerAuthenticationRequirement": ".mcpserverauthenticationrequirement", + "MCPServerAuthenticationRequirementTypedDict": ".mcpserverauthenticationrequirement", + "MCPServerCard": ".mcpservercard", + "MCPServerCardTypedDict": ".mcpservercard", + "Prompts": ".mcpservercard", + "PromptsTypedDict": ".mcpservercard", + "Resources": ".mcpservercard", + "ResourcesTypedDict": ".mcpservercard", + "Tools": ".mcpservercard", + "ToolsTypedDict": ".mcpservercard", + "MCPServerCardMeta": ".mcpservercardmeta", + "MCPServerCardMetaTypedDict": ".mcpservercardmeta", "MCPServerIcon": ".mcpservericon", "MCPServerIconTypedDict": ".mcpservericon", + "MCPServerRemote": ".mcpserverremote", + "MCPServerRemoteType": ".mcpserverremote", + "MCPServerRemoteTypedDict": ".mcpserverremote", + "MCPServerRemoteHeader": ".mcpserverremoteheader", + "MCPServerRemoteHeaderTypedDict": ".mcpserverremoteheader", + "MCPServerRepository": ".mcpserverrepository", + "MCPServerRepositoryTypedDict": ".mcpserverrepository", "MCPTool": ".mcptool", "MCPToolTypedDict": ".mcptool", "MCPToolMeta": ".mcptoolmeta", "MCPToolMetaTypedDict": ".mcptoolmeta", - "MCPUIToolMeta": ".mcpuitoolmeta", - "MCPUIToolMetaTypedDict": ".mcpuitoolmeta", - "Visibility": ".mcpuitoolmeta", "MessageEntries": ".messageentries", "MessageEntriesTypedDict": ".messageentries", "MessageInputContentChunks": ".messageinputcontentchunks", @@ -4719,6 +5130,8 @@ "PaginationInfoTypedDict": ".paginationinfo", "PaginationResponse": ".paginationresponse", "PaginationResponseTypedDict": ".paginationresponse", + "PartialScheduleDefinition": ".partialscheduledefinition", + "PartialScheduleDefinitionTypedDict": ".partialscheduledefinition", "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", @@ -4736,10 +5149,16 @@ "ProcessingStatus": ".processingstatus", "ProcessingStatusTypedDict": ".processingstatus", "ProcessStatus": ".processstatus", + "PromptArgument": ".promptargument", + "PromptArgumentTypedDict": ".promptargument", + "PromptsCapability": ".promptscapability", + "PromptsCapabilityTypedDict": ".promptscapability", "PromptTokensDetails": ".prompttokensdetails", "PromptTokensDetailsTypedDict": ".prompttokensdetails", "PublicAuthenticationMethod": ".publicauthenticationmethod", "PublicAuthenticationMethodTypedDict": ".publicauthenticationmethod", + "PublicConnectionConfig": ".publicconnectionconfig", + "PublicConnectionConfigTypedDict": ".publicconnectionconfig", "QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequest": ".query_workflow_execution_v1_workflows_executions_execution_id_queries_postop", "QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequestTypedDict": ".query_workflow_execution_v1_workflows_executions_execution_id_queries_postop", "QueryDefinition": ".querydefinition", @@ -4784,6 +5203,9 @@ "ResetInvocationBodyTypedDict": ".resetinvocationbody", "ResourceLink": ".resourcelink", "ResourceLinkTypedDict": ".resourcelink", + "ResourcesCapability": ".resourcescapability", + "ResourcesCapabilityTypedDict": ".resourcescapability", + "ResourceType": ".resourcetype", "ResourceVisibility": ".resourcevisibility", "ResponseDoneEvent": ".responsedoneevent", "ResponseDoneEventTypedDict": ".responsedoneevent", @@ -4802,7 +5224,11 @@ "RetrieveModelV1ModelsModelIDGetRequestTypedDict": ".retrieve_model_v1_models_model_id_getop", "UnknownResponseRetrieveModelV1ModelsModelIDGet": ".retrieve_model_v1_models_model_id_getop", "Roles": ".roles", + "RootsCapability": ".rootscapability", + "RootsCapabilityTypedDict": ".rootscapability", "SampleType": ".sampletype", + "SamplingCapability": ".samplingcapability", + "SamplingCapabilityTypedDict": ".samplingcapability", "ScalarMetric": ".scalarmetric", "ScalarMetricTypedDict": ".scalarmetric", "ScalarMetricValue": ".scalarmetric", @@ -4832,8 +5258,22 @@ "SearchChatCompletionEventsRequestTypedDict": ".searchchatcompletioneventsrequest", "SearchChatCompletionEventsResponse": ".searchchatcompletioneventsresponse", "SearchChatCompletionEventsResponseTypedDict": ".searchchatcompletioneventsresponse", + "SearchIndexResponse": ".searchindexresponse", + "SearchIndexResponseIndex": ".searchindexresponse", + "SearchIndexResponseIndexTypedDict": ".searchindexresponse", + "SearchIndexResponseStatus": ".searchindexresponse", + "SearchIndexResponseTypedDict": ".searchindexresponse", + "UnknownSearchIndexResponseIndex": ".searchindexresponse", "Security": ".security", "SecurityTypedDict": ".security", + "ServerCapabilities": ".servercapabilities", + "ServerCapabilitiesTypedDict": ".servercapabilities", + "ServerLocale": ".serverlocale", + "ServerLocaleTypedDict": ".serverlocale", + "ServerTasksCapability": ".servertaskscapability", + "ServerTasksCapabilityTypedDict": ".servertaskscapability", + "ServerTasksRequestsCapability": ".servertasksrequestscapability", + "ServerTasksRequestsCapabilityTypedDict": ".servertasksrequestscapability", "ShareEnum": ".shareenum", "Sharing": ".sharing", "SharingTypedDict": ".sharing", @@ -4888,6 +5328,12 @@ "SystemMessageTypedDict": ".systemmessage", "SystemMessageContentChunks": ".systemmessagecontentchunks", "SystemMessageContentChunksTypedDict": ".systemmessagecontentchunks", + "TasksElicitationCapability": ".taskselicitationcapability", + "TasksElicitationCapabilityTypedDict": ".taskselicitationcapability", + "TasksSamplingCapability": ".taskssamplingcapability", + "TasksSamplingCapabilityTypedDict": ".taskssamplingcapability", + "TasksToolsCapability": ".taskstoolscapability", + "TasksToolsCapabilityTypedDict": ".taskstoolscapability", "TempoGetTraceResponse": ".tempogettraceresponse", "TempoGetTraceResponseTypedDict": ".tempogettraceresponse", "TempoTraceAttribute": ".tempotraceattribute", @@ -4955,6 +5401,12 @@ "TaskSupport": ".toolexecution", "ToolExecution": ".toolexecution", "ToolExecutionTypedDict": ".toolexecution", + "RequiresConfirmation": ".toolexecutionconfiguration", + "RequiresConfirmationTypedDict": ".toolexecutionconfiguration", + "SkipConfirmation": ".toolexecutionconfiguration", + "SkipConfirmationTypedDict": ".toolexecutionconfiguration", + "ToolExecutionConfiguration": ".toolexecutionconfiguration", + "ToolExecutionConfigurationTypedDict": ".toolexecutionconfiguration", "ToolExecutionDeltaEvent": ".toolexecutiondeltaevent", "ToolExecutionDeltaEventName": ".toolexecutiondeltaevent", "ToolExecutionDeltaEventNameTypedDict": ".toolexecutiondeltaevent", @@ -4979,11 +5431,14 @@ "ToolMessageContent": ".toolmessage", "ToolMessageContentTypedDict": ".toolmessage", "ToolMessageTypedDict": ".toolmessage", + "ToolProperties": ".toolproperties", + "ToolPropertiesTypedDict": ".toolproperties", "ToolReferenceChunk": ".toolreferencechunk", "ToolReferenceChunkTool": ".toolreferencechunk", "ToolReferenceChunkToolTypedDict": ".toolreferencechunk", "ToolReferenceChunkTypedDict": ".toolreferencechunk", - "ToolType": ".tooltype", + "ToolsCapability": ".toolscapability", + "ToolsCapabilityTypedDict": ".toolscapability", "TrainingFile": ".trainingfile", "TrainingFileTypedDict": ".trainingfile", "TranscriptionResponse": ".transcriptionresponse", @@ -5004,10 +5459,8 @@ "TranscriptionStreamSegmentDeltaTypedDict": ".transcriptionstreamsegmentdelta", "TranscriptionStreamTextDelta": ".transcriptionstreamtextdelta", "TranscriptionStreamTextDeltaTypedDict": ".transcriptionstreamtextdelta", - "TurbineToolLocale": ".turbinetoollocale", - "TurbineToolLocaleTypedDict": ".turbinetoollocale", - "TurbineToolMeta": ".turbinetoolmeta", - "TurbineToolMetaTypedDict": ".turbinetoolmeta", + "TurbineMeta": ".turbinemeta", + "TurbineMetaTypedDict": ".turbinemeta", "UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequest": ".unarchive_workflow_v1_workflows_workflow_identifier_unarchive_putop", "UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequestTypedDict": ".unarchive_workflow_v1_workflows_workflow_identifier_unarchive_putop", "UnarchiveModelResponse": ".unarchivemodelresponse", @@ -5024,6 +5477,8 @@ "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", + "UpdateScheduleV1WorkflowsSchedulesScheduleIDPatchRequest": ".update_schedule_v1_workflows_schedules_schedule_id_patchop", + "UpdateScheduleV1WorkflowsSchedulesScheduleIDPatchRequestTypedDict": ".update_schedule_v1_workflows_schedules_schedule_id_patchop", "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", @@ -5078,6 +5533,12 @@ "LocTypedDict": ".validationerror", "ValidationError": ".validationerror", "ValidationErrorTypedDict": ".validationerror", + "VespaSchemaResponse": ".vespaschemaresponse", + "VespaSchemaResponseTypedDict": ".vespaschemaresponse", + "VespaSearchIndexInfoResponse": ".vespasearchindexinforesponse", + "VespaSearchIndexInfoResponseTypedDict": ".vespasearchindexinforesponse", + "VoiceAppearance": ".voiceappearance", + "VoiceAppearanceTypedDict": ".voiceappearance", "VoiceCreateRequest": ".voicecreaterequest", "VoiceCreateRequestTypedDict": ".voicecreaterequest", "VoiceListResponse": ".voicelistresponse", @@ -5100,6 +5561,16 @@ "WorkflowArchiveResponseTypedDict": ".workflowarchiveresponse", "WorkflowBasicDefinition": ".workflowbasicdefinition", "WorkflowBasicDefinitionTypedDict": ".workflowbasicdefinition", + "WorkflowBulkArchiveRequest": ".workflowbulkarchiverequest", + "WorkflowBulkArchiveRequestTypedDict": ".workflowbulkarchiverequest", + "WorkflowBulkArchiveResponse": ".workflowbulkarchiveresponse", + "WorkflowBulkArchiveResponseTypedDict": ".workflowbulkarchiveresponse", + "WorkflowBulkError": ".workflowbulkerror", + "WorkflowBulkErrorTypedDict": ".workflowbulkerror", + "WorkflowBulkUnarchiveRequest": ".workflowbulkunarchiverequest", + "WorkflowBulkUnarchiveRequestTypedDict": ".workflowbulkunarchiverequest", + "WorkflowBulkUnarchiveResponse": ".workflowbulkunarchiveresponse", + "WorkflowBulkUnarchiveResponseTypedDict": ".workflowbulkunarchiveresponse", "WorkflowCodeDefinition": ".workflowcodedefinition", "WorkflowCodeDefinitionTypedDict": ".workflowcodedefinition", "WorkflowEventType": ".workfloweventtype", @@ -5174,6 +5645,8 @@ "WorkflowScheduleRequestTypedDict": ".workflowschedulerequest", "WorkflowScheduleResponse": ".workflowscheduleresponse", "WorkflowScheduleResponseTypedDict": ".workflowscheduleresponse", + "WorkflowScheduleUpdateRequest": ".workflowscheduleupdaterequest", + "WorkflowScheduleUpdateRequestTypedDict": ".workflowscheduleupdaterequest", "WorkflowTaskFailedAttributes": ".workflowtaskfailedattributes", "WorkflowTaskFailedAttributesTypedDict": ".workflowtaskfailedattributes", "WorkflowTaskFailedResponse": ".workflowtaskfailedresponse", diff --git a/src/mistralai/client/models/authenticationconfiguration.py b/src/mistralai/client/models/authenticationconfiguration.py index 84f66591..79c69641 100644 --- a/src/mistralai/client/models/authenticationconfiguration.py +++ b/src/mistralai/client/models/authenticationconfiguration.py @@ -2,6 +2,7 @@ # @generated-id: 97b5056c29fb from __future__ import annotations +from .consumertype import ConsumerType from .outboundauthenticationtype import OutboundAuthenticationType from mistralai.client.types import BaseModel, UNSET_SENTINEL from pydantic import model_serializer @@ -12,6 +13,7 @@ class AuthenticationConfigurationTypedDict(TypedDict): name: str authentication_type: OutboundAuthenticationType + scope: ConsumerType is_default: NotRequired[bool] @@ -20,6 +22,8 @@ class AuthenticationConfiguration(BaseModel): authentication_type: OutboundAuthenticationType + scope: ConsumerType + is_default: Optional[bool] = False @model_serializer(mode="wrap") diff --git a/src/mistralai/client/models/clientcapabilities.py b/src/mistralai/client/models/clientcapabilities.py new file mode 100644 index 00000000..77271160 --- /dev/null +++ b/src/mistralai/client/models/clientcapabilities.py @@ -0,0 +1,88 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b2ad660c5c9b + +from __future__ import annotations +from .clienttaskscapability import ClientTasksCapability, ClientTasksCapabilityTypedDict +from .elicitationcapability import ElicitationCapability, ElicitationCapabilityTypedDict +from .rootscapability import RootsCapability, RootsCapabilityTypedDict +from .samplingcapability import SamplingCapability, SamplingCapabilityTypedDict +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 ClientCapabilitiesTypedDict(TypedDict): + r"""Capabilities a client may support.""" + + experimental: NotRequired[Nullable[Dict[str, Dict[str, Any]]]] + sampling: NotRequired[Nullable[SamplingCapabilityTypedDict]] + elicitation: NotRequired[Nullable[ElicitationCapabilityTypedDict]] + roots: NotRequired[Nullable[RootsCapabilityTypedDict]] + tasks: NotRequired[Nullable[ClientTasksCapabilityTypedDict]] + + +class ClientCapabilities(BaseModel): + r"""Capabilities a client may support.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + experimental: OptionalNullable[Dict[str, Dict[str, Any]]] = UNSET + + sampling: OptionalNullable[SamplingCapability] = UNSET + + elicitation: OptionalNullable[ElicitationCapability] = UNSET + + roots: OptionalNullable[RootsCapability] = UNSET + + tasks: OptionalNullable[ClientTasksCapability] = 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( + ["experimental", "sampling", "elicitation", "roots", "tasks"] + ) + nullable_fields = set( + ["experimental", "sampling", "elicitation", "roots", "tasks"] + ) + serialized = 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/clienttaskscapability.py b/src/mistralai/client/models/clienttaskscapability.py new file mode 100644 index 00000000..5256c3d5 --- /dev/null +++ b/src/mistralai/client/models/clienttaskscapability.py @@ -0,0 +1,78 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 83aeca444b21 + +from __future__ import annotations +from .clienttasksrequestscapability import ( + ClientTasksRequestsCapability, + ClientTasksRequestsCapabilityTypedDict, +) +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 ClientTasksCapabilityTypedDict(TypedDict): + r"""Capability for client tasks operations.""" + + list: NotRequired[Nullable[Dict[str, Any]]] + cancel: NotRequired[Nullable[Dict[str, Any]]] + requests: NotRequired[Nullable[ClientTasksRequestsCapabilityTypedDict]] + + +class ClientTasksCapability(BaseModel): + r"""Capability for client tasks operations.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + list: OptionalNullable[Dict[str, Any]] = UNSET + + cancel: OptionalNullable[Dict[str, Any]] = UNSET + + requests: OptionalNullable[ClientTasksRequestsCapability] = 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(["list", "cancel", "requests"]) + nullable_fields = set(["list", "cancel", "requests"]) + serialized = 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/clienttasksrequestscapability.py b/src/mistralai/client/models/clienttasksrequestscapability.py new file mode 100644 index 00000000..38b9d6b1 --- /dev/null +++ b/src/mistralai/client/models/clienttasksrequestscapability.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 26148da505a0 + +from __future__ import annotations +from .taskselicitationcapability import ( + TasksElicitationCapability, + TasksElicitationCapabilityTypedDict, +) +from .taskssamplingcapability import ( + TasksSamplingCapability, + TasksSamplingCapabilityTypedDict, +) +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 ClientTasksRequestsCapabilityTypedDict(TypedDict): + r"""Capability for tasks requests operations.""" + + sampling: NotRequired[Nullable[TasksSamplingCapabilityTypedDict]] + elicitation: NotRequired[Nullable[TasksElicitationCapabilityTypedDict]] + + +class ClientTasksRequestsCapability(BaseModel): + r"""Capability for tasks requests operations.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + sampling: OptionalNullable[TasksSamplingCapability] = UNSET + + elicitation: OptionalNullable[TasksElicitationCapability] = 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(["sampling", "elicitation"]) + nullable_fields = set(["sampling", "elicitation"]) + serialized = 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/connectionconfigtype.py b/src/mistralai/client/models/connectionconfigtype.py new file mode 100644 index 00000000..9ad1bee1 --- /dev/null +++ b/src/mistralai/client/models/connectionconfigtype.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 52923bfd57d3 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ConnectionConfigType = Union[ + Literal[ + "mcp", + "turbine", + "eolienne", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/turbinetoolmeta.py b/src/mistralai/client/models/connectionpreference.py similarity index 56% rename from src/mistralai/client/models/turbinetoolmeta.py rename to src/mistralai/client/models/connectionpreference.py index bcd4d5f2..953ef17c 100644 --- a/src/mistralai/client/models/turbinetoolmeta.py +++ b/src/mistralai/client/models/connectionpreference.py @@ -1,9 +1,12 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -# @generated-id: cdb07c3837f7 +# @generated-id: 6b9389ac91e6 from __future__ import annotations -from .tooltype import ToolType -from .turbinetoollocale import TurbineToolLocale, TurbineToolLocaleTypedDict +from .consumertype import ConsumerType +from .toolexecutionconfiguration import ( + ToolExecutionConfiguration, + ToolExecutionConfigurationTypedDict, +) from mistralai.client.types import ( BaseModel, Nullable, @@ -15,26 +18,26 @@ 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 ConnectionPreferenceTypedDict(TypedDict): + name: str + tool_configuration: ToolExecutionConfigurationTypedDict + is_default: NotRequired[Nullable[bool]] + consumer_type: NotRequired[Nullable[ConsumerType]] -class TurbineToolMeta(BaseModel): - locale: OptionalNullable[TurbineToolLocale] = UNSET +class ConnectionPreference(BaseModel): + name: str - tool_type: OptionalNullable[ToolType] = UNSET + tool_configuration: ToolExecutionConfiguration - timeout: OptionalNullable[float] = UNSET + is_default: OptionalNullable[bool] = UNSET - private_execution: OptionalNullable[bool] = UNSET + consumer_type: OptionalNullable[ConsumerType] = 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"]) + optional_fields = set(["is_default", "consumer_type"]) + nullable_fields = set(["is_default", "consumer_type"]) serialized = handler(self) m = {} diff --git a/src/mistralai/client/models/connector.py b/src/mistralai/client/models/connector.py index 9d8b6000..ce9e0837 100644 --- a/src/mistralai/client/models/connector.py +++ b/src/mistralai/client/models/connector.py @@ -2,6 +2,25 @@ # @generated-id: 1a4facac922d from __future__ import annotations +from .authenticationconfiguration import ( + AuthenticationConfiguration, + AuthenticationConfigurationTypedDict, +) +from .connectionpreference import ConnectionPreference, ConnectionPreferenceTypedDict +from .connectorlocale import ConnectorLocale, ConnectorLocaleTypedDict +from .connectorprotocol import ConnectorProtocol +from .connectortool import ConnectorTool, ConnectorToolTypedDict +from .mcpservercard import MCPServerCard, MCPServerCardTypedDict +from .publicauthenticationmethod import ( + PublicAuthenticationMethod, + PublicAuthenticationMethodTypedDict, +) +from .publicconnectionconfig import ( + PublicConnectionConfig, + PublicConnectionConfigTypedDict, +) +from .resourcetype import ResourceType +from .resourcevisibility import ResourceVisibility from datetime import datetime from mistralai.client.types import ( BaseModel, @@ -11,6 +30,7 @@ UNSET_SENTINEL, ) from pydantic import model_serializer +from typing import List, Optional from typing_extensions import NotRequired, TypedDict @@ -20,9 +40,30 @@ class ConnectorTypedDict(TypedDict): description: str created_at: datetime modified_at: datetime + owner_type: ResourceType + visibility: ResourceVisibility + private_tool_execution: bool title: NotRequired[Nullable[str]] server: NotRequired[Nullable[str]] - auth_type: NotRequired[Nullable[str]] + protocol: NotRequired[ConnectorProtocol] + icon_url: NotRequired[Nullable[str]] + server_card: NotRequired[Nullable[MCPServerCardTypedDict]] + owner_id: NotRequired[Nullable[str]] + locale: NotRequired[Nullable[ConnectorLocaleTypedDict]] + system_prompt: NotRequired[Nullable[str]] + supported_auth_methods: NotRequired[ + Nullable[List[PublicAuthenticationMethodTypedDict]] + ] + connection_preferences: NotRequired[Nullable[List[ConnectionPreferenceTypedDict]]] + connection_credentials: NotRequired[ + Nullable[List[AuthenticationConfigurationTypedDict]] + ] + active: NotRequired[Nullable[bool]] + mistral: NotRequired[bool] + is_authenticated: NotRequired[Nullable[bool]] + tools: NotRequired[Nullable[List[ConnectorToolTypedDict]]] + system_prompt_route: NotRequired[Nullable[str]] + connection_config: NotRequired[Nullable[PublicConnectionConfigTypedDict]] class Connector(BaseModel): @@ -36,16 +77,88 @@ class Connector(BaseModel): modified_at: datetime + owner_type: ResourceType + + visibility: ResourceVisibility + + private_tool_execution: bool + title: OptionalNullable[str] = UNSET server: OptionalNullable[str] = UNSET - auth_type: OptionalNullable[str] = UNSET + protocol: Optional[ConnectorProtocol] = None + + icon_url: OptionalNullable[str] = UNSET + + server_card: OptionalNullable[MCPServerCard] = UNSET + + owner_id: OptionalNullable[str] = UNSET + + locale: OptionalNullable[ConnectorLocale] = UNSET + + system_prompt: OptionalNullable[str] = UNSET + + supported_auth_methods: OptionalNullable[List[PublicAuthenticationMethod]] = UNSET + + connection_preferences: OptionalNullable[List[ConnectionPreference]] = UNSET + + connection_credentials: OptionalNullable[List[AuthenticationConfiguration]] = UNSET + + active: OptionalNullable[bool] = UNSET + + mistral: Optional[bool] = False + + is_authenticated: OptionalNullable[bool] = UNSET + + tools: OptionalNullable[List[ConnectorTool]] = UNSET + + system_prompt_route: OptionalNullable[str] = UNSET + + connection_config: OptionalNullable[PublicConnectionConfig] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["title", "server", "auth_type"]) - nullable_fields = set(["title", "server", "auth_type"]) + optional_fields = set( + [ + "title", + "server", + "protocol", + "icon_url", + "server_card", + "owner_id", + "locale", + "system_prompt", + "supported_auth_methods", + "connection_preferences", + "connection_credentials", + "active", + "mistral", + "is_authenticated", + "tools", + "system_prompt_route", + "connection_config", + ] + ) + nullable_fields = set( + [ + "title", + "server", + "icon_url", + "server_card", + "owner_id", + "locale", + "system_prompt", + "supported_auth_methods", + "connection_preferences", + "connection_credentials", + "active", + "is_authenticated", + "tools", + "system_prompt_route", + "connection_config", + ] + ) serialized = handler(self) m = {} diff --git a/src/mistralai/client/models/connector_activate_for_organization_v1op.py b/src/mistralai/client/models/connector_activate_for_organization_v1op.py new file mode 100644 index 00000000..1b0ec3b0 --- /dev/null +++ b/src/mistralai/client/models/connector_activate_for_organization_v1op.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9b35397dd5cc + +from __future__ import annotations +from .toolexecutionconfiguration import ( + ToolExecutionConfiguration, + ToolExecutionConfigurationTypedDict, +) +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 ConnectorActivateForOrganizationV1RequestTypedDict(TypedDict): + connector_id: str + tool_execution_configuration: NotRequired[ + Nullable[ToolExecutionConfigurationTypedDict] + ] + + +class ConnectorActivateForOrganizationV1Request(BaseModel): + connector_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + tool_execution_configuration: Annotated[ + OptionalNullable[ToolExecutionConfiguration], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["ToolExecutionConfiguration"]) + nullable_fields = set(["ToolExecutionConfiguration"]) + serialized = 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_activate_for_user_v1op.py b/src/mistralai/client/models/connector_activate_for_user_v1op.py new file mode 100644 index 00000000..e30126d4 --- /dev/null +++ b/src/mistralai/client/models/connector_activate_for_user_v1op.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6bf45c78cfea + +from __future__ import annotations +from .toolexecutionconfiguration import ( + ToolExecutionConfiguration, + ToolExecutionConfigurationTypedDict, +) +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 ConnectorActivateForUserV1RequestTypedDict(TypedDict): + connector_id: str + tool_execution_configuration: NotRequired[ + Nullable[ToolExecutionConfigurationTypedDict] + ] + + +class ConnectorActivateForUserV1Request(BaseModel): + connector_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + tool_execution_configuration: Annotated[ + OptionalNullable[ToolExecutionConfiguration], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["ToolExecutionConfiguration"]) + nullable_fields = set(["ToolExecutionConfiguration"]) + serialized = 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_activate_for_workspace_v1op.py b/src/mistralai/client/models/connector_activate_for_workspace_v1op.py new file mode 100644 index 00000000..00fe6699 --- /dev/null +++ b/src/mistralai/client/models/connector_activate_for_workspace_v1op.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b6392712ddaf + +from __future__ import annotations +from .toolexecutionconfiguration import ( + ToolExecutionConfiguration, + ToolExecutionConfigurationTypedDict, +) +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 ConnectorActivateForWorkspaceV1RequestTypedDict(TypedDict): + connector_id: str + tool_execution_configuration: NotRequired[ + Nullable[ToolExecutionConfigurationTypedDict] + ] + + +class ConnectorActivateForWorkspaceV1Request(BaseModel): + connector_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + tool_execution_configuration: Annotated[ + OptionalNullable[ToolExecutionConfiguration], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["ToolExecutionConfiguration"]) + nullable_fields = set(["ToolExecutionConfiguration"]) + serialized = 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_deactivate_for_organization_v1op.py b/src/mistralai/client/models/connector_deactivate_for_organization_v1op.py new file mode 100644 index 00000000..4c5c5458 --- /dev/null +++ b/src/mistralai/client/models/connector_deactivate_for_organization_v1op.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 850bece829b0 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class ConnectorDeactivateForOrganizationV1RequestTypedDict(TypedDict): + connector_id: str + + +class ConnectorDeactivateForOrganizationV1Request(BaseModel): + connector_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/connector_deactivate_for_user_v1op.py b/src/mistralai/client/models/connector_deactivate_for_user_v1op.py new file mode 100644 index 00000000..5d998877 --- /dev/null +++ b/src/mistralai/client/models/connector_deactivate_for_user_v1op.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1df4227a54f7 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class ConnectorDeactivateForUserV1RequestTypedDict(TypedDict): + connector_id: str + + +class ConnectorDeactivateForUserV1Request(BaseModel): + connector_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/connector_deactivate_for_workspace_v1op.py b/src/mistralai/client/models/connector_deactivate_for_workspace_v1op.py new file mode 100644 index 00000000..9f02d887 --- /dev/null +++ b/src/mistralai/client/models/connector_deactivate_for_workspace_v1op.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d82c1a5321cc + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class ConnectorDeactivateForWorkspaceV1RequestTypedDict(TypedDict): + connector_id: str + + +class ConnectorDeactivateForWorkspaceV1Request(BaseModel): + connector_id: 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 index 780afac9..beb27872 100644 --- a/src/mistralai/client/models/connector_get_v1op.py +++ b/src/mistralai/client/models/connector_get_v1op.py @@ -11,10 +11,10 @@ class ConnectorGetV1RequestTypedDict(TypedDict): connector_id_or_name: str + fetch_user_data: NotRequired[bool] + r"""Fetch the user-level data associated with the connector (e.g. connection credentials).""" 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): @@ -22,21 +22,21 @@ class ConnectorGetV1Request(BaseModel): str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] - fetch_customer_data: Annotated[ + fetch_user_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).""" + r"""Fetch the user-level data associated with the connector (e.g. connection credentials).""" - fetch_connection_secrets: Annotated[ + fetch_customer_data: Annotated[ Optional[bool], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = False - r"""Fetch the general connection secrets associated with the connector.""" + r"""Fetch the customer data associated with the connector (e.g. customer secrets / config).""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["fetch_customer_data", "fetch_connection_secrets"]) + optional_fields = set(["fetch_user_data", "fetch_customer_data"]) serialized = handler(self) m = {} diff --git a/src/mistralai/client/models/connectorlocale.py b/src/mistralai/client/models/connectorlocale.py new file mode 100644 index 00000000..373e9e84 --- /dev/null +++ b/src/mistralai/client/models/connectorlocale.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f987f5207d2e + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import Dict +from typing_extensions import TypedDict + + +class ConnectorLocaleTypedDict(TypedDict): + name: Dict[str, str] + description: Dict[str, str] + usage_sentence: Dict[str, str] + + +class ConnectorLocale(BaseModel): + name: Dict[str, str] + + description: Dict[str, str] + + usage_sentence: Dict[str, str] diff --git a/src/mistralai/client/models/tooltype.py b/src/mistralai/client/models/connectorprotocol.py similarity index 67% rename from src/mistralai/client/models/tooltype.py rename to src/mistralai/client/models/connectorprotocol.py index 1a7781fc..042f2352 100644 --- a/src/mistralai/client/models/tooltype.py +++ b/src/mistralai/client/models/connectorprotocol.py @@ -1,17 +1,16 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -# @generated-id: cbe8c44aee50 +# @generated-id: c35853b1b79f from __future__ import annotations from mistralai.client.types import UnrecognizedStr from typing import Literal, Union -ToolType = Union[ +ConnectorProtocol = Union[ Literal[ - "rag", - "image", - "code", - "event", + "mcp", + "http", + "turbine", ], UnrecognizedStr, ] diff --git a/src/mistralai/client/models/connectorsqueryfilters.py b/src/mistralai/client/models/connectorsqueryfilters.py index f10d6897..860caf43 100644 --- a/src/mistralai/client/models/connectorsqueryfilters.py +++ b/src/mistralai/client/models/connectorsqueryfilters.py @@ -11,29 +11,21 @@ ) 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"]) + optional_fields = set(["active"]) nullable_fields = set(["active"]) serialized = handler(self) m = {} diff --git a/src/mistralai/client/models/consumertype.py b/src/mistralai/client/models/consumertype.py new file mode 100644 index 00000000..ac091e5e --- /dev/null +++ b/src/mistralai/client/models/consumertype.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d18230da2fdd + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ConsumerType = Union[ + Literal[ + "user", + "org", + "workspace", + "system", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/createconnectorrequest.py b/src/mistralai/client/models/createconnectorrequest.py index 18060ca3..ac732104 100644 --- a/src/mistralai/client/models/createconnectorrequest.py +++ b/src/mistralai/client/models/createconnectorrequest.py @@ -11,9 +11,12 @@ UNSET, UNSET_SENTINEL, ) +from mistralai.client.utils import validate_const +import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional -from typing_extensions import NotRequired, TypedDict +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class CreateConnectorRequestTypedDict(TypedDict): @@ -23,6 +26,7 @@ class CreateConnectorRequestTypedDict(TypedDict): r"""The description of the connector.""" server: str r"""The url of the MCP server.""" + protocol: Literal["mcp"] title: NotRequired[Nullable[str]] r"""Optional human-readable title for the connector.""" icon_url: NotRequired[Nullable[str]] @@ -46,6 +50,11 @@ class CreateConnectorRequest(BaseModel): server: str r"""The url of the MCP server.""" + protocol: Annotated[ + Annotated[Optional[Literal["mcp"]], AfterValidator(validate_const("mcp"))], + pydantic.Field(alias="protocol"), + ] = "mcp" + title: OptionalNullable[str] = UNSET r"""Optional human-readable title for the connector.""" @@ -66,7 +75,15 @@ class CreateConnectorRequest(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["title", "icon_url", "visibility", "headers", "auth_data", "system_prompt"] + [ + "protocol", + "title", + "icon_url", + "visibility", + "headers", + "auth_data", + "system_prompt", + ] ) nullable_fields = set( ["title", "icon_url", "headers", "auth_data", "system_prompt"] @@ -91,3 +108,9 @@ def serialize_model(self, handler): m[k] = val return m + + +try: + CreateConnectorRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/createlibraryrequest.py b/src/mistralai/client/models/createlibraryrequest.py index e0357e92..2bbb1e18 100644 --- a/src/mistralai/client/models/createlibraryrequest.py +++ b/src/mistralai/client/models/createlibraryrequest.py @@ -9,9 +9,10 @@ UNSET, UNSET_SENTINEL, ) +import pydantic from pydantic import model_serializer from typing import Literal -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Annotated, NotRequired, TypedDict OwnerType = Literal[ @@ -34,7 +35,12 @@ class CreateLibraryRequest(BaseModel): description: OptionalNullable[str] = UNSET - chunk_size: OptionalNullable[int] = UNSET + chunk_size: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = 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 diff --git a/src/mistralai/client/models/createsearchindexinforequest.py b/src/mistralai/client/models/createsearchindexinforequest.py new file mode 100644 index 00000000..f527f72d --- /dev/null +++ b/src/mistralai/client/models/createsearchindexinforequest.py @@ -0,0 +1,72 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3f424a7063b0 + +from __future__ import annotations +from .createvespasearchindexinforequest import ( + CreateVespaSearchIndexInfoRequest, + CreateVespaSearchIndexInfoRequestTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +CreateSearchIndexInfoRequestStatus = Literal[ + "online", + "offline", +] + + +CreateSearchIndexInfoRequestIndexTypedDict = CreateVespaSearchIndexInfoRequestTypedDict + + +CreateSearchIndexInfoRequestIndex = CreateVespaSearchIndexInfoRequest + + +class CreateSearchIndexInfoRequestTypedDict(TypedDict): + name: str + index: CreateSearchIndexInfoRequestIndexTypedDict + document_count: NotRequired[Nullable[int]] + status: NotRequired[CreateSearchIndexInfoRequestStatus] + + +class CreateSearchIndexInfoRequest(BaseModel): + name: str + + index: CreateSearchIndexInfoRequestIndex + + document_count: OptionalNullable[int] = UNSET + + status: Optional[CreateSearchIndexInfoRequestStatus] = "offline" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["document_count", "status"]) + nullable_fields = set(["document_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)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + 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/createvespaschemarequest.py b/src/mistralai/client/models/createvespaschemarequest.py new file mode 100644 index 00000000..cac99bc3 --- /dev/null +++ b/src/mistralai/client/models/createvespaschemarequest.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d44c0c466535 + +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 CreateVespaSchemaRequestTypedDict(TypedDict): + name: str + document_count: NotRequired[Nullable[int]] + + +class CreateVespaSchemaRequest(BaseModel): + name: str + + document_count: OptionalNullable[int] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["document_count"]) + nullable_fields = set(["document_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)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + 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/createvespasearchindexinforequest.py b/src/mistralai/client/models/createvespasearchindexinforequest.py new file mode 100644 index 00000000..50006d38 --- /dev/null +++ b/src/mistralai/client/models/createvespasearchindexinforequest.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 866143560866 + +from __future__ import annotations +from .createvespaschemarequest import ( + CreateVespaSchemaRequest, + CreateVespaSchemaRequestTypedDict, +) +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 CreateVespaSearchIndexInfoRequestTypedDict(TypedDict): + k8s_cluster: str + k8s_namespace: str + vespa_instance_name: str + schemas: List[CreateVespaSchemaRequestTypedDict] + type: Literal["vespa"] + + +class CreateVespaSearchIndexInfoRequest(BaseModel): + k8s_cluster: str + + k8s_namespace: str + + vespa_instance_name: str + + schemas: List[CreateVespaSchemaRequest] + + type: Annotated[ + Annotated[Literal["vespa"], AfterValidator(validate_const("vespa"))], + pydantic.Field(alias="type"), + ] = "vespa" + + +try: + CreateVespaSearchIndexInfoRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/document.py b/src/mistralai/client/models/document.py index 8d1aea88..c04512c1 100644 --- a/src/mistralai/client/models/document.py +++ b/src/mistralai/client/models/document.py @@ -11,9 +11,10 @@ UNSET, UNSET_SENTINEL, ) +import pydantic from pydantic import model_serializer from typing import Any, Dict -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Annotated, NotRequired, TypedDict class DocumentTypedDict(TypedDict): @@ -37,6 +38,8 @@ class DocumentTypedDict(TypedDict): tokens_processing_summary: NotRequired[Nullable[int]] url: NotRequired[Nullable[str]] attributes: NotRequired[Nullable[Dict[str, Any]]] + expires_at: NotRequired[Nullable[datetime]] + r"""If set, the document will be automatically deleted after this date.""" class Document(BaseModel): @@ -44,7 +47,12 @@ class Document(BaseModel): library_id: str - hash: Nullable[str] + hash: Annotated[ + Nullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] mime_type: Nullable[str] @@ -62,7 +70,12 @@ class Document(BaseModel): uploaded_by_type: str - processing_status: str + processing_status: Annotated[ + str, + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] tokens_processing_total: int @@ -72,14 +85,27 @@ class Document(BaseModel): number_of_pages: OptionalNullable[int] = UNSET - tokens_processing_main_content: OptionalNullable[int] = UNSET + tokens_processing_main_content: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = UNSET - tokens_processing_summary: OptionalNullable[int] = UNSET + tokens_processing_summary: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = UNSET url: OptionalNullable[str] = UNSET attributes: OptionalNullable[Dict[str, Any]] = UNSET + expires_at: OptionalNullable[datetime] = UNSET + r"""If set, the document will be automatically deleted after this date.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -91,6 +117,7 @@ def serialize_model(self, handler): "tokens_processing_summary", "url", "attributes", + "expires_at", ] ) nullable_fields = set( @@ -107,6 +134,7 @@ def serialize_model(self, handler): "tokens_processing_summary", "url", "attributes", + "expires_at", ] ) serialized = handler(self) diff --git a/src/mistralai/client/models/elicitationcapability.py b/src/mistralai/client/models/elicitationcapability.py new file mode 100644 index 00000000..12808436 --- /dev/null +++ b/src/mistralai/client/models/elicitationcapability.py @@ -0,0 +1,77 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 63a9b5cfa2f2 + +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 NotRequired, TypedDict + + +class ElicitationCapabilityTypedDict(TypedDict): + r"""Capability for elicitation operations. + + Clients must support at least one mode (form or url). + """ + + form: NotRequired[Nullable[Dict[str, Any]]] + url: NotRequired[Nullable[Dict[str, Any]]] + + +class ElicitationCapability(BaseModel): + r"""Capability for elicitation operations. + + Clients must support at least one mode (form or url). + """ + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + form: OptionalNullable[Dict[str, Any]] = UNSET + + url: OptionalNullable[Dict[str, Any]] = 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(["form", "url"]) + nullable_fields = set(["form", "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)) + 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/encryptedpatchvalue.py b/src/mistralai/client/models/encryptedpatchvalue.py new file mode 100644 index 00000000..970bd59b --- /dev/null +++ b/src/mistralai/client/models/encryptedpatchvalue.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 311803d1f28e + +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 EncryptedPatchValueTypedDict(TypedDict): + r"""Wrapper for encrypted patch values in selective json_patch encryption. + + When partial encryption mode is enabled and a patch targets an EncryptedStrField, + the patch value is encrypted and wrapped in this structure. + + The type field acts as a discriminator to distinguish this from user data. + """ + + value: str + type: Literal["__encrypted__"] + + +class EncryptedPatchValue(BaseModel): + r"""Wrapper for encrypted patch values in selective json_patch encryption. + + When partial encryption mode is enabled and a patch targets an EncryptedStrField, + the patch value is encrypted and wrapped in this structure. + + The type field acts as a discriminator to distinguish this from user data. + """ + + value: str + + type: Annotated[ + Annotated[ + Literal["__encrypted__"], AfterValidator(validate_const("__encrypted__")) + ], + pydantic.Field(alias="type"), + ] = "__encrypted__" + + +try: + EncryptedPatchValue.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/filtergroup.py b/src/mistralai/client/models/filtergroup.py index 4e9815b7..3439df66 100644 --- a/src/mistralai/client/models/filtergroup.py +++ b/src/mistralai/client/models/filtergroup.py @@ -16,6 +16,14 @@ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict +OrTypedDict = TypeAliasType( + "OrTypedDict", Union["FilterGroupTypedDict", FilterConditionTypedDict] +) + + +Or = TypeAliasType("Or", Union["FilterGroup", FilterCondition]) + + class FilterGroupTypedDict(TypedDict): and_: NotRequired[Nullable[List[AndTypedDict]]] or_: NotRequired[Nullable[List[OrTypedDict]]] @@ -52,14 +60,6 @@ def serialize_model(self, handler): return m -OrTypedDict = TypeAliasType( - "OrTypedDict", Union["FilterGroupTypedDict", FilterConditionTypedDict] -) - - -Or = TypeAliasType("Or", Union["FilterGroup", FilterCondition]) - - AndTypedDict = TypeAliasType( "AndTypedDict", Union["FilterGroupTypedDict", FilterConditionTypedDict] ) diff --git a/src/mistralai/client/models/get_schedule_v1_workflows_schedules_schedule_id_getop.py b/src/mistralai/client/models/get_schedule_v1_workflows_schedules_schedule_id_getop.py new file mode 100644 index 00000000..d22d0515 --- /dev/null +++ b/src/mistralai/client/models/get_schedule_v1_workflows_schedules_schedule_id_getop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cb775bc63ffd + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetScheduleV1WorkflowsSchedulesScheduleIDGetRequestTypedDict(TypedDict): + schedule_id: str + + +class GetScheduleV1WorkflowsSchedulesScheduleIDGetRequest(BaseModel): + schedule_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_schedules_v1_workflows_schedules_getop.py b/src/mistralai/client/models/get_schedules_v1_workflows_schedules_getop.py new file mode 100644 index 00000000..62f8ece2 --- /dev/null +++ b/src/mistralai/client/models/get_schedules_v1_workflows_schedules_getop.py @@ -0,0 +1,113 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b5f0210eca23 + +from __future__ import annotations +from .workflowschedulelistresponse import ( + WorkflowScheduleListResponse, + WorkflowScheduleListResponseTypedDict, +) +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, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +GetSchedulesV1WorkflowsSchedulesGetStatus = Literal[ + "active", + "paused", +] +r"""Filter by schedule status: 'active' or 'paused'""" + + +class GetSchedulesV1WorkflowsSchedulesGetRequestTypedDict(TypedDict): + workflow_name: NotRequired[Nullable[str]] + r"""Filter by workflow name""" + user_id: NotRequired[Nullable[str]] + r"""Filter by user ID. Pass 'current' to resolve to the authenticated user's ID.""" + status: NotRequired[Nullable[GetSchedulesV1WorkflowsSchedulesGetStatus]] + r"""Filter by schedule status: 'active' or 'paused'""" + page_size: NotRequired[Nullable[int]] + r"""Number of items per page. Omitting this parameter fetches all results at once (deprecated — pass page_size to use pagination).""" + next_page_token: NotRequired[Nullable[str]] + r"""Token for the next page of results""" + + +class GetSchedulesV1WorkflowsSchedulesGetRequest(BaseModel): + workflow_name: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by workflow name""" + + user_id: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by user ID. Pass 'current' to resolve to the authenticated user's ID.""" + + status: Annotated[ + OptionalNullable[GetSchedulesV1WorkflowsSchedulesGetStatus], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by schedule status: 'active' or 'paused'""" + + page_size: Annotated[ + OptionalNullable[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Number of items per page. Omitting this parameter fetches all results at once (deprecated — pass page_size to use pagination).""" + + 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_name", "user_id", "status", "page_size", "next_page_token"] + ) + nullable_fields = set( + ["workflow_name", "user_id", "status", "page_size", "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 GetSchedulesV1WorkflowsSchedulesGetResponseTypedDict(TypedDict): + result: WorkflowScheduleListResponseTypedDict + + +class GetSchedulesV1WorkflowsSchedulesGetResponse(BaseModel): + next: Union[ + Callable[[], Optional[GetSchedulesV1WorkflowsSchedulesGetResponse]], + Callable[[], Awaitable[Optional[GetSchedulesV1WorkflowsSchedulesGetResponse]]], + ] + + result: WorkflowScheduleListResponse diff --git a/src/mistralai/client/models/jsonpatchappend.py b/src/mistralai/client/models/jsonpatchappend.py index 7181ddac..185f7bb7 100644 --- a/src/mistralai/client/models/jsonpatchappend.py +++ b/src/mistralai/client/models/jsonpatchappend.py @@ -2,19 +2,32 @@ # @generated-id: 61801f21f4b0 from __future__ import annotations +from .encryptedpatchvalue import EncryptedPatchValue, EncryptedPatchValueTypedDict 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 +from typing import Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +JSONPatchAppendValueTypedDict = TypeAliasType( + "JSONPatchAppendValueTypedDict", Union[EncryptedPatchValueTypedDict, str] +) +r"""The value to use for the operation. A string to append to the existing value, or an EncryptedPatchValue wrapper when encryption is applied.""" + + +JSONPatchAppendValue = TypeAliasType( + "JSONPatchAppendValue", Union[EncryptedPatchValue, str] +) +r"""The value to use for the operation. A string to append to the existing value, or an EncryptedPatchValue wrapper when encryption is applied.""" 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""" + value: JSONPatchAppendValueTypedDict + r"""The value to use for the operation. A string to append to the existing value, or an EncryptedPatchValue wrapper when encryption is applied.""" op: Literal["append"] r"""'append' is an extension for efficient string concatenation in streaming scenarios.""" @@ -23,8 +36,8 @@ 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""" + value: JSONPatchAppendValue + r"""The value to use for the operation. A string to append to the existing value, or an EncryptedPatchValue wrapper when encryption is applied.""" op: Annotated[ Annotated[Literal["append"], AfterValidator(validate_const("append"))], diff --git a/src/mistralai/client/models/libraries_documents_list_v1op.py b/src/mistralai/client/models/libraries_documents_list_v1op.py index afc474cb..57e2736b 100644 --- a/src/mistralai/client/models/libraries_documents_list_v1op.py +++ b/src/mistralai/client/models/libraries_documents_list_v1op.py @@ -10,6 +10,7 @@ UNSET_SENTINEL, ) from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +import pydantic from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -21,6 +22,7 @@ class LibrariesDocumentsListV1RequestTypedDict(TypedDict): page_size: NotRequired[int] page: NotRequired[int] filters_attributes: NotRequired[Nullable[str]] + r"""Deprecated: this parameter will be removed in a future version.""" sort_by: NotRequired[str] sort_order: NotRequired[str] @@ -47,8 +49,12 @@ class LibrariesDocumentsListV1Request(BaseModel): filters_attributes: 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." + ), FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = UNSET + r"""Deprecated: this parameter will be removed in a future version.""" sort_by: Annotated[ Optional[str], diff --git a/src/mistralai/client/models/libraries_documents_patch_v1op.py b/src/mistralai/client/models/libraries_documents_patch_v1op.py new file mode 100644 index 00000000..0ae4efaf --- /dev/null +++ b/src/mistralai/client/models/libraries_documents_patch_v1op.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 31b2201bbfe2 + +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 LibrariesDocumentsPatchV1RequestTypedDict(TypedDict): + library_id: str + document_id: str + update_document_request: UpdateDocumentRequestTypedDict + + +class LibrariesDocumentsPatchV1Request(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/client/models/libraries_list_v1op.py b/src/mistralai/client/models/libraries_list_v1op.py index cac06dad..328ac72c 100644 --- a/src/mistralai/client/models/libraries_list_v1op.py +++ b/src/mistralai/client/models/libraries_list_v1op.py @@ -10,6 +10,7 @@ UNSET_SENTINEL, ) from mistralai.client.utils import FieldMetadata, QueryParamMetadata +import pydantic from pydantic import model_serializer from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -21,7 +22,7 @@ class LibrariesListV1RequestTypedDict(TypedDict): 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.""" + r"""Deprecated: this parameter will be removed in a future version.""" class LibrariesListV1Request(BaseModel): @@ -43,9 +44,12 @@ class LibrariesListV1Request(BaseModel): filter_owned_by_me: Annotated[ OptionalNullable[bool], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), 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.""" + r"""Deprecated: this parameter will be removed in a future version.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/mistralai/client/models/libraries_patch_v1op.py b/src/mistralai/client/models/libraries_patch_v1op.py new file mode 100644 index 00000000..2fbaea67 --- /dev/null +++ b/src/mistralai/client/models/libraries_patch_v1op.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2b189be3c57a + +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 LibrariesPatchV1RequestTypedDict(TypedDict): + library_id: str + update_library_request: UpdateLibraryRequestTypedDict + + +class LibrariesPatchV1Request(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 index 0e09cfaa..4ec8604c 100644 --- a/src/mistralai/client/models/library.py +++ b/src/mistralai/client/models/library.py @@ -52,17 +52,42 @@ class Library(BaseModel): nb_documents: int - chunk_size: Nullable[int] + chunk_size: Annotated[ + Nullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] - emoji: OptionalNullable[str] = UNSET + emoji: 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 description: OptionalNullable[str] = UNSET - generated_description: OptionalNullable[str] = UNSET + generated_description: 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 - explicit_user_members_count: OptionalNullable[int] = UNSET + explicit_user_members_count: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = UNSET - explicit_workspace_members_count: OptionalNullable[int] = UNSET + explicit_workspace_members_count: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = UNSET org_sharing_role: Annotated[ OptionalNullable[str], @@ -71,7 +96,12 @@ class Library(BaseModel): ), ] = UNSET - generated_name: OptionalNullable[str] = UNSET + generated_name: 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"""Generated Name""" @model_serializer(mode="wrap") diff --git a/src/mistralai/client/models/logicalexpression.py b/src/mistralai/client/models/logicalexpression.py new file mode 100644 index 00000000..1b87693c --- /dev/null +++ b/src/mistralai/client/models/logicalexpression.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 48d46c10b453 + +from __future__ import annotations +from .toolproperties import ToolProperties, ToolPropertiesTypedDict +from mistralai.client.types import BaseModel, UnrecognizedStr +from typing import List, Literal, Union +from typing_extensions import TypeAliasType, TypedDict + + +LogicalExpressionType = Union[ + Literal[ + "and", + "or", + ], + UnrecognizedStr, +] + + +class LogicalExpressionTypedDict(TypedDict): + type: LogicalExpressionType + expressions: List[ExpressionTypedDict] + + +class LogicalExpression(BaseModel): + type: LogicalExpressionType + + expressions: List[Expression] + + +ExpressionTypedDict = TypeAliasType( + "ExpressionTypedDict", + Union[ToolPropertiesTypedDict, "LogicalExpressionTypedDict", List[str]], +) + + +Expression = TypeAliasType( + "Expression", Union[ToolProperties, "LogicalExpression", List[str]] +) diff --git a/src/mistralai/client/models/mcpprompt.py b/src/mistralai/client/models/mcpprompt.py new file mode 100644 index 00000000..fd5fb0d8 --- /dev/null +++ b/src/mistralai/client/models/mcpprompt.py @@ -0,0 +1,89 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: eac4133413b2 + +from __future__ import annotations +from .mcpservericon import MCPServerIcon, MCPServerIconTypedDict +from .promptargument import PromptArgument, PromptArgumentTypedDict +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 MCPPromptTypedDict(TypedDict): + name: str + title: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + arguments: NotRequired[Nullable[List[PromptArgumentTypedDict]]] + icons: NotRequired[Nullable[List[MCPServerIconTypedDict]]] + meta: NotRequired[Nullable[Dict[str, Any]]] + + +class MCPPrompt(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 + + title: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + arguments: OptionalNullable[List[PromptArgument]] = UNSET + + icons: OptionalNullable[List[MCPServerIcon]] = 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(["title", "description", "arguments", "icons", "_meta"]) + nullable_fields = set(["title", "description", "arguments", "icons", "_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: + MCPPrompt.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/mcpresource.py b/src/mistralai/client/models/mcpresource.py new file mode 100644 index 00000000..77df5857 --- /dev/null +++ b/src/mistralai/client/models/mcpresource.py @@ -0,0 +1,120 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4922063d1d29 + +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, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, List +from typing_extensions import Annotated, NotRequired, TypedDict + + +class MCPResourceTypedDict(TypedDict): + 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]]] + + +class MCPResource(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 + + 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 + ) + + @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: + MCPResource.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/mcpserverauthenticationrequirement.py b/src/mistralai/client/models/mcpserverauthenticationrequirement.py new file mode 100644 index 00000000..280315a7 --- /dev/null +++ b/src/mistralai/client/models/mcpserverauthenticationrequirement.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 688772457c1d + +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 MCPServerAuthenticationRequirementTypedDict(TypedDict): + r"""Authentication requirements for a remote transport (SEP-2127).""" + + required: bool + r"""Whether authentication is mandatory""" + schemes: NotRequired[List[str]] + r"""Supported schemes (e.g. ['bearer', 'oauth2'])""" + + +class MCPServerAuthenticationRequirement(BaseModel): + r"""Authentication requirements for a remote transport (SEP-2127).""" + + required: bool + r"""Whether authentication is mandatory""" + + schemes: Optional[List[str]] = None + r"""Supported schemes (e.g. ['bearer', 'oauth2'])""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["schemes"]) + serialized = 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/mcpservercard.py b/src/mistralai/client/models/mcpservercard.py new file mode 100644 index 00000000..3e66b954 --- /dev/null +++ b/src/mistralai/client/models/mcpservercard.py @@ -0,0 +1,188 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3d8e787f97f3 + +from __future__ import annotations +from .clientcapabilities import ClientCapabilities, ClientCapabilitiesTypedDict +from .mcpprompt import MCPPrompt, MCPPromptTypedDict +from .mcpresource import MCPResource, MCPResourceTypedDict +from .mcpservercardmeta import MCPServerCardMeta, MCPServerCardMetaTypedDict +from .mcpservericon import MCPServerIcon, MCPServerIconTypedDict +from .mcpserverremote import MCPServerRemote, MCPServerRemoteTypedDict +from .mcpserverrepository import MCPServerRepository, MCPServerRepositoryTypedDict +from .mcptoolmeta import MCPToolMeta, MCPToolMetaTypedDict +from .servercapabilities import ServerCapabilities, ServerCapabilitiesTypedDict +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 Annotated, NotRequired, TypeAliasType, TypedDict + + +ResourcesTypedDict = TypeAliasType( + "ResourcesTypedDict", Union[str, List[MCPResourceTypedDict]] +) + + +Resources = TypeAliasType("Resources", Union[str, List[MCPResource]]) + + +ToolsTypedDict = TypeAliasType("ToolsTypedDict", Union[str, List[MCPToolMetaTypedDict]]) + + +Tools = TypeAliasType("Tools", Union[str, List[MCPToolMeta]]) + + +PromptsTypedDict = TypeAliasType( + "PromptsTypedDict", Union[str, List[MCPPromptTypedDict]] +) + + +Prompts = TypeAliasType("Prompts", Union[str, List[MCPPrompt]]) + + +class MCPServerCardTypedDict(TypedDict): + name: str + r"""Server identifier in reverse-DNS format with exactly one /""" + version: str + r"""Server version (semantic versioning preferred)""" + dollar_schema: NotRequired[Nullable[str]] + r"""URL to the JSON schema definition""" + capabilities: NotRequired[ServerCapabilitiesTypedDict] + r"""Capabilities that a server may support.""" + title: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + website_url: NotRequired[Nullable[str]] + repository: NotRequired[Nullable[MCPServerRepositoryTypedDict]] + icons: NotRequired[Nullable[List[MCPServerIconTypedDict]]] + remotes: NotRequired[Nullable[List[MCPServerRemoteTypedDict]]] + requires: NotRequired[Nullable[ClientCapabilitiesTypedDict]] + resources: NotRequired[Nullable[ResourcesTypedDict]] + tools: NotRequired[Nullable[ToolsTypedDict]] + prompts: NotRequired[Nullable[PromptsTypedDict]] + meta: NotRequired[Nullable[MCPServerCardMetaTypedDict]] + + +class MCPServerCard(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 + r"""Server identifier in reverse-DNS format with exactly one /""" + + version: str + r"""Server version (semantic versioning preferred)""" + + dollar_schema: Annotated[OptionalNullable[str], pydantic.Field(alias="$schema")] = ( + UNSET + ) + r"""URL to the JSON schema definition""" + + capabilities: Optional[ServerCapabilities] = None + r"""Capabilities that a server may support.""" + + title: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + website_url: Annotated[ + OptionalNullable[str], pydantic.Field(alias="websiteUrl") + ] = UNSET + + repository: OptionalNullable[MCPServerRepository] = UNSET + + icons: OptionalNullable[List[MCPServerIcon]] = UNSET + + remotes: OptionalNullable[List[MCPServerRemote]] = UNSET + + requires: OptionalNullable[ClientCapabilities] = UNSET + + resources: OptionalNullable[Resources] = UNSET + + tools: OptionalNullable[Tools] = UNSET + + prompts: OptionalNullable[Prompts] = UNSET + + meta: Annotated[ + OptionalNullable[MCPServerCardMeta], 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( + [ + "$schema", + "capabilities", + "title", + "description", + "websiteUrl", + "repository", + "icons", + "remotes", + "requires", + "resources", + "tools", + "prompts", + "_meta", + ] + ) + nullable_fields = set( + [ + "$schema", + "title", + "description", + "websiteUrl", + "repository", + "icons", + "remotes", + "requires", + "resources", + "tools", + "prompts", + "_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: + MCPServerCard.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/mcpuitoolmeta.py b/src/mistralai/client/models/mcpservercardmeta.py similarity index 67% rename from src/mistralai/client/models/mcpuitoolmeta.py rename to src/mistralai/client/models/mcpservercardmeta.py index 287192a6..daf592f9 100644 --- a/src/mistralai/client/models/mcpuitoolmeta.py +++ b/src/mistralai/client/models/mcpservercardmeta.py @@ -1,51 +1,45 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -# @generated-id: 7c54fb6157a9 +# @generated-id: 0f095765c6aa from __future__ import annotations +from .turbinemeta import TurbineMeta, TurbineMetaTypedDict 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 import Any, Dict from typing_extensions import Annotated, NotRequired, TypedDict -Visibility = Union[ - Literal[ - "model", - "app", - ], - UnrecognizedStr, -] +class MCPServerCardMetaTypedDict(TypedDict): + r"""Typed _meta for MCP server cards. + Only the 'turbine' field is typed. Other fields are allowed via extra=\"allow\". + """ -class MCPUIToolMetaTypedDict(TypedDict): - r"""UI metadata for tools that reference UI resources.""" + ai_mistral_turbine: NotRequired[Nullable[TurbineMetaTypedDict]] - resource_uri: NotRequired[Nullable[str]] - visibility: NotRequired[Nullable[List[Visibility]]] +class MCPServerCardMeta(BaseModel): + r"""Typed _meta for MCP server cards. -class MCPUIToolMeta(BaseModel): - r"""UI metadata for tools that reference UI resources.""" + Only the 'turbine' 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) - resource_uri: Annotated[ - OptionalNullable[str], pydantic.Field(alias="resourceUri") + ai_mistral_turbine: Annotated[ + OptionalNullable[TurbineMeta], pydantic.Field(alias="ai.mistral/turbine") ] = UNSET - visibility: OptionalNullable[List[Visibility]] = UNSET - @property def additional_properties(self): return self.__pydantic_extra__ @@ -56,8 +50,8 @@ def additional_properties(self, value): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["resourceUri", "visibility"]) - nullable_fields = set(["resourceUri", "visibility"]) + optional_fields = set(["ai.mistral/turbine"]) + nullable_fields = set(["ai.mistral/turbine"]) serialized = handler(self) m = {} @@ -84,6 +78,6 @@ def serialize_model(self, handler): try: - MCPUIToolMeta.model_rebuild() + MCPServerCardMeta.model_rebuild() except NameError: pass diff --git a/src/mistralai/client/models/mcpserverremote.py b/src/mistralai/client/models/mcpserverremote.py new file mode 100644 index 00000000..9099207c --- /dev/null +++ b/src/mistralai/client/models/mcpserverremote.py @@ -0,0 +1,96 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b20e4512dbe2 + +from __future__ import annotations +from .mcpserverauthenticationrequirement import ( + MCPServerAuthenticationRequirement, + MCPServerAuthenticationRequirementTypedDict, +) +from .mcpserverremoteheader import MCPServerRemoteHeader, MCPServerRemoteHeaderTypedDict +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 + + +MCPServerRemoteType = Union[ + Literal[ + "streamable-http", + "sse", + ], + UnrecognizedStr, +] +r"""Transport type""" + + +class MCPServerRemoteTypedDict(TypedDict): + r"""Remote transport endpoint (SEP-2127).""" + + type: MCPServerRemoteType + r"""Transport type""" + url: str + r"""Transport endpoint URL""" + supported_protocol_versions: NotRequired[Nullable[List[str]]] + headers: NotRequired[Nullable[List[MCPServerRemoteHeaderTypedDict]]] + authentication: NotRequired[Nullable[MCPServerAuthenticationRequirementTypedDict]] + + +class MCPServerRemote(BaseModel): + r"""Remote transport endpoint (SEP-2127).""" + + type: MCPServerRemoteType + r"""Transport type""" + + url: str + r"""Transport endpoint URL""" + + supported_protocol_versions: Annotated[ + OptionalNullable[List[str]], pydantic.Field(alias="supportedProtocolVersions") + ] = UNSET + + headers: OptionalNullable[List[MCPServerRemoteHeader]] = UNSET + + authentication: OptionalNullable[MCPServerAuthenticationRequirement] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["supportedProtocolVersions", "headers", "authentication"] + ) + nullable_fields = set( + ["supportedProtocolVersions", "headers", "authentication"] + ) + serialized = 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: + MCPServerRemote.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/mcpserverremoteheader.py b/src/mistralai/client/models/mcpserverremoteheader.py new file mode 100644 index 00000000..efd1c1fd --- /dev/null +++ b/src/mistralai/client/models/mcpserverremoteheader.py @@ -0,0 +1,81 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: adaf8d89cbcb + +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 List +from typing_extensions import Annotated, NotRequired, TypedDict + + +class MCPServerRemoteHeaderTypedDict(TypedDict): + r"""Header definition for a remote transport (SEP-2127).""" + + name: str + r"""Header name""" + description: str + r"""Human-readable description of the header""" + is_required: NotRequired[Nullable[bool]] + is_secret: NotRequired[Nullable[bool]] + default: NotRequired[Nullable[str]] + choices: NotRequired[Nullable[List[str]]] + + +class MCPServerRemoteHeader(BaseModel): + r"""Header definition for a remote transport (SEP-2127).""" + + name: str + r"""Header name""" + + description: str + r"""Human-readable description of the header""" + + is_required: Annotated[ + OptionalNullable[bool], pydantic.Field(alias="isRequired") + ] = UNSET + + is_secret: Annotated[OptionalNullable[bool], pydantic.Field(alias="isSecret")] = ( + UNSET + ) + + default: OptionalNullable[str] = UNSET + + choices: OptionalNullable[List[str]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["isRequired", "isSecret", "default", "choices"]) + nullable_fields = set(["isRequired", "isSecret", "default", "choices"]) + serialized = 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: + MCPServerRemoteHeader.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/mcpserverrepository.py b/src/mistralai/client/models/mcpserverrepository.py new file mode 100644 index 00000000..eb564992 --- /dev/null +++ b/src/mistralai/client/models/mcpserverrepository.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 431ce897e113 + +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 MCPServerRepositoryTypedDict(TypedDict): + r"""Source repository information (SEP-2127).""" + + url: str + r"""Repository URL""" + source: str + r"""Source identifier (e.g. 'github')""" + subfolder: NotRequired[Nullable[str]] + + +class MCPServerRepository(BaseModel): + r"""Source repository information (SEP-2127).""" + + url: str + r"""Repository URL""" + + source: str + r"""Source identifier (e.g. 'github')""" + + subfolder: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["subfolder"]) + nullable_fields = set(["subfolder"]) + serialized = 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/mcptoolmeta.py b/src/mistralai/client/models/mcptoolmeta.py index edbf39a9..ddd7771b 100644 --- a/src/mistralai/client/models/mcptoolmeta.py +++ b/src/mistralai/client/models/mcptoolmeta.py @@ -2,8 +2,9 @@ # @generated-id: 07cf1c0762c9 from __future__ import annotations -from .mcpuitoolmeta import MCPUIToolMeta, MCPUIToolMetaTypedDict -from .turbinetoolmeta import TurbineToolMeta, TurbineToolMetaTypedDict +from .mcpservericon import MCPServerIcon, MCPServerIconTypedDict +from .toolannotations import ToolAnnotations, ToolAnnotationsTypedDict +from .toolexecution import ToolExecution, ToolExecutionTypedDict from mistralai.client.types import ( BaseModel, Nullable, @@ -13,37 +14,50 @@ ) import pydantic from pydantic import ConfigDict, model_serializer -from typing import Any, Dict +from typing import Any, Dict, List 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]] + 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 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 + name: str + + input_schema: Annotated[Dict[str, Any], pydantic.Field(alias="inputSchema")] + + title: OptionalNullable[str] = UNSET - ai_mistral_turbine: Annotated[ - OptionalNullable[TurbineToolMeta], pydantic.Field(alias="ai.mistral/turbine") + 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__ @@ -54,8 +68,28 @@ def additional_properties(self, value): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["ui", "ai.mistral/turbine"]) - nullable_fields = set(["ui", "ai.mistral/turbine"]) + optional_fields = set( + [ + "title", + "description", + "outputSchema", + "icons", + "annotations", + "_meta", + "execution", + ] + ) + nullable_fields = set( + [ + "title", + "description", + "outputSchema", + "icons", + "annotations", + "_meta", + "execution", + ] + ) serialized = handler(self) m = {} diff --git a/src/mistralai/client/models/partialscheduledefinition.py b/src/mistralai/client/models/partialscheduledefinition.py new file mode 100644 index 00000000..1120dd14 --- /dev/null +++ b/src/mistralai/client/models/partialscheduledefinition.py @@ -0,0 +1,139 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ce1ded792ff5 + +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 PartialScheduleDefinitionTypedDict(TypedDict): + r"""Schedule definition for partial updates. + + All fields are optional (inherited from _ScheduleRequestBase). Only explicitly-set + fields are applied during an update; unset fields preserve the existing schedule values. + """ + + input: NotRequired[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] + 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 PartialScheduleDefinition(BaseModel): + r"""Schedule definition for partial updates. + + All fields are optional (inherited from _ScheduleRequestBase). Only explicitly-set + fields are applied during an update; unset fields preserve the existing schedule values. + """ + + input: Optional[Any] = None + 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 + + 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( + [ + "input", + "calendars", + "intervals", + "cron_expressions", + "skip", + "start_at", + "end_at", + "jitter", + "time_zone_name", + "policy", + "max_executions", + ] + ) + nullable_fields = set( + ["start_at", "end_at", "jitter", "time_zone_name", "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/processingstatus.py b/src/mistralai/client/models/processingstatus.py index 7e93308f..73308b46 100644 --- a/src/mistralai/client/models/processingstatus.py +++ b/src/mistralai/client/models/processingstatus.py @@ -4,7 +4,8 @@ from __future__ import annotations from .processstatus import ProcessStatus from mistralai.client.types import BaseModel -from typing_extensions import TypedDict +import pydantic +from typing_extensions import Annotated, TypedDict class ProcessingStatusTypedDict(TypedDict): @@ -18,4 +19,9 @@ class ProcessingStatus(BaseModel): process_status: ProcessStatus - processing_status: str + processing_status: Annotated[ + str, + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] diff --git a/src/mistralai/client/models/promptargument.py b/src/mistralai/client/models/promptargument.py new file mode 100644 index 00000000..1f73b59f --- /dev/null +++ b/src/mistralai/client/models/promptargument.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 52e5c885f761 + +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 NotRequired, TypedDict + + +class PromptArgumentTypedDict(TypedDict): + r"""An argument for a prompt template.""" + + name: str + description: NotRequired[Nullable[str]] + required: NotRequired[Nullable[bool]] + + +class PromptArgument(BaseModel): + r"""An argument for a prompt template.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + name: str + + description: OptionalNullable[str] = UNSET + + required: OptionalNullable[bool] = 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(["description", "required"]) + nullable_fields = set(["description", "required"]) + serialized = 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/promptscapability.py b/src/mistralai/client/models/promptscapability.py new file mode 100644 index 00000000..f4ddf63e --- /dev/null +++ b/src/mistralai/client/models/promptscapability.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 15c552f53adf + +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 PromptsCapabilityTypedDict(TypedDict): + r"""Capability for prompts operations.""" + + list_changed: NotRequired[Nullable[bool]] + + +class PromptsCapability(BaseModel): + r"""Capability for prompts operations.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + list_changed: Annotated[ + OptionalNullable[bool], pydantic.Field(alias="listChanged") + ] = 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(["listChanged"]) + nullable_fields = set(["listChanged"]) + serialized = 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: + PromptsCapability.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/publicconnectionconfig.py b/src/mistralai/client/models/publicconnectionconfig.py new file mode 100644 index 00000000..94fd6708 --- /dev/null +++ b/src/mistralai/client/models/publicconnectionconfig.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 03c2460e04ac + +from __future__ import annotations +from .connectionconfigtype import ConnectionConfigType +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 PublicConnectionConfigTypedDict(TypedDict): + type: NotRequired[ConnectionConfigType] + base_url: NotRequired[Nullable[str]] + headers: NotRequired[Nullable[Dict[str, str]]] + signed: NotRequired[Nullable[bool]] + + +class PublicConnectionConfig(BaseModel): + type: Optional[ConnectionConfigType] = None + + base_url: OptionalNullable[str] = UNSET + + headers: OptionalNullable[Dict[str, str]] = UNSET + + signed: OptionalNullable[bool] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "base_url", "headers", "signed"]) + nullable_fields = set(["base_url", "headers", "signed"]) + serialized = 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/resourcescapability.py b/src/mistralai/client/models/resourcescapability.py new file mode 100644 index 00000000..39bd1a0b --- /dev/null +++ b/src/mistralai/client/models/resourcescapability.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d109cd5fe17d + +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 ResourcesCapabilityTypedDict(TypedDict): + r"""Capability for resources operations.""" + + subscribe: NotRequired[Nullable[bool]] + list_changed: NotRequired[Nullable[bool]] + + +class ResourcesCapability(BaseModel): + r"""Capability for resources operations.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + subscribe: OptionalNullable[bool] = UNSET + + list_changed: Annotated[ + OptionalNullable[bool], pydantic.Field(alias="listChanged") + ] = 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(["subscribe", "listChanged"]) + nullable_fields = set(["subscribe", "listChanged"]) + serialized = 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: + ResourcesCapability.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/resourcetype.py b/src/mistralai/client/models/resourcetype.py new file mode 100644 index 00000000..435c917c --- /dev/null +++ b/src/mistralai/client/models/resourcetype.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 58cbbc423f90 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedInt +from typing import Literal, Union + + +ResourceType = Union[ + Literal[ + 1, + 2, + 3, + 4, + ], + UnrecognizedInt, +] diff --git a/src/mistralai/client/models/rootscapability.py b/src/mistralai/client/models/rootscapability.py new file mode 100644 index 00000000..37b25d65 --- /dev/null +++ b/src/mistralai/client/models/rootscapability.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f1514b6dd416 + +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 RootsCapabilityTypedDict(TypedDict): + r"""Capability for root operations.""" + + list_changed: NotRequired[Nullable[bool]] + + +class RootsCapability(BaseModel): + r"""Capability for root operations.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + list_changed: Annotated[ + OptionalNullable[bool], pydantic.Field(alias="listChanged") + ] = 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(["listChanged"]) + nullable_fields = set(["listChanged"]) + serialized = 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: + RootsCapability.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/samplingcapability.py b/src/mistralai/client/models/samplingcapability.py new file mode 100644 index 00000000..46aa3be5 --- /dev/null +++ b/src/mistralai/client/models/samplingcapability.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0a7af0cc3968 + +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 NotRequired, TypedDict + + +class SamplingCapabilityTypedDict(TypedDict): + r"""Sampling capability structure, allowing fine-grained capability advertisement.""" + + context: NotRequired[Nullable[Dict[str, Any]]] + tools: NotRequired[Nullable[Dict[str, Any]]] + + +class SamplingCapability(BaseModel): + r"""Sampling capability structure, allowing fine-grained capability advertisement.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + context: OptionalNullable[Dict[str, Any]] = UNSET + + tools: OptionalNullable[Dict[str, Any]] = 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(["context", "tools"]) + nullable_fields = set(["context", "tools"]) + serialized = 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/scheduledefinition.py b/src/mistralai/client/models/scheduledefinition.py index 58102293..3c018552 100644 --- a/src/mistralai/client/models/scheduledefinition.py +++ b/src/mistralai/client/models/scheduledefinition.py @@ -51,10 +51,10 @@ class ScheduleDefinitionTypedDict(TypedDict): 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.""" + schedule_id: NotRequired[Nullable[str]] + r"""Unique identifier for the schedule.""" class ScheduleDefinition(BaseModel): @@ -100,12 +100,12 @@ class ScheduleDefinition(BaseModel): 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.""" + schedule_id: OptionalNullable[str] = UNSET + r"""Unique identifier for the schedule.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -119,8 +119,8 @@ def serialize_model(self, handler): "jitter", "time_zone_name", "policy", - "schedule_id", "max_executions", + "schedule_id", ] ) nullable_fields = set( @@ -129,8 +129,8 @@ def serialize_model(self, handler): "end_at", "jitter", "time_zone_name", - "schedule_id", "max_executions", + "schedule_id", ] ) serialized = handler(self) diff --git a/src/mistralai/client/models/searchindexresponse.py b/src/mistralai/client/models/searchindexresponse.py new file mode 100644 index 00000000..0e62aa32 --- /dev/null +++ b/src/mistralai/client/models/searchindexresponse.py @@ -0,0 +1,72 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 054688d20a3b + +from __future__ import annotations +from .vespasearchindexinforesponse import ( + VespaSearchIndexInfoResponse, + VespaSearchIndexInfoResponseTypedDict, +) +from datetime import datetime +from mistralai.client.types import BaseModel, UnrecognizedStr +from pydantic import ConfigDict +from typing import Any, Literal, Union +from typing_extensions import TypedDict + + +SearchIndexResponseStatus = Union[ + Literal[ + "online", + "offline", + ], + UnrecognizedStr, +] + + +SearchIndexResponseIndexTypedDict = VespaSearchIndexInfoResponseTypedDict + + +class UnknownSearchIndexResponseIndex(BaseModel): + r"""A SearchIndexResponseIndex 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) + + +_SEARCH_INDEX_RESPONSE_INDEX_VARIANTS: dict[str, Any] = { + "vespa": VespaSearchIndexInfoResponse, +} + + +SearchIndexResponseIndex = VespaSearchIndexInfoResponse + + +class SearchIndexResponseTypedDict(TypedDict): + id: str + name: str + creator_id: str + document_count: int + status: SearchIndexResponseStatus + created_at: datetime + modified_at: datetime + index: SearchIndexResponseIndexTypedDict + + +class SearchIndexResponse(BaseModel): + id: str + + name: str + + creator_id: str + + document_count: int + + status: SearchIndexResponseStatus + + created_at: datetime + + modified_at: datetime + + index: SearchIndexResponseIndex diff --git a/src/mistralai/client/models/servercapabilities.py b/src/mistralai/client/models/servercapabilities.py new file mode 100644 index 00000000..ccfbf932 --- /dev/null +++ b/src/mistralai/client/models/servercapabilities.py @@ -0,0 +1,110 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9e5832ea005a + +from __future__ import annotations +from .promptscapability import PromptsCapability, PromptsCapabilityTypedDict +from .resourcescapability import ResourcesCapability, ResourcesCapabilityTypedDict +from .servertaskscapability import ServerTasksCapability, ServerTasksCapabilityTypedDict +from .toolscapability import ToolsCapability, ToolsCapabilityTypedDict +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 ServerCapabilitiesTypedDict(TypedDict): + r"""Capabilities that a server may support.""" + + experimental: NotRequired[Nullable[Dict[str, Dict[str, Any]]]] + logging: NotRequired[Nullable[Dict[str, Any]]] + prompts: NotRequired[Nullable[PromptsCapabilityTypedDict]] + resources: NotRequired[Nullable[ResourcesCapabilityTypedDict]] + tools: NotRequired[Nullable[ToolsCapabilityTypedDict]] + completions: NotRequired[Nullable[Dict[str, Any]]] + tasks: NotRequired[Nullable[ServerTasksCapabilityTypedDict]] + + +class ServerCapabilities(BaseModel): + r"""Capabilities that a server may support.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + experimental: OptionalNullable[Dict[str, Dict[str, Any]]] = UNSET + + logging: OptionalNullable[Dict[str, Any]] = UNSET + + prompts: OptionalNullable[PromptsCapability] = UNSET + + resources: OptionalNullable[ResourcesCapability] = UNSET + + tools: OptionalNullable[ToolsCapability] = UNSET + + completions: OptionalNullable[Dict[str, Any]] = UNSET + + tasks: OptionalNullable[ServerTasksCapability] = 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( + [ + "experimental", + "logging", + "prompts", + "resources", + "tools", + "completions", + "tasks", + ] + ) + nullable_fields = set( + [ + "experimental", + "logging", + "prompts", + "resources", + "tools", + "completions", + "tasks", + ] + ) + serialized = 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/turbinetoollocale.py b/src/mistralai/client/models/serverlocale.py similarity index 95% rename from src/mistralai/client/models/turbinetoollocale.py rename to src/mistralai/client/models/serverlocale.py index 42682ee1..1b73a749 100644 --- a/src/mistralai/client/models/turbinetoollocale.py +++ b/src/mistralai/client/models/serverlocale.py @@ -1,5 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -# @generated-id: 2699936a7546 +# @generated-id: 5b70fcb88050 from __future__ import annotations from mistralai.client.types import ( @@ -14,7 +14,7 @@ from typing_extensions import NotRequired, TypedDict -class TurbineToolLocaleTypedDict(TypedDict): +class ServerLocaleTypedDict(TypedDict): name: NotRequired[Nullable[Dict[str, str]]] description: NotRequired[Nullable[Dict[str, str]]] usage_sentence: NotRequired[Nullable[Dict[str, str]]] @@ -22,7 +22,7 @@ class TurbineToolLocaleTypedDict(TypedDict): done_description: NotRequired[Nullable[Dict[str, str]]] -class TurbineToolLocale(BaseModel): +class ServerLocale(BaseModel): name: OptionalNullable[Dict[str, str]] = UNSET description: OptionalNullable[Dict[str, str]] = UNSET diff --git a/src/mistralai/client/models/servertaskscapability.py b/src/mistralai/client/models/servertaskscapability.py new file mode 100644 index 00000000..7d2c2927 --- /dev/null +++ b/src/mistralai/client/models/servertaskscapability.py @@ -0,0 +1,78 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fff9567cb403 + +from __future__ import annotations +from .servertasksrequestscapability import ( + ServerTasksRequestsCapability, + ServerTasksRequestsCapabilityTypedDict, +) +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 ServerTasksCapabilityTypedDict(TypedDict): + r"""Capability for server tasks operations.""" + + list: NotRequired[Nullable[Dict[str, Any]]] + cancel: NotRequired[Nullable[Dict[str, Any]]] + requests: NotRequired[Nullable[ServerTasksRequestsCapabilityTypedDict]] + + +class ServerTasksCapability(BaseModel): + r"""Capability for server tasks operations.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + list: OptionalNullable[Dict[str, Any]] = UNSET + + cancel: OptionalNullable[Dict[str, Any]] = UNSET + + requests: OptionalNullable[ServerTasksRequestsCapability] = 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(["list", "cancel", "requests"]) + nullable_fields = set(["list", "cancel", "requests"]) + serialized = 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/servertasksrequestscapability.py b/src/mistralai/client/models/servertasksrequestscapability.py new file mode 100644 index 00000000..2568507f --- /dev/null +++ b/src/mistralai/client/models/servertasksrequestscapability.py @@ -0,0 +1,69 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 23cc8415f619 + +from __future__ import annotations +from .taskstoolscapability import TasksToolsCapability, TasksToolsCapabilityTypedDict +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 ServerTasksRequestsCapabilityTypedDict(TypedDict): + r"""Capability for tasks requests operations.""" + + tools: NotRequired[Nullable[TasksToolsCapabilityTypedDict]] + + +class ServerTasksRequestsCapability(BaseModel): + r"""Capability for tasks requests operations.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + tools: OptionalNullable[TasksToolsCapability] = 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(["tools"]) + nullable_fields = set(["tools"]) + serialized = 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/sharing.py b/src/mistralai/client/models/sharing.py index efa16203..4260f175 100644 --- a/src/mistralai/client/models/sharing.py +++ b/src/mistralai/client/models/sharing.py @@ -9,8 +9,9 @@ UNSET, UNSET_SENTINEL, ) +import pydantic from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Annotated, NotRequired, TypedDict class SharingTypedDict(TypedDict): @@ -25,7 +26,12 @@ class SharingTypedDict(TypedDict): class Sharing(BaseModel): library_id: str - org_id: str + org_id: Annotated[ + str, + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] role: str @@ -33,7 +39,12 @@ class Sharing(BaseModel): share_with_uuid: Nullable[str] - user_id: OptionalNullable[str] = UNSET + user_id: 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 @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/mistralai/client/models/sharingdelete.py b/src/mistralai/client/models/sharingdelete.py index 3472a506..67399831 100644 --- a/src/mistralai/client/models/sharingdelete.py +++ b/src/mistralai/client/models/sharingdelete.py @@ -10,8 +10,9 @@ UNSET, UNSET_SENTINEL, ) +import pydantic from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Annotated, NotRequired, TypedDict class SharingDeleteTypedDict(TypedDict): @@ -29,7 +30,12 @@ class SharingDelete(BaseModel): share_with_type: EntityType r"""The type of entity, used to share a library.""" - org_id: OptionalNullable[str] = UNSET + org_id: 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 @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/mistralai/client/models/sharingrequest.py b/src/mistralai/client/models/sharingrequest.py index 7c2d435c..94de31c1 100644 --- a/src/mistralai/client/models/sharingrequest.py +++ b/src/mistralai/client/models/sharingrequest.py @@ -11,8 +11,9 @@ UNSET, UNSET_SENTINEL, ) +import pydantic from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Annotated, NotRequired, TypedDict class SharingRequestTypedDict(TypedDict): @@ -33,7 +34,12 @@ class SharingRequest(BaseModel): share_with_type: EntityType r"""The type of entity, used to share a library.""" - org_id: OptionalNullable[str] = UNSET + org_id: 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 @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/mistralai/client/models/taskselicitationcapability.py b/src/mistralai/client/models/taskselicitationcapability.py new file mode 100644 index 00000000..768f36f1 --- /dev/null +++ b/src/mistralai/client/models/taskselicitationcapability.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 19504f19f5f3 + +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 NotRequired, TypedDict + + +class TasksElicitationCapabilityTypedDict(TypedDict): + r"""Capability for tasks elicitation operations.""" + + create: NotRequired[Nullable[Dict[str, Any]]] + + +class TasksElicitationCapability(BaseModel): + r"""Capability for tasks elicitation operations.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + create: OptionalNullable[Dict[str, Any]] = 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(["create"]) + nullable_fields = set(["create"]) + serialized = 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/taskssamplingcapability.py b/src/mistralai/client/models/taskssamplingcapability.py new file mode 100644 index 00000000..e051fd75 --- /dev/null +++ b/src/mistralai/client/models/taskssamplingcapability.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fe3e6aaee007 + +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 TasksSamplingCapabilityTypedDict(TypedDict): + r"""Capability for tasks sampling operations.""" + + create_message: NotRequired[Nullable[Dict[str, Any]]] + + +class TasksSamplingCapability(BaseModel): + r"""Capability for tasks sampling operations.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + create_message: Annotated[ + OptionalNullable[Dict[str, Any]], pydantic.Field(alias="createMessage") + ] = 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(["createMessage"]) + nullable_fields = set(["createMessage"]) + serialized = 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: + TasksSamplingCapability.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/taskstoolscapability.py b/src/mistralai/client/models/taskstoolscapability.py new file mode 100644 index 00000000..88d799c1 --- /dev/null +++ b/src/mistralai/client/models/taskstoolscapability.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ac9448f661ce + +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 NotRequired, TypedDict + + +class TasksToolsCapabilityTypedDict(TypedDict): + r"""Capability for tasks tools operations.""" + + call: NotRequired[Nullable[Dict[str, Any]]] + + +class TasksToolsCapability(BaseModel): + r"""Capability for tasks tools operations.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + call: OptionalNullable[Dict[str, Any]] = 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(["call"]) + nullable_fields = set(["call"]) + serialized = 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/toolexecutionconfiguration.py b/src/mistralai/client/models/toolexecutionconfiguration.py new file mode 100644 index 00000000..ce65ad31 --- /dev/null +++ b/src/mistralai/client/models/toolexecutionconfiguration.py @@ -0,0 +1,84 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1c9369616b21 + +from __future__ import annotations +from .logicalexpression import LogicalExpression, LogicalExpressionTypedDict +from .toolproperties import ToolProperties, ToolPropertiesTypedDict +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 + + +RequiresConfirmationTypedDict = TypeAliasType( + "RequiresConfirmationTypedDict", + Union[ToolPropertiesTypedDict, LogicalExpressionTypedDict, List[str]], +) + + +RequiresConfirmation = TypeAliasType( + "RequiresConfirmation", Union[ToolProperties, LogicalExpression, List[str]] +) + + +SkipConfirmationTypedDict = TypeAliasType( + "SkipConfirmationTypedDict", + Union[ToolPropertiesTypedDict, LogicalExpressionTypedDict, List[str]], +) + + +SkipConfirmation = TypeAliasType( + "SkipConfirmation", Union[ToolProperties, LogicalExpression, List[str]] +) + + +class ToolExecutionConfigurationTypedDict(TypedDict): + requires_confirmation: NotRequired[Nullable[RequiresConfirmationTypedDict]] + skip_confirmation: NotRequired[Nullable[SkipConfirmationTypedDict]] + include: NotRequired[Nullable[List[str]]] + exclude: NotRequired[Nullable[List[str]]] + + +class ToolExecutionConfiguration(BaseModel): + requires_confirmation: OptionalNullable[RequiresConfirmation] = UNSET + + skip_confirmation: OptionalNullable[SkipConfirmation] = UNSET + + include: OptionalNullable[List[str]] = UNSET + + exclude: OptionalNullable[List[str]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["requires_confirmation", "skip_confirmation", "include", "exclude"] + ) + nullable_fields = set( + ["requires_confirmation", "skip_confirmation", "include", "exclude"] + ) + serialized = 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/toolproperties.py b/src/mistralai/client/models/toolproperties.py new file mode 100644 index 00000000..d3bf9789 --- /dev/null +++ b/src/mistralai/client/models/toolproperties.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3a33561f76fc + +from __future__ import annotations +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class ToolPropertiesTypedDict(TypedDict): + read_only: Nullable[bool] + + +class ToolProperties(BaseModel): + read_only: Nullable[bool] + + @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/toolscapability.py b/src/mistralai/client/models/toolscapability.py new file mode 100644 index 00000000..94e5ddc8 --- /dev/null +++ b/src/mistralai/client/models/toolscapability.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2feda23ea584 + +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 ToolsCapabilityTypedDict(TypedDict): + r"""Capability for tools operations.""" + + list_changed: NotRequired[Nullable[bool]] + + +class ToolsCapability(BaseModel): + r"""Capability for tools operations.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + list_changed: Annotated[ + OptionalNullable[bool], pydantic.Field(alias="listChanged") + ] = 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(["listChanged"]) + nullable_fields = set(["listChanged"]) + serialized = 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: + ToolsCapability.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/turbinemeta.py b/src/mistralai/client/models/turbinemeta.py new file mode 100644 index 00000000..5084c05f --- /dev/null +++ b/src/mistralai/client/models/turbinemeta.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 084d588caa1e + +from __future__ import annotations +from .serverlocale import ServerLocale, ServerLocaleTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class TurbineMetaTypedDict(TypedDict): + system_prompt_name: NotRequired[Nullable[str]] + locale: NotRequired[Nullable[ServerLocaleTypedDict]] + + +class TurbineMeta(BaseModel): + system_prompt_name: OptionalNullable[str] = UNSET + + locale: OptionalNullable[ServerLocale] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["system_prompt_name", "locale"]) + nullable_fields = set(["system_prompt_name", "locale"]) + serialized = 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/update_schedule_v1_workflows_schedules_schedule_id_patchop.py b/src/mistralai/client/models/update_schedule_v1_workflows_schedules_schedule_id_patchop.py new file mode 100644 index 00000000..5e3a1be4 --- /dev/null +++ b/src/mistralai/client/models/update_schedule_v1_workflows_schedules_schedule_id_patchop.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6aaa918af7f4 + +from __future__ import annotations +from .workflowscheduleupdaterequest import ( + WorkflowScheduleUpdateRequest, + WorkflowScheduleUpdateRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class UpdateScheduleV1WorkflowsSchedulesScheduleIDPatchRequestTypedDict(TypedDict): + schedule_id: str + workflow_schedule_update_request: WorkflowScheduleUpdateRequestTypedDict + + +class UpdateScheduleV1WorkflowsSchedulesScheduleIDPatchRequest(BaseModel): + schedule_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + workflow_schedule_update_request: Annotated[ + WorkflowScheduleUpdateRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/updateconnectorrequest.py b/src/mistralai/client/models/updateconnectorrequest.py index 145091d4..81f09ea9 100644 --- a/src/mistralai/client/models/updateconnectorrequest.py +++ b/src/mistralai/client/models/updateconnectorrequest.py @@ -3,6 +3,7 @@ from __future__ import annotations from .authdata import AuthData, AuthDataTypedDict +from .connectorprotocol import ConnectorProtocol from mistralai.client.types import ( BaseModel, Nullable, @@ -26,6 +27,8 @@ class UpdateConnectorRequestTypedDict(TypedDict): 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.""" + protocol: NotRequired[Nullable[ConnectorProtocol]] + r"""Protocol of the connector.""" connection_config: NotRequired[Nullable[Dict[str, Any]]] r"""Optional new connection config.""" connection_secrets: NotRequired[Nullable[Dict[str, Any]]] @@ -54,6 +57,9 @@ class UpdateConnectorRequest(BaseModel): system_prompt: OptionalNullable[str] = UNSET r"""Optional system prompt for the connector.""" + protocol: OptionalNullable[ConnectorProtocol] = UNSET + r"""Protocol of the connector.""" + connection_config: OptionalNullable[Dict[str, Any]] = UNSET r"""Optional new connection config.""" @@ -78,6 +84,7 @@ def serialize_model(self, handler): "description", "icon_url", "system_prompt", + "protocol", "connection_config", "connection_secrets", "server", @@ -92,6 +99,7 @@ def serialize_model(self, handler): "description", "icon_url", "system_prompt", + "protocol", "connection_config", "connection_secrets", "server", diff --git a/src/mistralai/client/models/updatedocumentrequest.py b/src/mistralai/client/models/updatedocumentrequest.py index 5f67ea69..07c6f5e3 100644 --- a/src/mistralai/client/models/updatedocumentrequest.py +++ b/src/mistralai/client/models/updatedocumentrequest.py @@ -34,6 +34,8 @@ class UpdateDocumentRequestTypedDict(TypedDict): name: NotRequired[str] attributes: NotRequired[Nullable[Dict[str, AttributesTypedDict]]] + expires_at: NotRequired[Nullable[datetime]] + r"""If set, the document will be automatically deleted after this date.""" class UpdateDocumentRequest(BaseModel): @@ -41,10 +43,13 @@ class UpdateDocumentRequest(BaseModel): attributes: OptionalNullable[Dict[str, Attributes]] = UNSET + expires_at: OptionalNullable[datetime] = UNSET + r"""If set, the document will be automatically deleted after this date.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["name", "attributes"]) - nullable_fields = set(["attributes"]) + optional_fields = set(["name", "attributes", "expires_at"]) + nullable_fields = set(["attributes", "expires_at"]) serialized = handler(self) m = {} diff --git a/src/mistralai/client/models/vespaschemaresponse.py b/src/mistralai/client/models/vespaschemaresponse.py new file mode 100644 index 00000000..440967d1 --- /dev/null +++ b/src/mistralai/client/models/vespaschemaresponse.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fbab188e672e + +from __future__ import annotations +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class VespaSchemaResponseTypedDict(TypedDict): + name: str + document_count: Nullable[int] + + +class VespaSchemaResponse(BaseModel): + name: str + + document_count: Nullable[int] + + @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/vespasearchindexinforesponse.py b/src/mistralai/client/models/vespasearchindexinforesponse.py new file mode 100644 index 00000000..a3cce354 --- /dev/null +++ b/src/mistralai/client/models/vespasearchindexinforesponse.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ee7484f75a7c + +from __future__ import annotations +from .vespaschemaresponse import VespaSchemaResponse, VespaSchemaResponseTypedDict +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 VespaSearchIndexInfoResponseTypedDict(TypedDict): + k8s_cluster: str + k8s_namespace: str + vespa_instance_name: str + schemas: List[VespaSchemaResponseTypedDict] + type: Literal["vespa"] + + +class VespaSearchIndexInfoResponse(BaseModel): + k8s_cluster: str + + k8s_namespace: str + + vespa_instance_name: str + + schemas: List[VespaSchemaResponse] + + type: Annotated[ + Annotated[Literal["vespa"], AfterValidator(validate_const("vespa"))], + pydantic.Field(alias="type"), + ] = "vespa" + + +try: + VespaSearchIndexInfoResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/voiceappearance.py b/src/mistralai/client/models/voiceappearance.py new file mode 100644 index 00000000..a9d4f2a8 --- /dev/null +++ b/src/mistralai/client/models/voiceappearance.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 945a81bc2582 + +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 VoiceAppearanceTypedDict(TypedDict): + skin_color: NotRequired[Nullable[str]] + hair_color: NotRequired[Nullable[str]] + background_color: NotRequired[Nullable[str]] + avatar_id: NotRequired[Nullable[str]] + + +class VoiceAppearance(BaseModel): + skin_color: OptionalNullable[str] = UNSET + + hair_color: OptionalNullable[str] = UNSET + + background_color: OptionalNullable[str] = UNSET + + avatar_id: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["skin_color", "hair_color", "background_color", "avatar_id"] + ) + nullable_fields = set( + ["skin_color", "hair_color", "background_color", "avatar_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/voicecreaterequest.py b/src/mistralai/client/models/voicecreaterequest.py index 99df178d..ec94523f 100644 --- a/src/mistralai/client/models/voicecreaterequest.py +++ b/src/mistralai/client/models/voicecreaterequest.py @@ -2,6 +2,7 @@ # @generated-id: 9a1752117dec from __future__ import annotations +from .voiceappearance import VoiceAppearance, VoiceAppearanceTypedDict from mistralai.client.types import ( BaseModel, Nullable, @@ -26,6 +27,8 @@ class VoiceCreateRequestTypedDict(TypedDict): age: NotRequired[Nullable[int]] tags: NotRequired[Nullable[List[str]]] color: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + appearance: NotRequired[Nullable[VoiceAppearanceTypedDict]] retention_notice: NotRequired[int] sample_filename: NotRequired[Nullable[str]] r"""Original filename for extension detection""" @@ -51,6 +54,10 @@ class VoiceCreateRequest(BaseModel): color: OptionalNullable[str] = UNSET + description: OptionalNullable[str] = UNSET + + appearance: OptionalNullable[VoiceAppearance] = UNSET + retention_notice: Optional[int] = 30 sample_filename: OptionalNullable[str] = UNSET @@ -66,12 +73,23 @@ def serialize_model(self, handler): "age", "tags", "color", + "description", + "appearance", "retention_notice", "sample_filename", ] ) nullable_fields = set( - ["slug", "gender", "age", "tags", "color", "sample_filename"] + [ + "slug", + "gender", + "age", + "tags", + "color", + "description", + "appearance", + "sample_filename", + ] ) serialized = handler(self) m = {} diff --git a/src/mistralai/client/models/voiceresponse.py b/src/mistralai/client/models/voiceresponse.py index 6fa3987b..818bd257 100644 --- a/src/mistralai/client/models/voiceresponse.py +++ b/src/mistralai/client/models/voiceresponse.py @@ -2,6 +2,7 @@ # @generated-id: 24138e419fae from __future__ import annotations +from .voiceappearance import VoiceAppearance, VoiceAppearanceTypedDict from datetime import datetime from mistralai.client.types import ( BaseModel, @@ -28,6 +29,8 @@ class VoiceResponseTypedDict(TypedDict): age: NotRequired[Nullable[int]] tags: NotRequired[Nullable[List[str]]] color: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + appearance: NotRequired[Nullable[VoiceAppearanceTypedDict]] retention_notice: NotRequired[int] @@ -54,14 +57,39 @@ class VoiceResponse(BaseModel): color: OptionalNullable[str] = UNSET + description: OptionalNullable[str] = UNSET + + appearance: OptionalNullable[VoiceAppearance] = 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"] + [ + "slug", + "languages", + "gender", + "age", + "tags", + "color", + "description", + "appearance", + "retention_notice", + ] + ) + nullable_fields = set( + [ + "slug", + "gender", + "age", + "tags", + "color", + "description", + "appearance", + "user_id", + ] ) - nullable_fields = set(["slug", "gender", "age", "tags", "color", "user_id"]) serialized = handler(self) m = {} diff --git a/src/mistralai/client/models/voiceupdaterequest.py b/src/mistralai/client/models/voiceupdaterequest.py index 717316b0..4239d016 100644 --- a/src/mistralai/client/models/voiceupdaterequest.py +++ b/src/mistralai/client/models/voiceupdaterequest.py @@ -2,6 +2,7 @@ # @generated-id: 798f8ff225de from __future__ import annotations +from .voiceappearance import VoiceAppearance, VoiceAppearanceTypedDict from mistralai.client.types import ( BaseModel, Nullable, @@ -22,6 +23,8 @@ class VoiceUpdateRequestTypedDict(TypedDict): gender: NotRequired[Nullable[str]] age: NotRequired[Nullable[int]] tags: NotRequired[Nullable[List[str]]] + description: NotRequired[Nullable[str]] + appearance: NotRequired[Nullable[VoiceAppearanceTypedDict]] class VoiceUpdateRequest(BaseModel): @@ -37,10 +40,18 @@ class VoiceUpdateRequest(BaseModel): tags: OptionalNullable[List[str]] = UNSET + description: OptionalNullable[str] = UNSET + + appearance: OptionalNullable[VoiceAppearance] = 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"]) + optional_fields = set( + ["name", "languages", "gender", "age", "tags", "description", "appearance"] + ) + nullable_fields = set( + ["name", "languages", "gender", "age", "tags", "description", "appearance"] + ) serialized = handler(self) m = {} diff --git a/src/mistralai/client/models/workflowbulkarchiverequest.py b/src/mistralai/client/models/workflowbulkarchiverequest.py new file mode 100644 index 00000000..fb208919 --- /dev/null +++ b/src/mistralai/client/models/workflowbulkarchiverequest.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0e0bf7feeede + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class WorkflowBulkArchiveRequestTypedDict(TypedDict): + workflow_ids: List[str] + r"""List of workflow IDs to archive""" + + +class WorkflowBulkArchiveRequest(BaseModel): + workflow_ids: List[str] + r"""List of workflow IDs to archive""" diff --git a/src/mistralai/client/models/workflowbulkarchiveresponse.py b/src/mistralai/client/models/workflowbulkarchiveresponse.py new file mode 100644 index 00000000..506724b3 --- /dev/null +++ b/src/mistralai/client/models/workflowbulkarchiveresponse.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 132f69064b86 + +from __future__ import annotations +from .workflow import Workflow, WorkflowTypedDict +from .workflowbulkerror import WorkflowBulkError, WorkflowBulkErrorTypedDict +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 WorkflowBulkArchiveResponseTypedDict(TypedDict): + archived: List[WorkflowTypedDict] + r"""Workflows that were successfully archived or were already archived""" + errored: NotRequired[List[WorkflowBulkErrorTypedDict]] + r"""Workflows that could not be archived and the corresponding error messages""" + + +class WorkflowBulkArchiveResponse(BaseModel): + archived: List[Workflow] + r"""Workflows that were successfully archived or were already archived""" + + errored: Optional[List[WorkflowBulkError]] = None + r"""Workflows that could not be archived and the corresponding error messages""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["errored"]) + serialized = 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/workflowbulkerror.py b/src/mistralai/client/models/workflowbulkerror.py new file mode 100644 index 00000000..076c938a --- /dev/null +++ b/src/mistralai/client/models/workflowbulkerror.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 61b9b62c7fd6 + +from __future__ import annotations +from .workflow import Workflow, WorkflowTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class WorkflowBulkErrorTypedDict(TypedDict): + workflow_id: str + r"""The requested workflow ID""" + message: str + r"""Error message describing why the operation failed""" + workflow: NotRequired[Nullable[WorkflowTypedDict]] + r"""The workflow, if found""" + + +class WorkflowBulkError(BaseModel): + workflow_id: str + r"""The requested workflow ID""" + + message: str + r"""Error message describing why the operation failed""" + + workflow: OptionalNullable[Workflow] = UNSET + r"""The workflow, if found""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["workflow"]) + nullable_fields = set(["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/workflowbulkunarchiverequest.py b/src/mistralai/client/models/workflowbulkunarchiverequest.py new file mode 100644 index 00000000..6ffecd91 --- /dev/null +++ b/src/mistralai/client/models/workflowbulkunarchiverequest.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b04414883bed + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class WorkflowBulkUnarchiveRequestTypedDict(TypedDict): + workflow_ids: List[str] + r"""List of workflow IDs to unarchive""" + + +class WorkflowBulkUnarchiveRequest(BaseModel): + workflow_ids: List[str] + r"""List of workflow IDs to unarchive""" diff --git a/src/mistralai/client/models/workflowbulkunarchiveresponse.py b/src/mistralai/client/models/workflowbulkunarchiveresponse.py new file mode 100644 index 00000000..f2ab3727 --- /dev/null +++ b/src/mistralai/client/models/workflowbulkunarchiveresponse.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 34554c6df2e3 + +from __future__ import annotations +from .workflow import Workflow, WorkflowTypedDict +from .workflowbulkerror import WorkflowBulkError, WorkflowBulkErrorTypedDict +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 WorkflowBulkUnarchiveResponseTypedDict(TypedDict): + unarchived: List[WorkflowTypedDict] + r"""Workflows that were successfully unarchived or were already unarchived""" + errored: NotRequired[List[WorkflowBulkErrorTypedDict]] + r"""Workflows that could not be unarchived and the corresponding error messages""" + + +class WorkflowBulkUnarchiveResponse(BaseModel): + unarchived: List[Workflow] + r"""Workflows that were successfully unarchived or were already unarchived""" + + errored: Optional[List[WorkflowBulkError]] = None + r"""Workflows that could not be unarchived and the corresponding error messages""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["errored"]) + serialized = 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/workflowschedulelistresponse.py b/src/mistralai/client/models/workflowschedulelistresponse.py index 3c9eb3d7..21341eca 100644 --- a/src/mistralai/client/models/workflowschedulelistresponse.py +++ b/src/mistralai/client/models/workflowschedulelistresponse.py @@ -6,16 +6,53 @@ ScheduleDefinitionOutput, ScheduleDefinitionOutputTypedDict, ) -from mistralai.client.types import BaseModel +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer from typing import List -from typing_extensions import TypedDict +from typing_extensions import NotRequired, TypedDict class WorkflowScheduleListResponseTypedDict(TypedDict): schedules: List[ScheduleDefinitionOutputTypedDict] r"""A list of workflow schedules""" + next_page_token: NotRequired[Nullable[str]] + r"""Token for the next page of results""" class WorkflowScheduleListResponse(BaseModel): schedules: List[ScheduleDefinitionOutput] r"""A list of workflow schedules""" + + next_page_token: OptionalNullable[str] = UNSET + r"""Token for the next page of results""" + + @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/workflowscheduleupdaterequest.py b/src/mistralai/client/models/workflowscheduleupdaterequest.py new file mode 100644 index 00000000..b43dc96f --- /dev/null +++ b/src/mistralai/client/models/workflowscheduleupdaterequest.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 72ca0f5e6c08 + +from __future__ import annotations +from .partialscheduledefinition import ( + PartialScheduleDefinition, + PartialScheduleDefinitionTypedDict, +) +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowScheduleUpdateRequestTypedDict(TypedDict): + schedule: PartialScheduleDefinitionTypedDict + r"""Schedule definition for partial updates. + + All fields are optional (inherited from _ScheduleRequestBase). Only explicitly-set + fields are applied during an update; unset fields preserve the existing schedule values. + """ + + +class WorkflowScheduleUpdateRequest(BaseModel): + schedule: PartialScheduleDefinition + r"""Schedule definition for partial updates. + + All fields are optional (inherited from _ScheduleRequestBase). Only explicitly-set + fields are applied during an update; unset fields preserve the existing schedule values. + """ diff --git a/src/mistralai/client/models_.py b/src/mistralai/client/models_.py index 2a00325f..6263ead9 100644 --- a/src/mistralai/client/models_.py +++ b/src/mistralai/client/models_.py @@ -88,7 +88,7 @@ def list( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -184,7 +184,7 @@ async def list_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -277,7 +277,7 @@ def retrieve( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -372,7 +372,7 @@ async def retrieve_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -467,7 +467,7 @@ def delete( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -560,7 +560,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -668,7 +668,7 @@ def update( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -772,7 +772,7 @@ async def update_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -861,7 +861,7 @@ def archive( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -948,7 +948,7 @@ async def archive_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1035,7 +1035,7 @@ def unarchive( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1122,7 +1122,7 @@ async def unarchive_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/ocr.py b/src/mistralai/client/ocr.py index c290b1bb..e0bc4e0e 100644 --- a/src/mistralai/client/ocr.py +++ b/src/mistralai/client/ocr.py @@ -132,7 +132,7 @@ def process( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -272,7 +272,7 @@ async def process_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/rag.py b/src/mistralai/client/rag.py index 091b0270..934b2374 100644 --- a/src/mistralai/client/rag.py +++ b/src/mistralai/client/rag.py @@ -6,11 +6,13 @@ from mistralai.client.ingestion_pipeline_configurations import ( IngestionPipelineConfigurations, ) +from mistralai.client.search_indexes import SearchIndexes from typing import Optional class Rag(BaseSDK): ingestion_pipeline_configurations: IngestionPipelineConfigurations + search_indexes: SearchIndexes def __init__( self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None @@ -23,3 +25,6 @@ def _init_sdks(self): self.ingestion_pipeline_configurations = IngestionPipelineConfigurations( self.sdk_configuration, parent_ref=self.parent_ref ) + self.search_indexes = SearchIndexes( + self.sdk_configuration, parent_ref=self.parent_ref + ) diff --git a/src/mistralai/client/records.py b/src/mistralai/client/records.py index 2ac04c2f..5a4c3c84 100644 --- a/src/mistralai/client/records.py +++ b/src/mistralai/client/records.py @@ -81,7 +81,7 @@ def fetch( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -174,7 +174,7 @@ async def fetch_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -267,7 +267,7 @@ def delete( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -360,7 +360,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -456,7 +456,7 @@ def bulk_delete( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -552,7 +552,7 @@ async def bulk_delete_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -661,7 +661,7 @@ def judge( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -770,7 +770,7 @@ async def judge_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -875,7 +875,7 @@ def update_payload( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -980,7 +980,7 @@ async def update_payload_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1085,7 +1085,7 @@ def update_properties( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1190,7 +1190,7 @@ async def update_properties_async( ), ), request=req, - error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/runs.py b/src/mistralai/client/runs.py index d1a242fb..01507e33 100644 --- a/src/mistralai/client/runs.py +++ b/src/mistralai/client/runs.py @@ -102,7 +102,7 @@ def list_runs( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -120,8 +120,8 @@ def next_func() -> Optional[models.ListRunsV1WorkflowsRunsGetResponse]: 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: + limit_ = request.page_size if isinstance(request.page_size, int) else 50 + if len(results[0]) < limit_: return None return self.list_runs( @@ -249,7 +249,7 @@ async def list_runs_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -272,8 +272,8 @@ async def 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: + 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( @@ -381,7 +381,7 @@ def get_run( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -472,7 +472,7 @@ async def get_run_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -566,7 +566,7 @@ def get_run_history( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -660,7 +660,7 @@ async def get_run_history_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/schedules.py b/src/mistralai/client/schedules.py index 9b013acd..c56e4973 100644 --- a/src/mistralai/client/schedules.py +++ b/src/mistralai/client/schedules.py @@ -2,25 +2,38 @@ # @generated-id: d3b4fe452390 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, Mapping, Optional, Union +from typing import Any, Awaitable, Dict, List, Mapping, Optional, Union class Schedules(BaseSDK): def get_schedules( self, *, + workflow_name: OptionalNullable[str] = UNSET, + user_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[ + models.GetSchedulesV1WorkflowsSchedulesGetStatus + ] = UNSET, + page_size: OptionalNullable[int] = UNSET, + 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, - ) -> models.WorkflowScheduleListResponse: + ) -> Optional[models.GetSchedulesV1WorkflowsSchedulesGetResponse]: r"""Get Schedules + :param workflow_name: Filter by workflow name + :param user_id: Filter by user ID. Pass 'current' to resolve to the authenticated user's ID. + :param status: Filter by schedule status: 'active' or 'paused' + :param page_size: Number of items per page. Omitting this parameter fetches all results at once (deprecated — pass page_size to use pagination). + :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 @@ -38,12 +51,21 @@ def get_schedules( base_url = server_url else: base_url = self._get_url(base_url, url_variables) + + request = models.GetSchedulesV1WorkflowsSchedulesGetRequest( + workflow_name=workflow_name, + user_id=user_id, + status=status, + page_size=page_size, + next_page_token=next_page_token, + ) + req = self._build_request( method="GET", path="/v1/workflows/schedules", 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, @@ -74,14 +96,53 @@ def get_schedules( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) + def next_func() -> Optional[models.GetSchedulesV1WorkflowsSchedulesGetResponse]: + 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("$.schedules").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit_ = request.page_size if isinstance(request.page_size, int) else 0 + if len(results[0]) < limit_: + return None + + return self.get_schedules( + workflow_name=workflow_name, + user_id=user_id, + status=status, + 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 unmarshal_json_response( - models.WorkflowScheduleListResponse, http_res + return models.GetSchedulesV1WorkflowsSchedulesGetResponse( + result=unmarshal_json_response( + models.WorkflowScheduleListResponse, 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) @@ -94,13 +155,25 @@ def get_schedules( async def get_schedules_async( self, *, + workflow_name: OptionalNullable[str] = UNSET, + user_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[ + models.GetSchedulesV1WorkflowsSchedulesGetStatus + ] = UNSET, + page_size: OptionalNullable[int] = UNSET, + 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, - ) -> models.WorkflowScheduleListResponse: + ) -> Optional[models.GetSchedulesV1WorkflowsSchedulesGetResponse]: r"""Get Schedules + :param workflow_name: Filter by workflow name + :param user_id: Filter by user ID. Pass 'current' to resolve to the authenticated user's ID. + :param status: Filter by schedule status: 'active' or 'paused' + :param page_size: Number of items per page. Omitting this parameter fetches all results at once (deprecated — pass page_size to use pagination). + :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 @@ -118,12 +191,21 @@ async def get_schedules_async( base_url = server_url else: base_url = self._get_url(base_url, url_variables) + + request = models.GetSchedulesV1WorkflowsSchedulesGetRequest( + workflow_name=workflow_name, + user_id=user_id, + status=status, + page_size=page_size, + next_page_token=next_page_token, + ) + req = self._build_request_async( method="GET", path="/v1/workflows/schedules", 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, @@ -154,14 +236,58 @@ async def get_schedules_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) + def next_func() -> ( + Awaitable[Optional[models.GetSchedulesV1WorkflowsSchedulesGetResponse]] + ): + 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("$.schedules").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 0 + if len(results[0]) < limit_: + return empty_result() + + return self.get_schedules_async( + workflow_name=workflow_name, + user_id=user_id, + status=status, + 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 unmarshal_json_response( - models.WorkflowScheduleListResponse, http_res + return models.GetSchedulesV1WorkflowsSchedulesGetResponse( + result=unmarshal_json_response( + models.WorkflowScheduleListResponse, 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) @@ -267,7 +393,7 @@ def schedule_workflow( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -384,7 +510,7 @@ async def schedule_workflow_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -405,6 +531,188 @@ async def schedule_workflow_async( raise errors.SDKError("Unexpected response received", http_res) + def get_schedule( + 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, + ) -> models.ScheduleDefinitionOutput: + r"""Get Schedule + + :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.GetScheduleV1WorkflowsSchedulesScheduleIDGetRequest( + schedule_id=schedule_id, + ) + + req = self._build_request( + method="GET", + 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="get_schedule_v1_workflows_schedules__schedule_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ScheduleDefinitionOutput, 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_schedule_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, + ) -> models.ScheduleDefinitionOutput: + r"""Get Schedule + + :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.GetScheduleV1WorkflowsSchedulesScheduleIDGetRequest( + schedule_id=schedule_id, + ) + + req = self._build_request_async( + method="GET", + 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="get_schedule_v1_workflows_schedules__schedule_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ScheduleDefinitionOutput, 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, *, @@ -475,7 +783,7 @@ def unschedule_workflow( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -566,7 +874,7 @@ async def unschedule_workflow_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -587,6 +895,226 @@ async def unschedule_workflow_async( raise errors.SDKError("Unexpected response received", http_res) + def update_schedule( + self, + *, + schedule_id: str, + schedule: Union[ + models.PartialScheduleDefinition, models.PartialScheduleDefinitionTypedDict + ], + 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"""Update Schedule + + :param schedule_id: + :param schedule: Schedule definition for partial updates. + + All fields are optional (inherited from _ScheduleRequestBase). Only explicitly-set + fields are applied during an update; unset fields preserve the existing schedule values. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateScheduleV1WorkflowsSchedulesScheduleIDPatchRequest( + schedule_id=schedule_id, + workflow_schedule_update_request=models.WorkflowScheduleUpdateRequest( + schedule=utils.get_pydantic_model( + schedule, models.PartialScheduleDefinition + ), + ), + ) + + req = self._build_request( + method="PATCH", + path="/v1/workflows/schedules/{schedule_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.workflow_schedule_update_request, + False, + False, + "json", + models.WorkflowScheduleUpdateRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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_schedule_v1_workflows_schedules__schedule_id__patch", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "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 update_schedule_async( + self, + *, + schedule_id: str, + schedule: Union[ + models.PartialScheduleDefinition, models.PartialScheduleDefinitionTypedDict + ], + 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"""Update Schedule + + :param schedule_id: + :param schedule: Schedule definition for partial updates. + + All fields are optional (inherited from _ScheduleRequestBase). Only explicitly-set + fields are applied during an update; unset fields preserve the existing schedule values. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateScheduleV1WorkflowsSchedulesScheduleIDPatchRequest( + schedule_id=schedule_id, + workflow_schedule_update_request=models.WorkflowScheduleUpdateRequest( + schedule=utils.get_pydantic_model( + schedule, models.PartialScheduleDefinition + ), + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/v1/workflows/schedules/{schedule_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.workflow_schedule_update_request, + False, + False, + "json", + models.WorkflowScheduleUpdateRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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_schedule_v1_workflows_schedules__schedule_id__patch", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "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 pause_schedule( self, *, @@ -671,7 +1199,7 @@ def pause_schedule( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -776,7 +1304,7 @@ async def pause_schedule_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -881,7 +1409,7 @@ def resume_schedule( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -986,7 +1514,7 @@ async def resume_schedule_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/sdk.py b/src/mistralai/client/sdk.py index 03338f46..86de8dd9 100644 --- a/src/mistralai/client/sdk.py +++ b/src/mistralai/client/sdk.py @@ -119,7 +119,9 @@ def __init__( ), "The provided async_client must implement the AsyncHttpClient protocol." security: Any = None - if callable(api_key): + if api_key is None: + security = None + elif callable(api_key): # pylint: disable=unnecessary-lambda-assignment security = lambda: models_.Security(api_key=api_key()) else: diff --git a/src/mistralai/client/search_indexes.py b/src/mistralai/client/search_indexes.py new file mode 100644 index 00000000..522ae338 --- /dev/null +++ b/src/mistralai/client/search_indexes.py @@ -0,0 +1,384 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c5a0a7df993a + +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, List, Mapping, Optional, Union + + +class SearchIndexes(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.SearchIndexResponse]: + r"""Get Search Indexes + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is 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/search_index", + 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_search_indexes_v1_rag_search_index_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(List[models.SearchIndexResponse], 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.SearchIndexResponse]: + r"""Get Search Indexes + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is 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/search_index", + 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_search_indexes_v1_rag_search_index_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(List[models.SearchIndexResponse], 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, + index: Union[ + models.CreateSearchIndexInfoRequestIndex, + models.CreateSearchIndexInfoRequestIndexTypedDict, + ], + document_count: OptionalNullable[int] = UNSET, + status: Optional[models.CreateSearchIndexInfoRequestStatus] = "offline", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SearchIndexResponse: + r"""Register Search Index + + :param name: + :param index: + :param document_count: + :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 timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateSearchIndexInfoRequest( + name=name, + document_count=document_count, + status=status, + index=utils.get_pydantic_model( + index, models.CreateSearchIndexInfoRequestIndex + ), + ) + + req = self._build_request( + method="PUT", + path="/v1/rag/search_index", + 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.CreateSearchIndexInfoRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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_search_index_v1_rag_search_index_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.SearchIndexResponse, 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, + index: Union[ + models.CreateSearchIndexInfoRequestIndex, + models.CreateSearchIndexInfoRequestIndexTypedDict, + ], + document_count: OptionalNullable[int] = UNSET, + status: Optional[models.CreateSearchIndexInfoRequestStatus] = "offline", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SearchIndexResponse: + r"""Register Search Index + + :param name: + :param index: + :param document_count: + :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 timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateSearchIndexInfoRequest( + name=name, + document_count=document_count, + status=status, + index=utils.get_pydantic_model( + index, models.CreateSearchIndexInfoRequestIndex + ), + ) + + req = self._build_request_async( + method="PUT", + path="/v1/rag/search_index", + 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.CreateSearchIndexInfoRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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_search_index_v1_rag_search_index_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.SearchIndexResponse, 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/speech.py b/src/mistralai/client/speech.py index 4893684b..42cb1bbb 100644 --- a/src/mistralai/client/speech.py +++ b/src/mistralai/client/speech.py @@ -180,7 +180,7 @@ def complete( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -376,7 +376,7 @@ async def complete_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) diff --git a/src/mistralai/client/transcriptions.py b/src/mistralai/client/transcriptions.py index d84b59f8..b63fd5d0 100644 --- a/src/mistralai/client/transcriptions.py +++ b/src/mistralai/client/transcriptions.py @@ -110,7 +110,7 @@ def complete( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -222,7 +222,7 @@ async def complete_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -338,7 +338,7 @@ def stream( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -460,7 +460,7 @@ async def stream_async( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) diff --git a/src/mistralai/client/voices.py b/src/mistralai/client/voices.py index e19d5d5a..2810b922 100644 --- a/src/mistralai/client/voices.py +++ b/src/mistralai/client/voices.py @@ -8,7 +8,7 @@ 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 +from typing import Any, List, Mapping, Optional, Union class Voices(BaseSDK): @@ -90,7 +90,7 @@ def list( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -189,7 +189,7 @@ async def list_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -221,6 +221,10 @@ def create( age: OptionalNullable[int] = UNSET, tags: OptionalNullable[List[str]] = UNSET, color: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + appearance: OptionalNullable[ + Union[models.VoiceAppearance, models.VoiceAppearanceTypedDict] + ] = UNSET, retention_notice: Optional[int] = 30, sample_filename: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -240,6 +244,8 @@ def create( :param age: :param tags: :param color: + :param description: + :param appearance: :param retention_notice: :param sample_filename: Original filename for extension detection :param retries: Override the default retry configuration for this method @@ -268,6 +274,10 @@ def create( age=age, tags=tags, color=color, + description=description, + appearance=utils.get_pydantic_model( + appearance, OptionalNullable[models.VoiceAppearance] + ), retention_notice=retention_notice, sample_audio=sample_audio, sample_filename=sample_filename, @@ -312,7 +322,7 @@ def create( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -344,6 +354,10 @@ async def create_async( age: OptionalNullable[int] = UNSET, tags: OptionalNullable[List[str]] = UNSET, color: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + appearance: OptionalNullable[ + Union[models.VoiceAppearance, models.VoiceAppearanceTypedDict] + ] = UNSET, retention_notice: Optional[int] = 30, sample_filename: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -363,6 +377,8 @@ async def create_async( :param age: :param tags: :param color: + :param description: + :param appearance: :param retention_notice: :param sample_filename: Original filename for extension detection :param retries: Override the default retry configuration for this method @@ -391,6 +407,10 @@ async def create_async( age=age, tags=tags, color=color, + description=description, + appearance=utils.get_pydantic_model( + appearance, OptionalNullable[models.VoiceAppearance] + ), retention_notice=retention_notice, sample_audio=sample_audio, sample_filename=sample_filename, @@ -435,7 +455,7 @@ async def create_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -528,7 +548,7 @@ def delete( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -621,7 +641,7 @@ async def delete_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -651,6 +671,10 @@ def update( gender: OptionalNullable[str] = UNSET, age: OptionalNullable[int] = UNSET, tags: OptionalNullable[List[str]] = UNSET, + description: OptionalNullable[str] = UNSET, + appearance: OptionalNullable[ + Union[models.VoiceAppearance, models.VoiceAppearanceTypedDict] + ] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -666,6 +690,8 @@ def update( :param gender: :param age: :param tags: + :param description: + :param appearance: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -692,6 +718,10 @@ def update( gender=gender, age=age, tags=tags, + description=description, + appearance=utils.get_pydantic_model( + appearance, OptionalNullable[models.VoiceAppearance] + ), ), ) @@ -738,7 +768,7 @@ def update( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -768,6 +798,10 @@ async def update_async( gender: OptionalNullable[str] = UNSET, age: OptionalNullable[int] = UNSET, tags: OptionalNullable[List[str]] = UNSET, + description: OptionalNullable[str] = UNSET, + appearance: OptionalNullable[ + Union[models.VoiceAppearance, models.VoiceAppearanceTypedDict] + ] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -783,6 +817,8 @@ async def update_async( :param gender: :param age: :param tags: + :param description: + :param appearance: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -809,6 +845,10 @@ async def update_async( gender=gender, age=age, tags=tags, + description=description, + appearance=utils.get_pydantic_model( + appearance, OptionalNullable[models.VoiceAppearance] + ), ), ) @@ -855,7 +895,7 @@ async def update_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -948,7 +988,7 @@ def get( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1041,7 +1081,7 @@ async def get_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1134,7 +1174,7 @@ def get_sample_audio( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -1230,7 +1270,7 @@ async def get_sample_audio_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) diff --git a/src/mistralai/client/workflows.py b/src/mistralai/client/workflows.py index 2693b05b..a6015946 100644 --- a/src/mistralai/client/workflows.py +++ b/src/mistralai/client/workflows.py @@ -377,7 +377,7 @@ def get_workflows( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -395,8 +395,8 @@ def next_func() -> Optional[models.GetWorkflowsV1WorkflowsGetResponse]: 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: + limit_ = request.limit if isinstance(request.limit, int) else 50 + if len(results[0]) < limit_: return None return self.get_workflows( @@ -517,7 +517,7 @@ async def get_workflows_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -540,8 +540,8 @@ async def 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: + limit_ = request.limit if isinstance(request.limit, int) else 50 + if len(results[0]) < limit_: return empty_result() return self.get_workflows_async( @@ -674,7 +674,7 @@ def get_workflow_registrations( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -794,7 +794,7 @@ async def get_workflow_registrations_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -920,7 +920,7 @@ def execute_workflow( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1047,7 +1047,7 @@ async def execute_workflow_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1177,7 +1177,7 @@ def execute_workflow_registration( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1307,7 +1307,7 @@ async def execute_workflow_registration_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1401,7 +1401,7 @@ def get_workflow( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1492,7 +1492,7 @@ async def get_workflow_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1601,7 +1601,7 @@ def update_workflow( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1710,7 +1710,7 @@ async def update_workflow_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1807,7 +1807,7 @@ def get_workflow_registration( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1906,7 +1906,7 @@ async def get_workflow_registration_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -1929,6 +1929,386 @@ async def get_workflow_registration_async( raise errors.SDKError("Unexpected response received", http_res) + def bulk_archive_workflows( + self, + *, + workflow_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.WorkflowBulkArchiveResponse: + r"""Bulk Archive Workflows + + :param workflow_ids: List of workflow IDs to archive + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.WorkflowBulkArchiveRequest( + workflow_ids=workflow_ids, + ) + + req = self._build_request( + method="PUT", + path="/v1/workflows/archive", + 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.WorkflowBulkArchiveRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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="bulk_archive_workflows_v1_workflows_archive_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowBulkArchiveResponse, 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 bulk_archive_workflows_async( + self, + *, + workflow_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.WorkflowBulkArchiveResponse: + r"""Bulk Archive Workflows + + :param workflow_ids: List of workflow IDs to archive + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.WorkflowBulkArchiveRequest( + workflow_ids=workflow_ids, + ) + + req = self._build_request_async( + method="PUT", + path="/v1/workflows/archive", + 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.WorkflowBulkArchiveRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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="bulk_archive_workflows_v1_workflows_archive_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowBulkArchiveResponse, 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 bulk_unarchive_workflows( + self, + *, + workflow_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.WorkflowBulkUnarchiveResponse: + r"""Bulk Unarchive Workflows + + :param workflow_ids: List of workflow IDs to unarchive + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.WorkflowBulkUnarchiveRequest( + workflow_ids=workflow_ids, + ) + + req = self._build_request( + method="PUT", + path="/v1/workflows/unarchive", + 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.WorkflowBulkUnarchiveRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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="bulk_unarchive_workflows_v1_workflows_unarchive_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowBulkUnarchiveResponse, 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 bulk_unarchive_workflows_async( + self, + *, + workflow_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.WorkflowBulkUnarchiveResponse: + r"""Bulk Unarchive Workflows + + :param workflow_ids: List of workflow IDs to unarchive + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.WorkflowBulkUnarchiveRequest( + workflow_ids=workflow_ids, + ) + + req = self._build_request_async( + method="PUT", + path="/v1/workflows/unarchive", + 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.WorkflowBulkUnarchiveRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + 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="bulk_unarchive_workflows_v1_workflows_unarchive_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowBulkUnarchiveResponse, 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, *, @@ -1999,7 +2379,7 @@ def archive_workflow( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2090,7 +2470,7 @@ async def archive_workflow_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2183,7 +2563,7 @@ def unarchive_workflow( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -2276,7 +2656,7 @@ async def unarchive_workflow_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/client/workflows_events.py b/src/mistralai/client/workflows_events.py index 71e44ac7..fbf5bc11 100644 --- a/src/mistralai/client/workflows_events.py +++ b/src/mistralai/client/workflows_events.py @@ -116,7 +116,7 @@ def get_stream_events( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -252,7 +252,7 @@ async def get_stream_events_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), stream=True, retry_config=retry_config, ) @@ -365,7 +365,7 @@ def get_workflow_events( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) @@ -468,7 +468,7 @@ async def get_workflow_events_async( ), ), request=req, - error_status_codes=["422", "4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/src/mistralai/extra/workflows/encoding/config.py b/src/mistralai/extra/workflows/encoding/config.py index ff849fd7..af02f64a 100644 --- a/src/mistralai/extra/workflows/encoding/config.py +++ b/src/mistralai/extra/workflows/encoding/config.py @@ -16,6 +16,7 @@ class BlobStorageConfig(BaseModel): # Azure settings container_name: Optional[str] = None azure_connection_string: Optional[SecretStr] = None + azure_storage_account_url: Optional[str] = None # GCS settings bucket_id: Optional[str] = None diff --git a/src/mistralai/extra/workflows/encoding/payload_encoder.py b/src/mistralai/extra/workflows/encoding/payload_encoder.py index 611f33fa..1a7fe7ae 100644 --- a/src/mistralai/extra/workflows/encoding/payload_encoder.py +++ b/src/mistralai/extra/workflows/encoding/payload_encoder.py @@ -9,7 +9,7 @@ import urllib.parse from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union -from pydantic import BaseModel +from pydantic import BaseModel, ValidationError if TYPE_CHECKING: from cryptography.exceptions import InvalidTag @@ -38,6 +38,7 @@ NetworkEncodedResult, WorkflowContext, ) +from mistralai.client.models.jsonpatchpayloadresponse import JSONPatchPayloadResponse from mistralai.extra.exceptions import ( WorkflowPayloadEncryptionException, WorkflowPayloadOffloadingException, @@ -151,7 +152,10 @@ def _decrypt(self, data: bytes) -> bytes: 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: + if ( + self.offloading_config is None + or self.offloading_config.storage_config is None + ): raise WorkflowPayloadOffloadingException( "You must configure payload offloading storage" ) @@ -281,7 +285,10 @@ async def encode_event_payload_content( if self.encryption_config is None: return data, [] - if force_full_encryption or self.encryption_config.mode == PayloadEncryptionMode.FULL: + if ( + force_full_encryption + or self.encryption_config.mode == PayloadEncryptionMode.FULL + ): encrypted_data = self._encrypt(data) return encrypted_data, [EncodedPayloadOptions.ENCRYPTED] @@ -339,8 +346,28 @@ async def decode_event_payload( return payload_data encoding_options = [EncodedPayloadOptions(opt) for opt in encoding_options_strs] + + # Handle selective encryption for json_patch payloads + if EncodedPayloadOptions.PARTIALLY_ENCRYPTED in encoding_options: + try: + payload = JSONPatchPayloadResponse.model_validate(payload_data) + if isinstance(payload.value, list): + decrypted_patches = self._decrypt_json_patch_selective( + [p.model_dump() for p in payload.value] + ) + return { + "type": payload.type, + "value": decrypted_patches, + "encoding_options": [], + } + except ValidationError: + pass # Not a json_patch payload, fall through to full decryption + + # Standard full encryption (base64 string value) encrypted_bytes = base64.b64decode(payload_data["value"]) - decrypted_bytes = await self.decode_payload_content(encrypted_bytes, encoding_options) + decrypted_bytes = await self.decode_payload_content( + encrypted_bytes, encoding_options + ) decrypted_value = json.loads(decrypted_bytes) return { @@ -349,6 +376,34 @@ async def decode_event_payload( "encoding_options": [], } + _ENCRYPTED_PATCH_TYPE = "__encrypted__" + + def _decrypt_json_patch_selective( + self, patches: List[Dict[str, Any]] + ) -> List[Dict[str, Any]]: + """Decrypt patches with EncryptedPatchValue wrapper: {type: "__encrypted__", value: "base64..."}.""" + decrypted = [] + for patch in patches: + patch_value = patch.get("value") + + # EncryptedPatchValue format: {"type": "__encrypted__", "value": "base64-encrypted-data"} + if ( + isinstance(patch_value, dict) + and patch_value.get("type") == self._ENCRYPTED_PATCH_TYPE + ): + encrypted_b64 = patch_value.get("value", "") + encrypted_data = base64.b64decode(encrypted_b64) + decrypted_bytes = self._decrypt(encrypted_data) + decrypted.append( + { + **patch, + "value": json.loads(decrypted_bytes), + } + ) + else: + decrypted.append(patch) + return decrypted + async def encode_network_input( self, data: Optional[Dict[str, Any]], context: WorkflowContext ) -> NetworkEncodedInput: diff --git a/src/mistralai/extra/workflows/encoding/storage/_azure.py b/src/mistralai/extra/workflows/encoding/storage/_azure.py index e62d9926..8865634c 100644 --- a/src/mistralai/extra/workflows/encoding/storage/_azure.py +++ b/src/mistralai/extra/workflows/encoding/storage/_azure.py @@ -3,6 +3,7 @@ from typing import Any, cast from azure.core.exceptions import ResourceNotFoundError +from azure.identity.aio import DefaultAzureCredential from azure.storage.blob.aio import BlobServiceClient from .blob_storage import BlobNotFoundError, BlobStorage @@ -11,14 +12,25 @@ class AzureBlobStorage(BlobStorage): def __init__( self, container_name: str, - azure_connection_string: str, + azure_connection_string: str | None = None, prefix: str | None = None, + azure_storage_account_url: str | None = None, ): + if azure_connection_string and azure_storage_account_url: + raise ValueError( + "azure_connection_string and azure_storage_account_url are mutually exclusive" + ) + if not azure_connection_string and not azure_storage_account_url: + raise ValueError( + "Either azure_connection_string or azure_storage_account_url must be provided" + ) self.container_name = container_name self.connection_string = azure_connection_string + self.account_url = azure_storage_account_url self.prefix = prefix or "" self._service_client: BlobServiceClient | None = None self._container_client: Any = None + self._credential: Any = None def _get_full_key(self, key: str) -> str: if not self.prefix: @@ -28,9 +40,16 @@ def _get_full_key(self, key: str) -> str: return f"{self.prefix}/{key}" async def __aenter__(self) -> "AzureBlobStorage": - self._service_client = BlobServiceClient.from_connection_string( - self.connection_string - ) + if self.connection_string: + self._service_client = BlobServiceClient.from_connection_string( + self.connection_string + ) + else: + assert self.account_url is not None + self._credential = DefaultAzureCredential() + self._service_client = BlobServiceClient( + self.account_url, credential=self._credential + ) assert self._service_client is not None self._container_client = self._service_client.get_container_client( self.container_name @@ -40,6 +59,8 @@ async def __aenter__(self) -> "AzureBlobStorage": async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: if self._service_client: await self._service_client.close() + if self._credential: + await self._credential.close() async def upload_blob(self, key: str, content: bytes) -> str: full_key = self._get_full_key(key) diff --git a/src/mistralai/extra/workflows/encoding/storage/blob_storage.py b/src/mistralai/extra/workflows/encoding/storage/blob_storage.py index ce488421..e267b979 100644 --- a/src/mistralai/extra/workflows/encoding/storage/blob_storage.py +++ b/src/mistralai/extra/workflows/encoding/storage/blob_storage.py @@ -65,8 +65,8 @@ async def get_blob_storage( 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]'" + "Azure Blob Storage support requires azure-storage-blob and azure-identity. " + "Install with: pip install 'mistralai[workflow_payload_offloading_azure]'" ) from e if not blob_storage_config.container_name: @@ -78,14 +78,11 @@ async def get_blob_storage( 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, + azure_storage_account_url=blob_storage_config.azure_storage_account_url, ) elif blob_storage_config.storage_provider == StorageProvider.GCS: diff --git a/src/mistralai/extra/workflows/helpers.py b/src/mistralai/extra/workflows/helpers.py index 508c4b97..901fae45 100644 --- a/src/mistralai/extra/workflows/helpers.py +++ b/src/mistralai/extra/workflows/helpers.py @@ -70,7 +70,7 @@ async def get_scheduler_namespace( ), ), request=req, - error_status_codes=["4XX", "5XX"], + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), retry_config=retry_config, ) diff --git a/tests/test_azure_v2_parity.py b/tests/test_azure_v2_parity.py index 8cd89bf4..1c2c6ab1 100644 --- a/tests/test_azure_v2_parity.py +++ b/tests/test_azure_v2_parity.py @@ -50,17 +50,17 @@ def mark_tested(resource: str, method: str) -> None: ("messages", _EMPTY), ("model", "azureai"), ("temperature", UNSET), - ("top_p", None), + ("top_p", UNSET), ("max_tokens", UNSET), ("stream", False), - ("stop", None), + ("stop", UNSET), ("random_seed", UNSET), ("metadata", UNSET), ("response_format", None), ("tools", UNSET), ("tool_choice", None), - ("presence_penalty", None), - ("frequency_penalty", None), + ("presence_penalty", UNSET), + ("frequency_penalty", UNSET), ("n", UNSET), ("prediction", None), ("parallel_tool_calls", None), @@ -80,7 +80,6 @@ def mark_tested(resource: str, method: str) -> None: OCR_PROCESS_PARAMS = [ ("model", _EMPTY), ("document", _EMPTY), - ("id", None), ("pages", UNSET), ("include_image_base64", UNSET), ("image_limit", UNSET), diff --git a/tests/test_gcp_v2_parity.py b/tests/test_gcp_v2_parity.py index 0d6471e4..71ca1348 100644 --- a/tests/test_gcp_v2_parity.py +++ b/tests/test_gcp_v2_parity.py @@ -51,17 +51,17 @@ def mark_tested(resource: str, method: str) -> None: ("model", _EMPTY), ("messages", _EMPTY), ("temperature", UNSET), - ("top_p", None), + ("top_p", UNSET), ("max_tokens", UNSET), ("stream", False), - ("stop", None), + ("stop", UNSET), ("random_seed", UNSET), ("metadata", UNSET), ("response_format", None), ("tools", UNSET), ("tool_choice", None), - ("presence_penalty", None), - ("frequency_penalty", None), + ("presence_penalty", UNSET), + ("frequency_penalty", UNSET), ("n", UNSET), ("prediction", None), ("parallel_tool_calls", None), @@ -81,10 +81,10 @@ def mark_tested(resource: str, method: str) -> None: ("model", _EMPTY), ("prompt", _EMPTY), ("temperature", UNSET), - ("top_p", 1), + ("top_p", UNSET), ("max_tokens", UNSET), ("stream", False), - ("stop", None), + ("stop", UNSET), ("random_seed", UNSET), ("metadata", UNSET), ("suffix", UNSET), @@ -298,13 +298,13 @@ 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): + def test_complete_top_p_defaults_to_unset(self): sig = inspect.signature(Fim.complete) - assert sig.parameters["top_p"].default == 1 + assert sig.parameters["top_p"].default == UNSET - def test_stream_top_p_defaults_to_1(self): + def test_stream_top_p_defaults_to_unset(self): sig = inspect.signature(Fim.stream) - assert sig.parameters["top_p"].default == 1 + assert sig.parameters["top_p"].default == UNSET class TestGCPCoverage: diff --git a/uv.lock b/uv.lock index 2f23fc8b..d1b64c13 100644 --- a/uv.lock +++ b/uv.lock @@ -7,6 +7,10 @@ resolution-markers = [ "python_full_version < '3.11'", ] +[options] +exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for backwards compatibility when using relative exclude-newer values. +exclude-newer-span = "P7D" + [[package]] name = "aioboto3" version = "12.4.0" @@ -282,6 +286,22 @@ aio = [ { name = "aiohttp" }, ] +[[package]] +name = "azure-identity" +version = "1.25.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "azure-core" }, + { name = "cryptography" }, + { name = "msal" }, + { name = "msal-extensions" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c5/0e/3a63efb48aa4a5ae2cfca61ee152fbcb668092134d3eb8bfda472dd5c617/azure_identity-1.25.3.tar.gz", hash = "sha256:ab23c0d63015f50b630ef6c6cf395e7262f439ce06e5d07a64e874c724f8d9e6", size = 286304, upload-time = "2026-03-13T01:12:20.892Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/49/9a/417b3a533e01953a7c618884df2cb05a71e7b68bdbce4fbdb62349d2a2e8/azure_identity-1.25.3-py3-none-any.whl", hash = "sha256:f4d0b956a8146f30333e071374171f3cfa7bdb8073adb8c3814b65567aa7447c", size = 192138, upload-time = "2026-03-13T01:12:22.951Z" }, +] + [[package]] name = "azure-storage-blob" version = "12.28.0" @@ -1015,7 +1035,7 @@ wheels = [ [[package]] name = "mistralai" -version = "2.4.5" +version = "2.4.7" source = { editable = "." } dependencies = [ { name = "eval-type-backport" }, @@ -1046,10 +1066,12 @@ workflow-payload-encryption = [ ] workflow-payload-offloading = [ { name = "aioboto3" }, + { name = "azure-identity" }, { name = "azure-storage-blob", extra = ["aio"] }, { name = "gcloud-aio-storage" }, ] workflow-payload-offloading-azure = [ + { name = "azure-identity" }, { name = "azure-storage-blob", extra = ["aio"] }, ] workflow-payload-offloading-gcs = [ @@ -1086,6 +1108,7 @@ lint = [ 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-identity", extras = ["aio"], marker = "extra == 'workflow-payload-offloading-azure'", specifier = ">=1.25.0,<2.0.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" }, @@ -1131,6 +1154,32 @@ lint = [ { name = "ruff", specifier = ">=0.11.10,<0.12" }, ] +[[package]] +name = "msal" +version = "1.36.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, + { name = "pyjwt", extra = ["crypto"] }, + { name = "requests" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/de/cb/b02b0f748ac668922364ccb3c3bff5b71628a05f5adfec2ba2a5c3031483/msal-1.36.0.tar.gz", hash = "sha256:3f6a4af2b036b476a4215111c4297b4e6e236ed186cd804faefba23e4990978b", size = 174217, upload-time = "2026-04-09T10:20:33.525Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/d3/414d1f0a5f6f4fe5313c2b002c54e78a3332970feb3f5fed14237aa17064/msal-1.36.0-py3-none-any.whl", hash = "sha256:36ecac30e2ff4322d956029aabce3c82301c29f0acb1ad89b94edcabb0e58ec4", size = 121547, upload-time = "2026-04-09T10:20:32.336Z" }, +] + +[[package]] +name = "msal-extensions" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "msal" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/01/99/5d239b6156eddf761a636bded1118414d161bd6b7b37a9335549ed159396/msal_extensions-1.3.1.tar.gz", hash = "sha256:c5b0fd10f65ef62b5f1d62f4251d51cbcaf003fcedae8c91b040a488614be1a4", size = 23315, upload-time = "2025-03-14T23:51:03.902Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5e/75/bd9b7bb966668920f06b200e84454c8f3566b102183bc55c5473d96cb2b9/msal_extensions-1.3.1-py3-none-any.whl", hash = "sha256:96d3de4d034504e969ac5e85bae8106c8373b5c6568e4c8fa7af2eca9dbe6bca", size = 20583, upload-time = "2025-03-14T23:51:03.016Z" }, +] + [[package]] name = "multidict" version = "6.7.1"