diff --git a/.fernignore b/.fernignore new file mode 100644 index 0000000..084a8eb --- /dev/null +++ b/.fernignore @@ -0,0 +1 @@ +# Specify files that shouldn't be modified by Fern diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fa41c1f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,61 @@ +name: ci + +on: [push] +jobs: + compile: + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + - name: Compile + run: poetry run mypy . + test: + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + + - name: Test + run: poetry run pytest -rP . + + publish: + needs: [compile, test] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + - name: Publish to pypi + run: | + poetry config repositories.remote https://upload.pypi.org/legacy/ + poetry --no-interaction -v publish --build --repository remote --username "$PYPI_USERNAME" --password "$PYPI_PASSWORD" + env: + PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0da665f --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +dist/ +.mypy_cache/ +__pycache__/ +poetry.toml +.ruff_cache/ diff --git a/README.md b/README.md index e5b7519..5ba3a61 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,130 @@ -# vapi-python-sdk -The official Python SDK for accessing Vapi's API +# Vapi Python Library + +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern) +[![pypi](https://img.shields.io/pypi/v/Vapi)](https://pypi.python.org/pypi/Vapi) + +The Vapi Python library provides convenient access to the Vapi API from Python. + +## Installation + +```sh +pip install Vapi +``` + +## Usage + +Instantiate and use the client with the following: + +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.calls.create() +``` + +## Async Client + +The SDK also exports an `async` client so that you can make non-blocking calls to our API. + +```python +import asyncio + +from vapi import AsyncVapi + +client = AsyncVapi( + token="YOUR_TOKEN", +) + + +async def main() -> None: + await client.calls.create() + + +asyncio.run(main()) +``` + +## Exception Handling + +When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error +will be thrown. + +```python +from vapi.core.api_error import ApiError + +try: + client.calls.create(...) +except ApiError as e: + print(e.status_code) + print(e.body) +``` + +## Advanced + +### Retries + +The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long +as the request is deemed retriable and the number of retry attempts has not grown larger than the configured +retry limit (default: 2). + +A request is deemed retriable when any of the following HTTP status codes is returned: + +- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) +- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) +- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) + +Use the `max_retries` request option to configure this behavior. + +```python +client.calls.create(..., { + "max_retries": 1 +}) +``` + +### Timeouts + +The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level. + +```python + +from vapi import Vapi + +client = Vapi( + ..., + timeout=20.0, +) + + +# Override timeout for a specific method +client.calls.create(..., { + "timeout_in_seconds": 1 +}) +``` + +### Custom Client + +You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies +and transports. +```python +import httpx +from vapi import Vapi + +client = Vapi( + ..., + httpx_client=httpx.Client( + proxies="http://my.test.proxy.example.com", + transport=httpx.HTTPTransport(local_address="0.0.0.0"), + ), +) +``` + +## Contributing + +While we value open-source contributions to this SDK, this library is generated programmatically. +Additions made directly to this library would have to be moved over to our generation code, +otherwise they would be overwritten upon the next generated release. Feel free to open a PR as +a proof of concept, but know that we will not be able to merge it as-is. We suggest opening +an issue first to discuss with us! + +On the other hand, contributions to the README are always very welcome! diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..2346e35 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,503 @@ +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. + +[[package]] +name = "annotated-types" +version = "0.7.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.8" +files = [ + {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, + {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} + +[[package]] +name = "anyio" +version = "4.4.0" +description = "High level compatibility layer for multiple asynchronous event loop implementations" +optional = false +python-versions = ">=3.8" +files = [ + {file = "anyio-4.4.0-py3-none-any.whl", hash = "sha256:c1b2d8f46a8a812513012e1107cb0e68c17159a7a594208005a57dc776e1bdc7"}, + {file = "anyio-4.4.0.tar.gz", hash = "sha256:5aadc6a1bbb7cdb0bede386cac5e2940f5e2ff3aa20277e991cf028e0585ce94"}, +] + +[package.dependencies] +exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} +idna = ">=2.8" +sniffio = ">=1.1" +typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} + +[package.extras] +doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] +trio = ["trio (>=0.23)"] + +[[package]] +name = "certifi" +version = "2024.8.30" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, + {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, +] + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "exceptiongroup" +version = "1.2.2" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, +] + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "h11" +version = "0.14.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.7" +files = [ + {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, + {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, +] + +[[package]] +name = "httpcore" +version = "1.0.5" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpcore-1.0.5-py3-none-any.whl", hash = "sha256:421f18bac248b25d310f3cacd198d55b8e6125c107797b609ff9b7a6ba7991b5"}, + {file = "httpcore-1.0.5.tar.gz", hash = "sha256:34a38e2f9291467ee3b44e89dd52615370e152954ba21721378a87b2960f7a61"}, +] + +[package.dependencies] +certifi = "*" +h11 = ">=0.13,<0.15" + +[package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<0.26.0)"] + +[[package]] +name = "httpx" +version = "0.27.2" +description = "The next generation HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"}, + {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"}, +] + +[package.dependencies] +anyio = "*" +certifi = "*" +httpcore = "==1.*" +idna = "*" +sniffio = "*" + +[package.extras] +brotli = ["brotli", "brotlicffi"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "idna" +version = "3.10" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.6" +files = [ + {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, + {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, +] + +[package.extras] +all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + +[[package]] +name = "iniconfig" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.7" +files = [ + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, +] + +[[package]] +name = "mypy" +version = "1.0.1" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "mypy-1.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:71a808334d3f41ef011faa5a5cd8153606df5fc0b56de5b2e89566c8093a0c9a"}, + {file = "mypy-1.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:920169f0184215eef19294fa86ea49ffd4635dedfdea2b57e45cb4ee85d5ccaf"}, + {file = "mypy-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:27a0f74a298769d9fdc8498fcb4f2beb86f0564bcdb1a37b58cbbe78e55cf8c0"}, + {file = "mypy-1.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:65b122a993d9c81ea0bfde7689b3365318a88bde952e4dfa1b3a8b4ac05d168b"}, + {file = "mypy-1.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:5deb252fd42a77add936b463033a59b8e48eb2eaec2976d76b6878d031933fe4"}, + {file = "mypy-1.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2013226d17f20468f34feddd6aae4635a55f79626549099354ce641bc7d40262"}, + {file = "mypy-1.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:48525aec92b47baed9b3380371ab8ab6e63a5aab317347dfe9e55e02aaad22e8"}, + {file = "mypy-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c96b8a0c019fe29040d520d9257d8c8f122a7343a8307bf8d6d4a43f5c5bfcc8"}, + {file = "mypy-1.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:448de661536d270ce04f2d7dddaa49b2fdba6e3bd8a83212164d4174ff43aa65"}, + {file = "mypy-1.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:d42a98e76070a365a1d1c220fcac8aa4ada12ae0db679cb4d910fabefc88b994"}, + {file = "mypy-1.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e64f48c6176e243ad015e995de05af7f22bbe370dbb5b32bd6988438ec873919"}, + {file = "mypy-1.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fdd63e4f50e3538617887e9aee91855368d9fc1dea30da743837b0df7373bc4"}, + {file = "mypy-1.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:dbeb24514c4acbc78d205f85dd0e800f34062efcc1f4a4857c57e4b4b8712bff"}, + {file = "mypy-1.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a2948c40a7dd46c1c33765718936669dc1f628f134013b02ff5ac6c7ef6942bf"}, + {file = "mypy-1.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5bc8d6bd3b274dd3846597855d96d38d947aedba18776aa998a8d46fabdaed76"}, + {file = "mypy-1.0.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:17455cda53eeee0a4adb6371a21dd3dbf465897de82843751cf822605d152c8c"}, + {file = "mypy-1.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e831662208055b006eef68392a768ff83596035ffd6d846786578ba1714ba8f6"}, + {file = "mypy-1.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e60d0b09f62ae97a94605c3f73fd952395286cf3e3b9e7b97f60b01ddfbbda88"}, + {file = "mypy-1.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:0af4f0e20706aadf4e6f8f8dc5ab739089146b83fd53cb4a7e0e850ef3de0bb6"}, + {file = "mypy-1.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:24189f23dc66f83b839bd1cce2dfc356020dfc9a8bae03978477b15be61b062e"}, + {file = "mypy-1.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:93a85495fb13dc484251b4c1fd7a5ac370cd0d812bbfc3b39c1bafefe95275d5"}, + {file = "mypy-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5f546ac34093c6ce33f6278f7c88f0f147a4849386d3bf3ae193702f4fe31407"}, + {file = "mypy-1.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c6c2ccb7af7154673c591189c3687b013122c5a891bb5651eca3db8e6c6c55bd"}, + {file = "mypy-1.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:15b5a824b58c7c822c51bc66308e759243c32631896743f030daf449fe3677f3"}, + {file = "mypy-1.0.1-py3-none-any.whl", hash = "sha256:eda5c8b9949ed411ff752b9a01adda31afe7eae1e53e946dbdf9db23865e66c4"}, + {file = "mypy-1.0.1.tar.gz", hash = "sha256:28cea5a6392bb43d266782983b5a4216c25544cd7d80be681a155ddcdafd152d"}, +] + +[package.dependencies] +mypy-extensions = ">=0.4.3" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=3.10" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +install-types = ["pip"] +python2 = ["typed-ast (>=1.4.0,<2)"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.5" +files = [ + {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, + {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, +] + +[[package]] +name = "packaging" +version = "24.1" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, + {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "pydantic" +version = "2.9.1" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic-2.9.1-py3-none-any.whl", hash = "sha256:7aff4db5fdf3cf573d4b3c30926a510a10e19a0774d38fc4967f78beb6deb612"}, + {file = "pydantic-2.9.1.tar.gz", hash = "sha256:1363c7d975c7036df0db2b4a61f2e062fbc0aa5ab5f2772e0ffc7191a4f4bce2"}, +] + +[package.dependencies] +annotated-types = ">=0.6.0" +pydantic-core = "2.23.3" +typing-extensions = [ + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, + {version = ">=4.6.1", markers = "python_version < \"3.13\""}, +] + +[package.extras] +email = ["email-validator (>=2.0.0)"] +timezone = ["tzdata"] + +[[package]] +name = "pydantic-core" +version = "2.23.3" +description = "Core functionality for Pydantic validation and serialization" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic_core-2.23.3-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:7f10a5d1b9281392f1bf507d16ac720e78285dfd635b05737c3911637601bae6"}, + {file = "pydantic_core-2.23.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3c09a7885dd33ee8c65266e5aa7fb7e2f23d49d8043f089989726391dd7350c5"}, + {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6470b5a1ec4d1c2e9afe928c6cb37eb33381cab99292a708b8cb9aa89e62429b"}, + {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9172d2088e27d9a185ea0a6c8cebe227a9139fd90295221d7d495944d2367700"}, + {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86fc6c762ca7ac8fbbdff80d61b2c59fb6b7d144aa46e2d54d9e1b7b0e780e01"}, + {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f0cb80fd5c2df4898693aa841425ea1727b1b6d2167448253077d2a49003e0ed"}, + {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03667cec5daf43ac4995cefa8aaf58f99de036204a37b889c24a80927b629cec"}, + {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:047531242f8e9c2db733599f1c612925de095e93c9cc0e599e96cf536aaf56ba"}, + {file = "pydantic_core-2.23.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:5499798317fff7f25dbef9347f4451b91ac2a4330c6669821c8202fd354c7bee"}, + {file = "pydantic_core-2.23.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bbb5e45eab7624440516ee3722a3044b83fff4c0372efe183fd6ba678ff681fe"}, + {file = "pydantic_core-2.23.3-cp310-none-win32.whl", hash = "sha256:8b5b3ed73abb147704a6e9f556d8c5cb078f8c095be4588e669d315e0d11893b"}, + {file = "pydantic_core-2.23.3-cp310-none-win_amd64.whl", hash = "sha256:2b603cde285322758a0279995b5796d64b63060bfbe214b50a3ca23b5cee3e83"}, + {file = "pydantic_core-2.23.3-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:c889fd87e1f1bbeb877c2ee56b63bb297de4636661cc9bbfcf4b34e5e925bc27"}, + {file = "pydantic_core-2.23.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ea85bda3189fb27503af4c45273735bcde3dd31c1ab17d11f37b04877859ef45"}, + {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a7f7f72f721223f33d3dc98a791666ebc6a91fa023ce63733709f4894a7dc611"}, + {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2b2b55b0448e9da68f56b696f313949cda1039e8ec7b5d294285335b53104b61"}, + {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c24574c7e92e2c56379706b9a3f07c1e0c7f2f87a41b6ee86653100c4ce343e5"}, + {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f2b05e6ccbee333a8f4b8f4d7c244fdb7a979e90977ad9c51ea31261e2085ce0"}, + {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2c409ce1c219c091e47cb03feb3c4ed8c2b8e004efc940da0166aaee8f9d6c8"}, + {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d965e8b325f443ed3196db890d85dfebbb09f7384486a77461347f4adb1fa7f8"}, + {file = "pydantic_core-2.23.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:f56af3a420fb1ffaf43ece3ea09c2d27c444e7c40dcb7c6e7cf57aae764f2b48"}, + {file = "pydantic_core-2.23.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5b01a078dd4f9a52494370af21aa52964e0a96d4862ac64ff7cea06e0f12d2c5"}, + {file = "pydantic_core-2.23.3-cp311-none-win32.whl", hash = "sha256:560e32f0df04ac69b3dd818f71339983f6d1f70eb99d4d1f8e9705fb6c34a5c1"}, + {file = "pydantic_core-2.23.3-cp311-none-win_amd64.whl", hash = "sha256:c744fa100fdea0d000d8bcddee95213d2de2e95b9c12be083370b2072333a0fa"}, + {file = "pydantic_core-2.23.3-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:e0ec50663feedf64d21bad0809f5857bac1ce91deded203efc4a84b31b2e4305"}, + {file = "pydantic_core-2.23.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:db6e6afcb95edbe6b357786684b71008499836e91f2a4a1e55b840955b341dbb"}, + {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:98ccd69edcf49f0875d86942f4418a4e83eb3047f20eb897bffa62a5d419c8fa"}, + {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a678c1ac5c5ec5685af0133262103defb427114e62eafeda12f1357a12140162"}, + {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:01491d8b4d8db9f3391d93b0df60701e644ff0894352947f31fff3e52bd5c801"}, + {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fcf31facf2796a2d3b7fe338fe8640aa0166e4e55b4cb108dbfd1058049bf4cb"}, + {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7200fd561fb3be06827340da066df4311d0b6b8eb0c2116a110be5245dceb326"}, + {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:dc1636770a809dee2bd44dd74b89cc80eb41172bcad8af75dd0bc182c2666d4c"}, + {file = "pydantic_core-2.23.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:67a5def279309f2e23014b608c4150b0c2d323bd7bccd27ff07b001c12c2415c"}, + {file = "pydantic_core-2.23.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:748bdf985014c6dd3e1e4cc3db90f1c3ecc7246ff5a3cd4ddab20c768b2f1dab"}, + {file = "pydantic_core-2.23.3-cp312-none-win32.whl", hash = "sha256:255ec6dcb899c115f1e2a64bc9ebc24cc0e3ab097775755244f77360d1f3c06c"}, + {file = "pydantic_core-2.23.3-cp312-none-win_amd64.whl", hash = "sha256:40b8441be16c1e940abebed83cd006ddb9e3737a279e339dbd6d31578b802f7b"}, + {file = "pydantic_core-2.23.3-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:6daaf5b1ba1369a22c8b050b643250e3e5efc6a78366d323294aee54953a4d5f"}, + {file = "pydantic_core-2.23.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d015e63b985a78a3d4ccffd3bdf22b7c20b3bbd4b8227809b3e8e75bc37f9cb2"}, + {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a3fc572d9b5b5cfe13f8e8a6e26271d5d13f80173724b738557a8c7f3a8a3791"}, + {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f6bd91345b5163ee7448bee201ed7dd601ca24f43f439109b0212e296eb5b423"}, + {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fc379c73fd66606628b866f661e8785088afe2adaba78e6bbe80796baf708a63"}, + {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fbdce4b47592f9e296e19ac31667daed8753c8367ebb34b9a9bd89dacaa299c9"}, + {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc3cf31edf405a161a0adad83246568647c54404739b614b1ff43dad2b02e6d5"}, + {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8e22b477bf90db71c156f89a55bfe4d25177b81fce4aa09294d9e805eec13855"}, + {file = "pydantic_core-2.23.3-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:0a0137ddf462575d9bce863c4c95bac3493ba8e22f8c28ca94634b4a1d3e2bb4"}, + {file = "pydantic_core-2.23.3-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:203171e48946c3164fe7691fc349c79241ff8f28306abd4cad5f4f75ed80bc8d"}, + {file = "pydantic_core-2.23.3-cp313-none-win32.whl", hash = "sha256:76bdab0de4acb3f119c2a4bff740e0c7dc2e6de7692774620f7452ce11ca76c8"}, + {file = "pydantic_core-2.23.3-cp313-none-win_amd64.whl", hash = "sha256:37ba321ac2a46100c578a92e9a6aa33afe9ec99ffa084424291d84e456f490c1"}, + {file = "pydantic_core-2.23.3-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d063c6b9fed7d992bcbebfc9133f4c24b7a7f215d6b102f3e082b1117cddb72c"}, + {file = "pydantic_core-2.23.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6cb968da9a0746a0cf521b2b5ef25fc5a0bee9b9a1a8214e0a1cfaea5be7e8a4"}, + {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edbefe079a520c5984e30e1f1f29325054b59534729c25b874a16a5048028d16"}, + {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cbaaf2ef20d282659093913da9d402108203f7cb5955020bd8d1ae5a2325d1c4"}, + {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fb539d7e5dc4aac345846f290cf504d2fd3c1be26ac4e8b5e4c2b688069ff4cf"}, + {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7e6f33503c5495059148cc486867e1d24ca35df5fc064686e631e314d959ad5b"}, + {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:04b07490bc2f6f2717b10c3969e1b830f5720b632f8ae2f3b8b1542394c47a8e"}, + {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:03795b9e8a5d7fda05f3873efc3f59105e2dcff14231680296b87b80bb327295"}, + {file = "pydantic_core-2.23.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:c483dab0f14b8d3f0df0c6c18d70b21b086f74c87ab03c59250dbf6d3c89baba"}, + {file = "pydantic_core-2.23.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8b2682038e255e94baf2c473dca914a7460069171ff5cdd4080be18ab8a7fd6e"}, + {file = "pydantic_core-2.23.3-cp38-none-win32.whl", hash = "sha256:f4a57db8966b3a1d1a350012839c6a0099f0898c56512dfade8a1fe5fb278710"}, + {file = "pydantic_core-2.23.3-cp38-none-win_amd64.whl", hash = "sha256:13dd45ba2561603681a2676ca56006d6dee94493f03d5cadc055d2055615c3ea"}, + {file = "pydantic_core-2.23.3-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:82da2f4703894134a9f000e24965df73cc103e31e8c31906cc1ee89fde72cbd8"}, + {file = "pydantic_core-2.23.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:dd9be0a42de08f4b58a3cc73a123f124f65c24698b95a54c1543065baca8cf0e"}, + {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89b731f25c80830c76fdb13705c68fef6a2b6dc494402987c7ea9584fe189f5d"}, + {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c6de1ec30c4bb94f3a69c9f5f2182baeda5b809f806676675e9ef6b8dc936f28"}, + {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bb68b41c3fa64587412b104294b9cbb027509dc2f6958446c502638d481525ef"}, + {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1c3980f2843de5184656aab58698011b42763ccba11c4a8c35936c8dd6c7068c"}, + {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94f85614f2cba13f62c3c6481716e4adeae48e1eaa7e8bac379b9d177d93947a"}, + {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:510b7fb0a86dc8f10a8bb43bd2f97beb63cffad1203071dc434dac26453955cd"}, + {file = "pydantic_core-2.23.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:1eba2f7ce3e30ee2170410e2171867ea73dbd692433b81a93758ab2de6c64835"}, + {file = "pydantic_core-2.23.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4b259fd8409ab84b4041b7b3f24dcc41e4696f180b775961ca8142b5b21d0e70"}, + {file = "pydantic_core-2.23.3-cp39-none-win32.whl", hash = "sha256:40d9bd259538dba2f40963286009bf7caf18b5112b19d2b55b09c14dde6db6a7"}, + {file = "pydantic_core-2.23.3-cp39-none-win_amd64.whl", hash = "sha256:5a8cd3074a98ee70173a8633ad3c10e00dcb991ecec57263aacb4095c5efb958"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f399e8657c67313476a121a6944311fab377085ca7f490648c9af97fc732732d"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:6b5547d098c76e1694ba85f05b595720d7c60d342f24d5aad32c3049131fa5c4"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0dda0290a6f608504882d9f7650975b4651ff91c85673341789a476b1159f211"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65b6e5da855e9c55a0c67f4db8a492bf13d8d3316a59999cfbaf98cc6e401961"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:09e926397f392059ce0afdcac920df29d9c833256354d0c55f1584b0b70cf07e"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:87cfa0ed6b8c5bd6ae8b66de941cece179281239d482f363814d2b986b79cedc"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e61328920154b6a44d98cabcb709f10e8b74276bc709c9a513a8c37a18786cc4"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ce3317d155628301d649fe5e16a99528d5680af4ec7aa70b90b8dacd2d725c9b"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e89513f014c6be0d17b00a9a7c81b1c426f4eb9224b15433f3d98c1a071f8433"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:4f62c1c953d7ee375df5eb2e44ad50ce2f5aff931723b398b8bc6f0ac159791a"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2718443bc671c7ac331de4eef9b673063b10af32a0bb385019ad61dcf2cc8f6c"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0d90e08b2727c5d01af1b5ef4121d2f0c99fbee692c762f4d9d0409c9da6541"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2b676583fc459c64146debea14ba3af54e540b61762dfc0613dc4e98c3f66eeb"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:50e4661f3337977740fdbfbae084ae5693e505ca2b3130a6d4eb0f2281dc43b8"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:68f4cf373f0de6abfe599a38307f4417c1c867ca381c03df27c873a9069cda25"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:59d52cf01854cb26c46958552a21acb10dd78a52aa34c86f284e66b209db8cab"}, + {file = "pydantic_core-2.23.3.tar.gz", hash = "sha256:3cb0f65d8b4121c1b015c60104a685feb929a29d7cf204387c7f2688c7974690"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + +[[package]] +name = "pytest" +version = "7.4.4" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, + {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} + +[package.extras] +testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "pytest-asyncio" +version = "0.23.8" +description = "Pytest support for asyncio" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, + {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, +] + +[package.dependencies] +pytest = ">=7.0.0,<9" + +[package.extras] +docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] +testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, +] + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "ruff" +version = "0.5.7" +description = "An extremely fast Python linter and code formatter, written in Rust." +optional = false +python-versions = ">=3.7" +files = [ + {file = "ruff-0.5.7-py3-none-linux_armv6l.whl", hash = "sha256:548992d342fc404ee2e15a242cdbea4f8e39a52f2e7752d0e4cbe88d2d2f416a"}, + {file = "ruff-0.5.7-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:00cc8872331055ee017c4f1071a8a31ca0809ccc0657da1d154a1d2abac5c0be"}, + {file = "ruff-0.5.7-py3-none-macosx_11_0_arm64.whl", hash = "sha256:eaf3d86a1fdac1aec8a3417a63587d93f906c678bb9ed0b796da7b59c1114a1e"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a01c34400097b06cf8a6e61b35d6d456d5bd1ae6961542de18ec81eaf33b4cb8"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fcc8054f1a717e2213500edaddcf1dbb0abad40d98e1bd9d0ad364f75c763eea"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7f70284e73f36558ef51602254451e50dd6cc479f8b6f8413a95fcb5db4a55fc"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:a78ad870ae3c460394fc95437d43deb5c04b5c29297815a2a1de028903f19692"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9ccd078c66a8e419475174bfe60a69adb36ce04f8d4e91b006f1329d5cd44bcf"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7e31c9bad4ebf8fdb77b59cae75814440731060a09a0e0077d559a556453acbb"}, + {file = "ruff-0.5.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d796327eed8e168164346b769dd9a27a70e0298d667b4ecee6877ce8095ec8e"}, + {file = "ruff-0.5.7-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:4a09ea2c3f7778cc635e7f6edf57d566a8ee8f485f3c4454db7771efb692c499"}, + {file = "ruff-0.5.7-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a36d8dcf55b3a3bc353270d544fb170d75d2dff41eba5df57b4e0b67a95bb64e"}, + {file = "ruff-0.5.7-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9369c218f789eefbd1b8d82a8cf25017b523ac47d96b2f531eba73770971c9e5"}, + {file = "ruff-0.5.7-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b88ca3db7eb377eb24fb7c82840546fb7acef75af4a74bd36e9ceb37a890257e"}, + {file = "ruff-0.5.7-py3-none-win32.whl", hash = "sha256:33d61fc0e902198a3e55719f4be6b375b28f860b09c281e4bdbf783c0566576a"}, + {file = "ruff-0.5.7-py3-none-win_amd64.whl", hash = "sha256:083bbcbe6fadb93cd86709037acc510f86eed5a314203079df174c40bbbca6b3"}, + {file = "ruff-0.5.7-py3-none-win_arm64.whl", hash = "sha256:2dca26154ff9571995107221d0aeaad0e75a77b5a682d6236cf89a58c70b76f4"}, + {file = "ruff-0.5.7.tar.gz", hash = "sha256:8dfc0a458797f5d9fb622dd0efc52d796f23f0a1493a9527f4e49a550ae9a7e5"}, +] + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "sniffio" +version = "1.3.1" +description = "Sniff out which async library your code is running under" +optional = false +python-versions = ">=3.7" +files = [ + {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, + {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, +] + +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, +] + +[[package]] +name = "types-python-dateutil" +version = "2.9.0.20240906" +description = "Typing stubs for python-dateutil" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types-python-dateutil-2.9.0.20240906.tar.gz", hash = "sha256:9706c3b68284c25adffc47319ecc7947e5bb86b3773f843c73906fd598bc176e"}, + {file = "types_python_dateutil-2.9.0.20240906-py3-none-any.whl", hash = "sha256:27c8cc2d058ccb14946eebcaaa503088f4f6dbc4fb6093d3d456a49aef2753f6"}, +] + +[[package]] +name = "typing-extensions" +version = "4.12.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +files = [ + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, +] + +[metadata] +lock-version = "2.0" +python-versions = "^3.8" +content-hash = "6f6c191c1028d17a97fdfa84cedfd3cef94b5d63d98b8c1d333b3398eeea9055" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..99f6dfa --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,61 @@ +[tool.poetry] +name = "Vapi" +version = "0.0.0" +description = "" +readme = "README.md" +authors = [] +keywords = [] + +classifiers = [ + "Intended Audience :: Developers", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: OS Independent", + "Operating System :: POSIX", + "Operating System :: MacOS", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", + "Topic :: Software Development :: Libraries :: Python Modules", + "Typing :: Typed" +] +packages = [ + { include = "vapi", from = "src"} +] + +[project.urls] +Repository = 'https://github.com/fern-demo/vapi-python-sdk' + +[tool.poetry.dependencies] +python = "^3.8" +httpx = ">=0.21.2" +pydantic = ">= 1.9.2" +pydantic-core = "^2.18.2" +typing_extensions = ">= 4.0.0" + +[tool.poetry.dev-dependencies] +mypy = "1.0.1" +pytest = "^7.4.0" +pytest-asyncio = "^0.23.5" +python-dateutil = "^2.9.0" +types-python-dateutil = "^2.9.0.20240316" +ruff = "^0.5.6" + +[tool.pytest.ini_options] +testpaths = [ "tests" ] +asyncio_mode = "auto" + +[tool.mypy] +plugins = ["pydantic.mypy"] + +[tool.ruff] +line-length = 120 + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/reference.md b/reference.md new file mode 100644 index 0000000..0ea41a2 --- /dev/null +++ b/reference.md @@ -0,0 +1,3660 @@ +# Reference +## Calls +
client.calls.list(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.calls.list() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**assistant_id:** `typing.Optional[str]` — This will return calls with the specified assistantId. + +
+
+ +
+
+ +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. + +
+
+ +
+
+ +**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. + +
+
+ +
+
+ +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. + +
+
+ +
+
+ +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. + +
+
+ +
+
+ +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. + +
+
+ +
+
+ +**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.calls.create(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.calls.create() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — This is the name of the call. This is just for your own reference. + +
+
+ +
+
+ +**assistant_id:** `typing.Optional[str]` — This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + +
+
+ +
+
+ +**assistant:** `typing.Optional[CreateAssistantDto]` — This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. + +
+
+ +
+
+ +**assistant_overrides:** `typing.Optional[AssistantOverrides]` — These are the overrides for the `assistant` or `assistantId`'s settings and template variables. + +
+
+ +
+
+ +**squad_id:** `typing.Optional[str]` — This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + +
+
+ +
+
+ +**squad:** `typing.Optional[CreateSquadDto]` — This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + +
+
+ +
+
+ +**phone_number_id:** `typing.Optional[str]` + +This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead. + +Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + +
+
+ +
+
+ +**phone_number:** `typing.Optional[ImportTwilioPhoneNumberDto]` + +This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead. + +Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + +
+
+ +
+
+ +**customer_id:** `typing.Optional[str]` + +This is the customer that will be called. To call a transient customer , use `customer` instead. + +Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + +
+
+ +
+
+ +**customer:** `typing.Optional[CreateCustomerDto]` + +This is the customer that will be called. To call an existing customer, use `customerId` instead. + +Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.calls.get(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.calls.get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.calls.delete(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.calls.delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.calls.update(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.calls.update( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — This is the name of the call. This is just for your own reference. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Assistants +
client.assistants.list(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.assistants.list() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. + +
+
+ +
+
+ +**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. + +
+
+ +
+
+ +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. + +
+
+ +
+
+ +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. + +
+
+ +
+
+ +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. + +
+
+ +
+
+ +**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.assistants.create(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.assistants.create() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**transcriber:** `typing.Optional[CreateAssistantDtoTranscriber]` — These are the options for the assistant's transcriber. + +
+
+ +
+
+ +**model:** `typing.Optional[CreateAssistantDtoModel]` — These are the options for the assistant's LLM. + +
+
+ +
+
+ +**voice:** `typing.Optional[CreateAssistantDtoVoice]` — These are the options for the assistant's voice. + +
+
+ +
+
+ +**first_message_mode:** `typing.Optional[CreateAssistantDtoFirstMessageMode]` + +This is the mode for the first message. Default is 'assistant-speaks-first'. + +Use: + +- 'assistant-speaks-first' to have the assistant speak first. +- 'assistant-waits-for-user' to have the assistant wait for the user to speak first. +- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + +@default 'assistant-speaks-first' + +
+
+ +
+
+ +**hipaa_enabled:** `typing.Optional[bool]` — When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + +
+
+ +
+
+ +**client_messages:** `typing.Optional[typing.Sequence[CreateAssistantDtoClientMessagesItem]]` — These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + +
+
+ +
+
+ +**server_messages:** `typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]]` — These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. + +
+
+ +
+
+ +**silence_timeout_seconds:** `typing.Optional[float]` + +How many seconds of silence to wait before ending the call. Defaults to 30. + +@default 30 + +
+
+ +
+
+ +**max_duration_seconds:** `typing.Optional[float]` + +This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + +@default 600 (10 minutes) + +
+
+ +
+
+ +**background_sound:** `typing.Optional[CreateAssistantDtoBackgroundSound]` — This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + +
+
+ +
+
+ +**backchanneling_enabled:** `typing.Optional[bool]` + +This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. + +Default `false` while in beta. + +@default false + +
+
+ +
+
+ +**background_denoising_enabled:** `typing.Optional[bool]` + +This enables filtering of noise and background speech while the user is talking. + +Default `false` while in beta. + +@default false + +
+
+ +
+
+ +**model_output_in_messages_enabled:** `typing.Optional[bool]` + +This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + +Default `false` while in beta. + +@default false + +
+
+ +
+
+ +**transport_configurations:** `typing.Optional[typing.Sequence[TransportConfigurationTwilio]]` — These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` + +This is the name of the assistant. + +This is required when you want to transfer between assistants in a call. + +
+
+ +
+
+ +**first_message:** `typing.Optional[str]` + +This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + +If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + +
+
+ +
+
+ +**voicemail_detection:** `typing.Optional[TwilioVoicemailDetection]` + +These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. +This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. +You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + +
+
+ +
+
+ +**voicemail_message:** `typing.Optional[str]` + +This is the message that the assistant will say if the call is forwarded to voicemail. + +If unspecified, it will hang up. + +
+
+ +
+
+ +**end_call_message:** `typing.Optional[str]` + +This is the message that the assistant will say if it ends the call. + +If unspecified, it will hang up without saying anything. + +
+
+ +
+
+ +**end_call_phrases:** `typing.Optional[typing.Sequence[str]]` — This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — This is for metadata you want to store on the assistant. + +
+
+ +
+
+ +**server_url:** `typing.Optional[str]` + +This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + +All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. + +This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl + +
+
+ +
+
+ +**server_url_secret:** `typing.Optional[str]` + +This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + +Same precedence logic as serverUrl. + +
+
+ +
+
+ +**analysis_plan:** `typing.Optional[AnalysisPlan]` — This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + +
+
+ +
+
+ +**artifact_plan:** `typing.Optional[ArtifactPlan]` + +This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + +Note: `recordingEnabled` is currently at the root level. It will be moved to `artifactPlan` in the future, but will remain backwards compatible. + +
+
+ +
+
+ +**message_plan:** `typing.Optional[MessagePlan]` + +This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. + +Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. + +
+
+ +
+
+ +**start_speaking_plan:** `typing.Optional[StartSpeakingPlan]` + +This is the plan for when the assistant should start talking. + +You should configure this if you're running into these issues: + +- The assistant is too slow to start talking after the customer is done speaking. +- The assistant is too fast to start talking after the customer is done speaking. +- The assistant is so fast that it's actually interrupting the customer. + +
+
+ +
+
+ +**stop_speaking_plan:** `typing.Optional[StopSpeakingPlan]` + +This is the plan for when assistant should stop talking on customer interruption. + +You should configure this if you're running into these issues: + +- The assistant is too slow to recognize customer's interruption. +- The assistant is too fast to recognize customer's interruption. +- The assistant is getting interrupted by phrases that are just acknowledgments. +- The assistant is getting interrupted by background noises. +- The assistant is not properly stopping -- it starts talking right after getting interrupted. + +
+
+ +
+
+ +**monitor_plan:** `typing.Optional[MonitorPlan]` + +This is the plan for real-time monitoring of the assistant's calls. + +Usage: + +- To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. +- To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + +Note, `serverMessages`, `clientMessages`, `serverUrl` and `serverUrlSecret` are currently at the root level but will be moved to `monitorPlan` in the future. Will remain backwards compatible + +
+
+ +
+
+ +**credential_ids:** `typing.Optional[typing.Sequence[str]]` — These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.assistants.get(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.assistants.get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.assistants.delete(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.assistants.delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.assistants.update(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.assistants.update( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**transcriber:** `typing.Optional[UpdateAssistantDtoTranscriber]` — These are the options for the assistant's transcriber. + +
+
+ +
+
+ +**model:** `typing.Optional[UpdateAssistantDtoModel]` — These are the options for the assistant's LLM. + +
+
+ +
+
+ +**voice:** `typing.Optional[UpdateAssistantDtoVoice]` — These are the options for the assistant's voice. + +
+
+ +
+
+ +**first_message_mode:** `typing.Optional[UpdateAssistantDtoFirstMessageMode]` + +This is the mode for the first message. Default is 'assistant-speaks-first'. + +Use: +- 'assistant-speaks-first' to have the assistant speak first. +- 'assistant-waits-for-user' to have the assistant wait for the user to speak first. +- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + +@default 'assistant-speaks-first' + +
+
+ +
+
+ +**hipaa_enabled:** `typing.Optional[bool]` — When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + +
+
+ +
+
+ +**client_messages:** `typing.Optional[typing.Sequence[UpdateAssistantDtoClientMessagesItem]]` — These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + +
+
+ +
+
+ +**server_messages:** `typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]]` — These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. + +
+
+ +
+
+ +**silence_timeout_seconds:** `typing.Optional[float]` + +How many seconds of silence to wait before ending the call. Defaults to 30. + +@default 30 + +
+
+ +
+
+ +**max_duration_seconds:** `typing.Optional[float]` + +This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + +@default 600 (10 minutes) + +
+
+ +
+
+ +**background_sound:** `typing.Optional[UpdateAssistantDtoBackgroundSound]` — This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + +
+
+ +
+
+ +**backchanneling_enabled:** `typing.Optional[bool]` + +This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. + +Default `false` while in beta. + +@default false + +
+
+ +
+
+ +**background_denoising_enabled:** `typing.Optional[bool]` + +This enables filtering of noise and background speech while the user is talking. + +Default `false` while in beta. + +@default false + +
+
+ +
+
+ +**model_output_in_messages_enabled:** `typing.Optional[bool]` + +This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + +Default `false` while in beta. + +@default false + +
+
+ +
+
+ +**transport_configurations:** `typing.Optional[typing.Sequence[TransportConfigurationTwilio]]` — These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` + +This is the name of the assistant. + +This is required when you want to transfer between assistants in a call. + +
+
+ +
+
+ +**first_message:** `typing.Optional[str]` + +This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + +If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + +
+
+ +
+
+ +**voicemail_detection:** `typing.Optional[TwilioVoicemailDetection]` + +These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. +This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. +You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + +
+
+ +
+
+ +**voicemail_message:** `typing.Optional[str]` + +This is the message that the assistant will say if the call is forwarded to voicemail. + +If unspecified, it will hang up. + +
+
+ +
+
+ +**end_call_message:** `typing.Optional[str]` + +This is the message that the assistant will say if it ends the call. + +If unspecified, it will hang up without saying anything. + +
+
+ +
+
+ +**end_call_phrases:** `typing.Optional[typing.Sequence[str]]` — This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — This is for metadata you want to store on the assistant. + +
+
+ +
+
+ +**server_url:** `typing.Optional[str]` + +This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + +All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. + +This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl + +
+
+ +
+
+ +**server_url_secret:** `typing.Optional[str]` + +This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + +Same precedence logic as serverUrl. + +
+
+ +
+
+ +**analysis_plan:** `typing.Optional[AnalysisPlan]` — This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + +
+
+ +
+
+ +**artifact_plan:** `typing.Optional[ArtifactPlan]` + +This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + +Note: `recordingEnabled` is currently at the root level. It will be moved to `artifactPlan` in the future, but will remain backwards compatible. + +
+
+ +
+
+ +**message_plan:** `typing.Optional[MessagePlan]` + +This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. + +Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. + +
+
+ +
+
+ +**start_speaking_plan:** `typing.Optional[StartSpeakingPlan]` + +This is the plan for when the assistant should start talking. + +You should configure this if you're running into these issues: +- The assistant is too slow to start talking after the customer is done speaking. +- The assistant is too fast to start talking after the customer is done speaking. +- The assistant is so fast that it's actually interrupting the customer. + +
+
+ +
+
+ +**stop_speaking_plan:** `typing.Optional[StopSpeakingPlan]` + +This is the plan for when assistant should stop talking on customer interruption. + +You should configure this if you're running into these issues: +- The assistant is too slow to recognize customer's interruption. +- The assistant is too fast to recognize customer's interruption. +- The assistant is getting interrupted by phrases that are just acknowledgments. +- The assistant is getting interrupted by background noises. +- The assistant is not properly stopping -- it starts talking right after getting interrupted. + +
+
+ +
+
+ +**monitor_plan:** `typing.Optional[MonitorPlan]` + +This is the plan for real-time monitoring of the assistant's calls. + +Usage: +- To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. +- To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + +Note, `serverMessages`, `clientMessages`, `serverUrl` and `serverUrlSecret` are currently at the root level but will be moved to `monitorPlan` in the future. Will remain backwards compatible + +
+
+ +
+
+ +**credential_ids:** `typing.Optional[typing.Sequence[str]]` — These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## PhoneNumbers +
client.phone_numbers.list(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.phone_numbers.list() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. + +
+
+ +
+
+ +**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. + +
+
+ +
+
+ +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. + +
+
+ +
+
+ +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. + +
+
+ +
+
+ +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. + +
+
+ +
+
+ +**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.phone_numbers.create(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi +from vapi.phone_numbers import PhoneNumbersCreateRequest_Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.phone_numbers.create( + request=PhoneNumbersCreateRequest_Vapi( + sip_uri="string", + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `PhoneNumbersCreateRequest` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.phone_numbers.get(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.phone_numbers.get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.phone_numbers.delete(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.phone_numbers.delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.phone_numbers.update(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.phone_numbers.update( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**fallback_destination:** `typing.Optional[UpdatePhoneNumberDtoFallbackDestination]` + +This is the fallback destination an inbound call will be transferred to if: +1. `assistantId` is not set +2. `squadId` is not set +3. and, `assistant-request` message to the `serverUrl` fails + +If this is not set and above conditions are met, the inbound call is hung up with an error message. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — This is the name of the phone number. This is just for your own reference. + +
+
+ +
+
+ +**assistant_id:** `typing.Optional[str]` + +This is the assistant that will be used for incoming calls to this phone number. + +If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + +
+
+ +
+
+ +**squad_id:** `typing.Optional[str]` + +This is the squad that will be used for incoming calls to this phone number. + +If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + +
+
+ +
+
+ +**server_url:** `typing.Optional[str]` + +This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + +You can see the shape of the messages sent in `ServerMessage`. + +This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + +
+
+ +
+
+ +**server_url_secret:** `typing.Optional[str]` + +This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + +Same precedence logic as serverUrl. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Squads +
client.squads.list(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.squads.list() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. + +
+
+ +
+
+ +**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. + +
+
+ +
+
+ +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. + +
+
+ +
+
+ +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. + +
+
+ +
+
+ +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. + +
+
+ +
+
+ +**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.squads.create(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import SquadMemberDto, Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.squads.create( + members=[SquadMemberDto()], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**members:** `typing.Sequence[SquadMemberDto]` + +This is the list of assistants that make up the squad. + +The call will start with the first assistant in the list. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — This is the name of the squad. + +
+
+ +
+
+ +**members_overrides:** `typing.Optional[AssistantOverrides]` + +This can be used to override all the assistants' settings and provide values for their template variables. + +Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.squads.get(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.squads.get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.squads.delete(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.squads.delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.squads.update(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import SquadMemberDto, Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.squads.update( + id="id", + members=[SquadMemberDto()], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**members:** `typing.Sequence[SquadMemberDto]` + +This is the list of assistants that make up the squad. + +The call will start with the first assistant in the list. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — This is the name of the squad. + +
+
+ +
+
+ +**members_overrides:** `typing.Optional[AssistantOverrides]` + +This can be used to override all the assistants' settings and provide values for their template variables. + +Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Blocks +
client.blocks.list(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.blocks.list() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. + +
+
+ +
+
+ +**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. + +
+
+ +
+
+ +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. + +
+
+ +
+
+ +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. + +
+
+ +
+
+ +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. + +
+
+ +
+
+ +**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.blocks.create(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi +from vapi.blocks import BlocksCreateRequest_Workflow + +client = Vapi( + token="YOUR_TOKEN", +) +client.blocks.create( + request=BlocksCreateRequest_Workflow(), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `BlocksCreateRequest` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.blocks.get(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.blocks.get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.blocks.delete(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.blocks.delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.blocks.update(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.blocks.update( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**messages:** `typing.Optional[typing.Sequence[UpdateBlockDtoMessagesItem]]` — These are the pre-configured messages that will be spoken to the user while the block is running. + +
+
+ +
+
+ +**input_schema:** `typing.Optional[JsonSchema]` + +This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` + +These are accessible as variables: +- ({{input.propertyName}}) in context of the block execution (step) +- ({{stepName.input.propertyName}}) in context of the workflow + +
+
+ +
+
+ +**output_schema:** `typing.Optional[JsonSchema]` + +This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). + +These are accessible as variables: +- ({{output.propertyName}}) in context of the block execution (step) +- ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) +- ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) + +Caveats: +1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. +2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + +
+
+ +
+
+ +**tool:** `typing.Optional[UpdateBlockDtoTool]` — This is the tool that the block will call. To use an existing tool, use `toolId`. + +
+
+ +
+
+ +**steps:** `typing.Optional[typing.Sequence[UpdateBlockDtoStepsItem]]` — These are the steps in the workflow. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — This is the name of the block. This is just for your reference. + +
+
+ +
+
+ +**instruction:** `typing.Optional[str]` + +This is the instruction to the model. + +You can reference any variable in the context of the current block execution (step): +- "{{input.your-property-name}}" for the current step's input +- "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) +- "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) +- "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) +- "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) +- "{{workflow.input.your-property-name}}" for the current workflow's input +- "{{global.your-property-name}}" for the global context + +This can be as simple or as complex as you want it to be. +- "say hello and ask the user about their day!" +- "collect the user's first and last name" +- "user is {{input.firstName}} {{input.lastName}}. their age is {{input.age}}. ask them about their salary and if they might be interested in buying a house. we offer {{input.offer}}" + +Caveats: +1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output/input.propertyName}} will reference the latest usage of the step. +2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output/input.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + +
+
+ +
+
+ +**tool_id:** `typing.Optional[str]` — This is the id of the tool that the block will call. To use a transient tool, use `tool`. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Tools +
client.tools.list(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.tools.list() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. + +
+
+ +
+
+ +**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. + +
+
+ +
+
+ +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. + +
+
+ +
+
+ +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. + +
+
+ +
+
+ +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. + +
+
+ +
+
+ +**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tools.create(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi +from vapi.tools import ToolsCreateRequest_Output + +client = Vapi( + token="YOUR_TOKEN", +) +client.tools.create( + request=ToolsCreateRequest_Output( + async_=False, + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ToolsCreateRequest` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tools.get(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.tools.get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tools.delete(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.tools.delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tools.update(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.tools.update( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**async_:** `typing.Optional[bool]` + +This determines if the tool is async. + +If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + +If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + +Defaults to synchronous (`false`). + +
+
+ +
+
+ +**messages:** `typing.Optional[typing.Sequence[UpdateToolDtoMessagesItem]]` + +These are the messages that will be spoken to the user as the tool is running. + +For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + +
+
+ +
+
+ +**function:** `typing.Optional[OpenAiFunction]` + +This is the function definition of the tool. + +For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + +An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + +
+
+ +
+
+ +**server:** `typing.Optional[Server]` + +This is the server that will be hit when this tool is requested by the model. + +All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + +This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Files +
client.files.list() +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.files.list() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.files.create(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.files.create() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**file:** `from __future__ import annotations + +core.File` — See core.File for more documentation + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.files.get(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.files.get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.files.delete(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.files.delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.files.update(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.files.update( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — This is the name of the file. This is just for your own reference. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Analytics +
client.analytics.get(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import AnalyticsOperation, AnalyticsQuery, Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.analytics.get( + queries=[ + AnalyticsQuery( + name="name", + operations=[ + AnalyticsOperation( + operation="sum", + column="id", + ) + ], + ) + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**queries:** `typing.Sequence[AnalyticsQuery]` — This is the list of metric queries you want to perform. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Logs +
client.logs.get(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.logs.get() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**org_id:** `typing.Optional[str]` — This is the unique identifier for the org that this log belongs to. + +
+
+ +
+
+ +**type:** `typing.Optional[LogsGetRequestType]` — This is the type of the log. + +
+
+ +
+
+ +**assistant_id:** `typing.Optional[str]` — This is the ID of the assistant. + +
+
+ +
+
+ +**phone_number_id:** `typing.Optional[str]` — This is the ID of the phone number. + +
+
+ +
+
+ +**customer_id:** `typing.Optional[str]` — This is the ID of the customer. + +
+
+ +
+
+ +**squad_id:** `typing.Optional[str]` — This is the ID of the squad. + +
+
+ +
+
+ +**call_id:** `typing.Optional[str]` — This is the ID of the call. + +
+
+ +
+
+ +**page:** `typing.Optional[float]` — This is the page number to return. Defaults to 1. + +
+
+ +
+
+ +**sort_order:** `typing.Optional[LogsGetRequestSortOrder]` — This is the sort order for pagination. Defaults to 'ASC'. + +
+
+ +
+
+ +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. + +
+
+ +
+
+ +**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. + +
+
+ +
+
+ +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. + +
+
+ +
+
+ +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. + +
+
+ +
+
+ +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. + +
+
+ +
+
+ +**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ diff --git a/src/vapi/__init__.py b/src/vapi/__init__.py new file mode 100644 index 0000000..a4da37c --- /dev/null +++ b/src/vapi/__init__.py @@ -0,0 +1,2205 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import ( + AddVoiceToProviderDto, + Analysis, + AnalysisCost, + AnalysisCostAnalysisType, + AnalysisCostBreakdown, + AnalysisPlan, + AnalyticsOperation, + AnalyticsOperationColumn, + AnalyticsOperationOperation, + AnalyticsQuery, + AnalyticsQueryGroupByItem, + AnalyticsQueryResult, + AnthropicCredential, + AnthropicModel, + AnthropicModelModel, + AnthropicModelToolsItem, + AnthropicModelToolsItem_Dtmf, + AnthropicModelToolsItem_EndCall, + AnthropicModelToolsItem_Function, + AnthropicModelToolsItem_Ghl, + AnthropicModelToolsItem_Make, + AnthropicModelToolsItem_TransferCall, + AnthropicModelToolsItem_Voicemail, + AnyscaleCredential, + AnyscaleModel, + AnyscaleModelToolsItem, + AnyscaleModelToolsItem_Dtmf, + AnyscaleModelToolsItem_EndCall, + AnyscaleModelToolsItem_Function, + AnyscaleModelToolsItem_Ghl, + AnyscaleModelToolsItem_Make, + AnyscaleModelToolsItem_TransferCall, + AnyscaleModelToolsItem_Voicemail, + Artifact, + ArtifactMessagesItem, + ArtifactPlan, + AssignmentMutation, + AssignmentMutationConditionsItem, + AssignmentMutationConditionsItem_ModelBased, + AssignmentMutationConditionsItem_RuleBased, + Assistant, + AssistantBackgroundSound, + AssistantClientMessagesItem, + AssistantFirstMessageMode, + AssistantModel, + AssistantModel_Anthropic, + AssistantModel_Anyscale, + AssistantModel_CustomLlm, + AssistantModel_Deepinfra, + AssistantModel_Groq, + AssistantModel_Openai, + AssistantModel_Openrouter, + AssistantModel_PerplexityAi, + AssistantModel_TogetherAi, + AssistantModel_Vapi, + AssistantOverrides, + AssistantOverridesBackgroundSound, + AssistantOverridesClientMessagesItem, + AssistantOverridesFirstMessageMode, + AssistantOverridesModel, + AssistantOverridesModel_Anthropic, + AssistantOverridesModel_Anyscale, + AssistantOverridesModel_CustomLlm, + AssistantOverridesModel_Deepinfra, + AssistantOverridesModel_Groq, + AssistantOverridesModel_Openai, + AssistantOverridesModel_Openrouter, + AssistantOverridesModel_PerplexityAi, + AssistantOverridesModel_TogetherAi, + AssistantOverridesModel_Vapi, + AssistantOverridesServerMessagesItem, + AssistantOverridesTranscriber, + AssistantOverridesTranscriber_Deepgram, + AssistantOverridesTranscriber_Gladia, + AssistantOverridesTranscriber_Talkscriber, + AssistantOverridesVoice, + AssistantOverridesVoice_11Labs, + AssistantOverridesVoice_Azure, + AssistantOverridesVoice_Cartesia, + AssistantOverridesVoice_Deepgram, + AssistantOverridesVoice_Lmnt, + AssistantOverridesVoice_Neets, + AssistantOverridesVoice_Openai, + AssistantOverridesVoice_Playht, + AssistantOverridesVoice_RimeAi, + AssistantServerMessagesItem, + AssistantTranscriber, + AssistantTranscriber_Deepgram, + AssistantTranscriber_Gladia, + AssistantTranscriber_Talkscriber, + AssistantVoice, + AssistantVoice_11Labs, + AssistantVoice_Azure, + AssistantVoice_Cartesia, + AssistantVoice_Deepgram, + AssistantVoice_Lmnt, + AssistantVoice_Neets, + AssistantVoice_Openai, + AssistantVoice_Playht, + AssistantVoice_RimeAi, + AzureOpenAiCredential, + AzureOpenAiCredentialModelsItem, + AzureOpenAiCredentialRegion, + AzureVoice, + AzureVoiceVoiceId, + BlockCompleteMessage, + BlockCompleteMessageConditionsItem, + BlockCompleteMessageConditionsItem_ModelBased, + BlockCompleteMessageConditionsItem_RuleBased, + BlockStartMessage, + BlockStartMessageConditionsItem, + BlockStartMessageConditionsItem_ModelBased, + BlockStartMessageConditionsItem_RuleBased, + BotMessage, + BucketPlan, + BuyPhoneNumberDto, + BuyPhoneNumberDtoFallbackDestination, + BuyPhoneNumberDtoFallbackDestination_Number, + BuyPhoneNumberDtoFallbackDestination_Sip, + ByoPhoneNumber, + ByoPhoneNumberFallbackDestination, + ByoPhoneNumberFallbackDestination_Number, + ByoPhoneNumberFallbackDestination_Sip, + ByoSipTrunkCredential, + Call, + CallCostsItem, + CallCostsItem_Analysis, + CallCostsItem_Model, + CallCostsItem_Transcriber, + CallCostsItem_Transport, + CallCostsItem_Vapi, + CallCostsItem_Voice, + CallDestination, + CallDestination_Number, + CallDestination_Sip, + CallEndedReason, + CallMessagesItem, + CallPaginatedResponse, + CallPhoneCallProvider, + CallPhoneCallTransport, + CallStatus, + CallType, + CallbackStep, + CallbackStepBlock, + CallbackStepBlock_Conversation, + CallbackStepBlock_ToolCall, + CallbackStepBlock_Workflow, + CartesiaCredential, + CartesiaVoice, + CartesiaVoiceLanguage, + CartesiaVoiceModel, + ChunkPlan, + ChunkPlanPunctuationBoundariesItem, + ClientInboundMessage, + ClientInboundMessageAddMessage, + ClientInboundMessageControl, + ClientInboundMessageControlControl, + ClientInboundMessageMessage, + ClientInboundMessageMessage_AddMessage, + ClientInboundMessageMessage_Control, + ClientInboundMessageMessage_Say, + ClientInboundMessageSay, + ClientMessage, + ClientMessageConversationUpdate, + ClientMessageConversationUpdateMessagesItem, + ClientMessageHang, + ClientMessageLanguageChanged, + ClientMessageMessage, + ClientMessageMessage_ConversationUpdate, + ClientMessageMessage_Hang, + ClientMessageMessage_LanguageChanged, + ClientMessageMessage_Metadata, + ClientMessageMessage_ModelOutput, + ClientMessageMessage_SpeechUpdate, + ClientMessageMessage_ToolCalls, + ClientMessageMessage_ToolCallsResult, + ClientMessageMessage_Transcript, + ClientMessageMessage_UserInterrupted, + ClientMessageMessage_VoiceInput, + ClientMessageMetadata, + ClientMessageModelOutput, + ClientMessageSpeechUpdate, + ClientMessageSpeechUpdateRole, + ClientMessageSpeechUpdateStatus, + ClientMessageToolCalls, + ClientMessageToolCallsResult, + ClientMessageToolCallsToolWithToolCallListItem, + ClientMessageToolCallsToolWithToolCallListItem_Function, + ClientMessageToolCallsToolWithToolCallListItem_Ghl, + ClientMessageToolCallsToolWithToolCallListItem_Make, + ClientMessageTranscript, + ClientMessageTranscriptRole, + ClientMessageTranscriptTranscriptType, + ClientMessageUserInterrupted, + ClientMessageVoiceInput, + CloneVoiceDto, + Condition, + ConditionOperator, + ConversationBlock, + ConversationBlockMessagesItem, + ConversationBlockMessagesItem_BlockComplete, + ConversationBlockMessagesItem_BlockStart, + CostBreakdown, + CreateAnthropicCredentialDto, + CreateAnyscaleCredentialDto, + CreateAssistantDto, + CreateAssistantDtoBackgroundSound, + CreateAssistantDtoClientMessagesItem, + CreateAssistantDtoFirstMessageMode, + CreateAssistantDtoModel, + CreateAssistantDtoModel_Anthropic, + CreateAssistantDtoModel_Anyscale, + CreateAssistantDtoModel_CustomLlm, + CreateAssistantDtoModel_Deepinfra, + CreateAssistantDtoModel_Groq, + CreateAssistantDtoModel_Openai, + CreateAssistantDtoModel_Openrouter, + CreateAssistantDtoModel_PerplexityAi, + CreateAssistantDtoModel_TogetherAi, + CreateAssistantDtoModel_Vapi, + CreateAssistantDtoServerMessagesItem, + CreateAssistantDtoTranscriber, + CreateAssistantDtoTranscriber_Deepgram, + CreateAssistantDtoTranscriber_Gladia, + CreateAssistantDtoTranscriber_Talkscriber, + CreateAssistantDtoVoice, + CreateAssistantDtoVoice_11Labs, + CreateAssistantDtoVoice_Azure, + CreateAssistantDtoVoice_Cartesia, + CreateAssistantDtoVoice_Deepgram, + CreateAssistantDtoVoice_Lmnt, + CreateAssistantDtoVoice_Neets, + CreateAssistantDtoVoice_Openai, + CreateAssistantDtoVoice_Playht, + CreateAssistantDtoVoice_RimeAi, + CreateAzureOpenAiCredentialDto, + CreateAzureOpenAiCredentialDtoModelsItem, + CreateAzureOpenAiCredentialDtoRegion, + CreateByoPhoneNumberDto, + CreateByoPhoneNumberDtoFallbackDestination, + CreateByoPhoneNumberDtoFallbackDestination_Number, + CreateByoPhoneNumberDtoFallbackDestination_Sip, + CreateByoSipTrunkCredentialDto, + CreateCartesiaCredentialDto, + CreateConversationBlockDto, + CreateConversationBlockDtoMessagesItem, + CreateConversationBlockDtoMessagesItem_BlockComplete, + CreateConversationBlockDtoMessagesItem_BlockStart, + CreateCustomLlmCredentialDto, + CreateCustomerDto, + CreateDeepInfraCredentialDto, + CreateDeepgramCredentialDto, + CreateDtmfToolDto, + CreateDtmfToolDtoMessagesItem, + CreateDtmfToolDtoMessagesItem_RequestComplete, + CreateDtmfToolDtoMessagesItem_RequestFailed, + CreateDtmfToolDtoMessagesItem_RequestResponseDelayed, + CreateDtmfToolDtoMessagesItem_RequestStart, + CreateElevenLabsCredentialDto, + CreateEndCallToolDto, + CreateEndCallToolDtoMessagesItem, + CreateEndCallToolDtoMessagesItem_RequestComplete, + CreateEndCallToolDtoMessagesItem_RequestFailed, + CreateEndCallToolDtoMessagesItem_RequestResponseDelayed, + CreateEndCallToolDtoMessagesItem_RequestStart, + CreateFunctionToolDto, + CreateFunctionToolDtoMessagesItem, + CreateFunctionToolDtoMessagesItem_RequestComplete, + CreateFunctionToolDtoMessagesItem_RequestFailed, + CreateFunctionToolDtoMessagesItem_RequestResponseDelayed, + CreateFunctionToolDtoMessagesItem_RequestStart, + CreateGcpCredentialDto, + CreateGhlToolDto, + CreateGhlToolDtoMessagesItem, + CreateGhlToolDtoMessagesItem_RequestComplete, + CreateGhlToolDtoMessagesItem_RequestFailed, + CreateGhlToolDtoMessagesItem_RequestResponseDelayed, + CreateGhlToolDtoMessagesItem_RequestStart, + CreateGladiaCredentialDto, + CreateGoHighLevelCredentialDto, + CreateGroqCredentialDto, + CreateLmntCredentialDto, + CreateMakeCredentialDto, + CreateMakeToolDto, + CreateMakeToolDtoMessagesItem, + CreateMakeToolDtoMessagesItem_RequestComplete, + CreateMakeToolDtoMessagesItem_RequestFailed, + CreateMakeToolDtoMessagesItem_RequestResponseDelayed, + CreateMakeToolDtoMessagesItem_RequestStart, + CreateOpenAiCredentialDto, + CreateOpenRouterCredentialDto, + CreateOrgDto, + CreateOutboundCallDto, + CreateOutputToolDto, + CreateOutputToolDtoMessagesItem, + CreateOutputToolDtoMessagesItem_RequestComplete, + CreateOutputToolDtoMessagesItem_RequestFailed, + CreateOutputToolDtoMessagesItem_RequestResponseDelayed, + CreateOutputToolDtoMessagesItem_RequestStart, + CreatePerplexityAiCredentialDto, + CreatePlayHtCredentialDto, + CreateRimeAiCredentialDto, + CreateRunpodCredentialDto, + CreateS3CredentialDto, + CreateSquadDto, + CreateTogetherAiCredentialDto, + CreateTokenDto, + CreateTokenDtoTag, + CreateToolCallBlockDto, + CreateToolCallBlockDtoMessagesItem, + CreateToolCallBlockDtoMessagesItem_BlockComplete, + CreateToolCallBlockDtoMessagesItem_BlockStart, + CreateToolCallBlockDtoTool, + CreateToolCallBlockDtoTool_Dtmf, + CreateToolCallBlockDtoTool_EndCall, + CreateToolCallBlockDtoTool_Function, + CreateToolCallBlockDtoTool_Ghl, + CreateToolCallBlockDtoTool_Make, + CreateToolCallBlockDtoTool_TransferCall, + CreateToolCallBlockDtoTool_Voicemail, + CreateToolTemplateDto, + CreateToolTemplateDtoDetails, + CreateToolTemplateDtoDetails_Dtmf, + CreateToolTemplateDtoDetails_EndCall, + CreateToolTemplateDtoDetails_Function, + CreateToolTemplateDtoDetails_Ghl, + CreateToolTemplateDtoDetails_Make, + CreateToolTemplateDtoDetails_TransferCall, + CreateToolTemplateDtoDetails_Voicemail, + CreateToolTemplateDtoProvider, + CreateToolTemplateDtoProviderDetails, + CreateToolTemplateDtoProviderDetails_Function, + CreateToolTemplateDtoProviderDetails_Ghl, + CreateToolTemplateDtoProviderDetails_Make, + CreateToolTemplateDtoVisibility, + CreateTransferCallToolDto, + CreateTransferCallToolDtoDestinationsItem, + CreateTransferCallToolDtoDestinationsItem_Assistant, + CreateTransferCallToolDtoDestinationsItem_Number, + CreateTransferCallToolDtoDestinationsItem_Sip, + CreateTransferCallToolDtoDestinationsItem_Step, + CreateTransferCallToolDtoMessagesItem, + CreateTransferCallToolDtoMessagesItem_RequestComplete, + CreateTransferCallToolDtoMessagesItem_RequestFailed, + CreateTransferCallToolDtoMessagesItem_RequestResponseDelayed, + CreateTransferCallToolDtoMessagesItem_RequestStart, + CreateTwilioCredentialDto, + CreateTwilioPhoneNumberDto, + CreateTwilioPhoneNumberDtoFallbackDestination, + CreateTwilioPhoneNumberDtoFallbackDestination_Number, + CreateTwilioPhoneNumberDtoFallbackDestination_Sip, + CreateVapiPhoneNumberDto, + CreateVapiPhoneNumberDtoFallbackDestination, + CreateVapiPhoneNumberDtoFallbackDestination_Number, + CreateVapiPhoneNumberDtoFallbackDestination_Sip, + CreateVoicemailToolDto, + CreateVoicemailToolDtoMessagesItem, + CreateVoicemailToolDtoMessagesItem_RequestComplete, + CreateVoicemailToolDtoMessagesItem_RequestFailed, + CreateVoicemailToolDtoMessagesItem_RequestResponseDelayed, + CreateVoicemailToolDtoMessagesItem_RequestStart, + CreateVonageCredentialDto, + CreateVonagePhoneNumberDto, + CreateVonagePhoneNumberDtoFallbackDestination, + CreateVonagePhoneNumberDtoFallbackDestination_Number, + CreateVonagePhoneNumberDtoFallbackDestination_Sip, + CreateWebCallDto, + CreateWorkflowBlockDto, + CreateWorkflowBlockDtoMessagesItem, + CreateWorkflowBlockDtoMessagesItem_BlockComplete, + CreateWorkflowBlockDtoMessagesItem_BlockStart, + CreateWorkflowBlockDtoStepsItem, + CreateWorkflowBlockDtoStepsItem_Callback, + CreateWorkflowBlockDtoStepsItem_Handoff, + CustomLlmCredential, + CustomLlmModel, + CustomLlmModelMetadataSendMode, + CustomLlmModelToolsItem, + CustomLlmModelToolsItem_Dtmf, + CustomLlmModelToolsItem_EndCall, + CustomLlmModelToolsItem_Function, + CustomLlmModelToolsItem_Ghl, + CustomLlmModelToolsItem_Make, + CustomLlmModelToolsItem_TransferCall, + CustomLlmModelToolsItem_Voicemail, + DeepInfraCredential, + DeepInfraModel, + DeepInfraModelToolsItem, + DeepInfraModelToolsItem_Dtmf, + DeepInfraModelToolsItem_EndCall, + DeepInfraModelToolsItem_Function, + DeepInfraModelToolsItem_Ghl, + DeepInfraModelToolsItem_Make, + DeepInfraModelToolsItem_TransferCall, + DeepInfraModelToolsItem_Voicemail, + DeepgramCredential, + DeepgramTranscriber, + DeepgramTranscriberLanguage, + DeepgramTranscriberModel, + DeepgramVoice, + DeepgramVoiceVoiceId, + DtmfTool, + DtmfToolMessagesItem, + DtmfToolMessagesItem_RequestComplete, + DtmfToolMessagesItem_RequestFailed, + DtmfToolMessagesItem_RequestResponseDelayed, + DtmfToolMessagesItem_RequestStart, + ElevenLabsCredential, + ElevenLabsVoice, + ElevenLabsVoiceModel, + ElevenLabsVoiceVoiceId, + EndCallTool, + EndCallToolMessagesItem, + EndCallToolMessagesItem_RequestComplete, + EndCallToolMessagesItem_RequestFailed, + EndCallToolMessagesItem_RequestResponseDelayed, + EndCallToolMessagesItem_RequestStart, + Error, + ExactReplacement, + File, + FileStatus, + FormatPlan, + FormatPlanReplacementsItem, + FormatPlanReplacementsItem_Exact, + FormatPlanReplacementsItem_Regex, + FunctionTool, + FunctionToolMessagesItem, + FunctionToolMessagesItem_RequestComplete, + FunctionToolMessagesItem_RequestFailed, + FunctionToolMessagesItem_RequestResponseDelayed, + FunctionToolMessagesItem_RequestStart, + FunctionToolProviderDetails, + FunctionToolWithToolCall, + FunctionToolWithToolCallMessagesItem, + FunctionToolWithToolCallMessagesItem_RequestComplete, + FunctionToolWithToolCallMessagesItem_RequestFailed, + FunctionToolWithToolCallMessagesItem_RequestResponseDelayed, + FunctionToolWithToolCallMessagesItem_RequestStart, + GcpCredential, + GcpKey, + GhlTool, + GhlToolMessagesItem, + GhlToolMessagesItem_RequestComplete, + GhlToolMessagesItem_RequestFailed, + GhlToolMessagesItem_RequestResponseDelayed, + GhlToolMessagesItem_RequestStart, + GhlToolMetadata, + GhlToolProviderDetails, + GhlToolWithToolCall, + GhlToolWithToolCallMessagesItem, + GhlToolWithToolCallMessagesItem_RequestComplete, + GhlToolWithToolCallMessagesItem_RequestFailed, + GhlToolWithToolCallMessagesItem_RequestResponseDelayed, + GhlToolWithToolCallMessagesItem_RequestStart, + GladiaCredential, + GladiaTranscriber, + GladiaTranscriberLanguage, + GladiaTranscriberLanguageBehaviour, + GladiaTranscriberModel, + GoHighLevelCredential, + GroqCredential, + GroqModel, + GroqModelModel, + GroqModelToolsItem, + GroqModelToolsItem_Dtmf, + GroqModelToolsItem_EndCall, + GroqModelToolsItem_Function, + GroqModelToolsItem_Ghl, + GroqModelToolsItem_Make, + GroqModelToolsItem_TransferCall, + GroqModelToolsItem_Voicemail, + HandoffStep, + HandoffStepBlock, + HandoffStepBlock_Conversation, + HandoffStepBlock_ToolCall, + HandoffStepBlock_Workflow, + ImportTwilioPhoneNumberDto, + ImportTwilioPhoneNumberDtoFallbackDestination, + ImportTwilioPhoneNumberDtoFallbackDestination_Number, + ImportTwilioPhoneNumberDtoFallbackDestination_Sip, + ImportVonagePhoneNumberDto, + ImportVonagePhoneNumberDtoFallbackDestination, + ImportVonagePhoneNumberDtoFallbackDestination_Number, + ImportVonagePhoneNumberDtoFallbackDestination_Sip, + InviteUserDto, + InviteUserDtoRole, + JsonSchema, + JsonSchemaType, + KnowledgeBase, + LmntCredential, + LmntVoice, + LmntVoiceVoiceId, + Log, + LogRequestHttpMethod, + LogResource, + LogType, + LogsPaginatedResponse, + MakeCredential, + MakeTool, + MakeToolMessagesItem, + MakeToolMessagesItem_RequestComplete, + MakeToolMessagesItem_RequestFailed, + MakeToolMessagesItem_RequestResponseDelayed, + MakeToolMessagesItem_RequestStart, + MakeToolMetadata, + MakeToolProviderDetails, + MakeToolWithToolCall, + MakeToolWithToolCallMessagesItem, + MakeToolWithToolCallMessagesItem_RequestComplete, + MakeToolWithToolCallMessagesItem_RequestFailed, + MakeToolWithToolCallMessagesItem_RequestResponseDelayed, + MakeToolWithToolCallMessagesItem_RequestStart, + MessagePlan, + Metrics, + ModelBasedCondition, + ModelCost, + Monitor, + MonitorPlan, + NeetsVoice, + NeetsVoiceVoiceId, + OpenAiCredential, + OpenAiFunction, + OpenAiFunctionParameters, + OpenAiMessage, + OpenAiMessageRole, + OpenAiModel, + OpenAiModelFallbackModelsItem, + OpenAiModelModel, + OpenAiModelToolsItem, + OpenAiModelToolsItem_Dtmf, + OpenAiModelToolsItem_EndCall, + OpenAiModelToolsItem_Function, + OpenAiModelToolsItem_Ghl, + OpenAiModelToolsItem_Make, + OpenAiModelToolsItem_TransferCall, + OpenAiModelToolsItem_Voicemail, + OpenAiVoice, + OpenAiVoiceVoiceId, + OpenRouterCredential, + OpenRouterModel, + OpenRouterModelToolsItem, + OpenRouterModelToolsItem_Dtmf, + OpenRouterModelToolsItem_EndCall, + OpenRouterModelToolsItem_Function, + OpenRouterModelToolsItem_Ghl, + OpenRouterModelToolsItem_Make, + OpenRouterModelToolsItem_TransferCall, + OpenRouterModelToolsItem_Voicemail, + Org, + OrgPlan, + OutputTool, + OutputToolMessagesItem, + OutputToolMessagesItem_RequestComplete, + OutputToolMessagesItem_RequestFailed, + OutputToolMessagesItem_RequestResponseDelayed, + OutputToolMessagesItem_RequestStart, + PaginationMeta, + PerplexityAiCredential, + PerplexityAiModel, + PerplexityAiModelToolsItem, + PerplexityAiModelToolsItem_Dtmf, + PerplexityAiModelToolsItem_EndCall, + PerplexityAiModelToolsItem_Function, + PerplexityAiModelToolsItem_Ghl, + PerplexityAiModelToolsItem_Make, + PerplexityAiModelToolsItem_TransferCall, + PerplexityAiModelToolsItem_Voicemail, + PlayHtCredential, + PlayHtVoice, + PlayHtVoiceEmotion, + PlayHtVoiceVoiceId, + RegexOption, + RegexOptionType, + RegexReplacement, + RimeAiCredential, + RimeAiVoice, + RimeAiVoiceModel, + RimeAiVoiceVoiceId, + RuleBasedCondition, + RuleBasedConditionOperator, + RunpodCredential, + S3Credential, + SbcConfiguration, + Server, + ServerMessage, + ServerMessageAssistantRequest, + ServerMessageAssistantRequestPhoneNumber, + ServerMessageAssistantRequestPhoneNumber_ByoPhoneNumber, + ServerMessageAssistantRequestPhoneNumber_Twilio, + ServerMessageAssistantRequestPhoneNumber_Vapi, + ServerMessageAssistantRequestPhoneNumber_Vonage, + ServerMessageConversationUpdate, + ServerMessageConversationUpdateMessagesItem, + ServerMessageConversationUpdatePhoneNumber, + ServerMessageConversationUpdatePhoneNumber_ByoPhoneNumber, + ServerMessageConversationUpdatePhoneNumber_Twilio, + ServerMessageConversationUpdatePhoneNumber_Vapi, + ServerMessageConversationUpdatePhoneNumber_Vonage, + ServerMessageEndOfCallReport, + ServerMessageEndOfCallReportCostsItem, + ServerMessageEndOfCallReportCostsItem_Analysis, + ServerMessageEndOfCallReportCostsItem_Model, + ServerMessageEndOfCallReportCostsItem_Transcriber, + ServerMessageEndOfCallReportCostsItem_Transport, + ServerMessageEndOfCallReportCostsItem_Vapi, + ServerMessageEndOfCallReportCostsItem_Voice, + ServerMessageEndOfCallReportEndedReason, + ServerMessageEndOfCallReportPhoneNumber, + ServerMessageEndOfCallReportPhoneNumber_ByoPhoneNumber, + ServerMessageEndOfCallReportPhoneNumber_Twilio, + ServerMessageEndOfCallReportPhoneNumber_Vapi, + ServerMessageEndOfCallReportPhoneNumber_Vonage, + ServerMessageHang, + ServerMessageHangPhoneNumber, + ServerMessageHangPhoneNumber_ByoPhoneNumber, + ServerMessageHangPhoneNumber_Twilio, + ServerMessageHangPhoneNumber_Vapi, + ServerMessageHangPhoneNumber_Vonage, + ServerMessageLanguageChanged, + ServerMessageLanguageChangedPhoneNumber, + ServerMessageLanguageChangedPhoneNumber_ByoPhoneNumber, + ServerMessageLanguageChangedPhoneNumber_Twilio, + ServerMessageLanguageChangedPhoneNumber_Vapi, + ServerMessageLanguageChangedPhoneNumber_Vonage, + ServerMessageMessage, + ServerMessageMessage_AssistantRequest, + ServerMessageMessage_ConversationUpdate, + ServerMessageMessage_EndOfCallReport, + ServerMessageMessage_Hang, + ServerMessageMessage_LanguageChanged, + ServerMessageMessage_ModelOutput, + ServerMessageMessage_PhoneCallControl, + ServerMessageMessage_SpeechUpdate, + ServerMessageMessage_StatusUpdate, + ServerMessageMessage_ToolCalls, + ServerMessageMessage_Transcript, + ServerMessageMessage_TransferDestinationRequest, + ServerMessageMessage_TransferUpdate, + ServerMessageMessage_UserInterrupted, + ServerMessageMessage_VoiceInput, + ServerMessageMessage_VoiceRequest, + ServerMessageModelOutput, + ServerMessageModelOutputPhoneNumber, + ServerMessageModelOutputPhoneNumber_ByoPhoneNumber, + ServerMessageModelOutputPhoneNumber_Twilio, + ServerMessageModelOutputPhoneNumber_Vapi, + ServerMessageModelOutputPhoneNumber_Vonage, + ServerMessagePhoneCallControl, + ServerMessagePhoneCallControlDestination, + ServerMessagePhoneCallControlDestination_Number, + ServerMessagePhoneCallControlDestination_Sip, + ServerMessagePhoneCallControlPhoneNumber, + ServerMessagePhoneCallControlPhoneNumber_ByoPhoneNumber, + ServerMessagePhoneCallControlPhoneNumber_Twilio, + ServerMessagePhoneCallControlPhoneNumber_Vapi, + ServerMessagePhoneCallControlPhoneNumber_Vonage, + ServerMessagePhoneCallControlRequest, + ServerMessageResponse, + ServerMessageResponseAssistantRequest, + ServerMessageResponseAssistantRequestDestination, + ServerMessageResponseAssistantRequestDestination_Number, + ServerMessageResponseAssistantRequestDestination_Sip, + ServerMessageResponseMessageResponse, + ServerMessageResponseToolCalls, + ServerMessageResponseTransferDestinationRequest, + ServerMessageResponseTransferDestinationRequestDestination, + ServerMessageResponseTransferDestinationRequestDestination_Assistant, + ServerMessageResponseTransferDestinationRequestDestination_Number, + ServerMessageResponseTransferDestinationRequestDestination_Sip, + ServerMessageResponseTransferDestinationRequestDestination_Step, + ServerMessageResponseVoiceRequest, + ServerMessageSpeechUpdate, + ServerMessageSpeechUpdatePhoneNumber, + ServerMessageSpeechUpdatePhoneNumber_ByoPhoneNumber, + ServerMessageSpeechUpdatePhoneNumber_Twilio, + ServerMessageSpeechUpdatePhoneNumber_Vapi, + ServerMessageSpeechUpdatePhoneNumber_Vonage, + ServerMessageSpeechUpdateRole, + ServerMessageSpeechUpdateStatus, + ServerMessageStatusUpdate, + ServerMessageStatusUpdateDestination, + ServerMessageStatusUpdateDestination_Number, + ServerMessageStatusUpdateDestination_Sip, + ServerMessageStatusUpdateEndedReason, + ServerMessageStatusUpdateMessagesItem, + ServerMessageStatusUpdatePhoneNumber, + ServerMessageStatusUpdatePhoneNumber_ByoPhoneNumber, + ServerMessageStatusUpdatePhoneNumber_Twilio, + ServerMessageStatusUpdatePhoneNumber_Vapi, + ServerMessageStatusUpdatePhoneNumber_Vonage, + ServerMessageStatusUpdateStatus, + ServerMessageToolCalls, + ServerMessageToolCallsPhoneNumber, + ServerMessageToolCallsPhoneNumber_ByoPhoneNumber, + ServerMessageToolCallsPhoneNumber_Twilio, + ServerMessageToolCallsPhoneNumber_Vapi, + ServerMessageToolCallsPhoneNumber_Vonage, + ServerMessageToolCallsToolWithToolCallListItem, + ServerMessageToolCallsToolWithToolCallListItem_Function, + ServerMessageToolCallsToolWithToolCallListItem_Ghl, + ServerMessageToolCallsToolWithToolCallListItem_Make, + ServerMessageTranscript, + ServerMessageTranscriptPhoneNumber, + ServerMessageTranscriptPhoneNumber_ByoPhoneNumber, + ServerMessageTranscriptPhoneNumber_Twilio, + ServerMessageTranscriptPhoneNumber_Vapi, + ServerMessageTranscriptPhoneNumber_Vonage, + ServerMessageTranscriptRole, + ServerMessageTranscriptTranscriptType, + ServerMessageTransferDestinationRequest, + ServerMessageTransferDestinationRequestPhoneNumber, + ServerMessageTransferDestinationRequestPhoneNumber_ByoPhoneNumber, + ServerMessageTransferDestinationRequestPhoneNumber_Twilio, + ServerMessageTransferDestinationRequestPhoneNumber_Vapi, + ServerMessageTransferDestinationRequestPhoneNumber_Vonage, + ServerMessageTransferUpdate, + ServerMessageTransferUpdateDestination, + ServerMessageTransferUpdateDestination_Assistant, + ServerMessageTransferUpdateDestination_Number, + ServerMessageTransferUpdateDestination_Sip, + ServerMessageTransferUpdateDestination_Step, + ServerMessageTransferUpdatePhoneNumber, + ServerMessageTransferUpdatePhoneNumber_ByoPhoneNumber, + ServerMessageTransferUpdatePhoneNumber_Twilio, + ServerMessageTransferUpdatePhoneNumber_Vapi, + ServerMessageTransferUpdatePhoneNumber_Vonage, + ServerMessageUserInterrupted, + ServerMessageUserInterruptedPhoneNumber, + ServerMessageUserInterruptedPhoneNumber_ByoPhoneNumber, + ServerMessageUserInterruptedPhoneNumber_Twilio, + ServerMessageUserInterruptedPhoneNumber_Vapi, + ServerMessageUserInterruptedPhoneNumber_Vonage, + ServerMessageVoiceInput, + ServerMessageVoiceInputPhoneNumber, + ServerMessageVoiceInputPhoneNumber_ByoPhoneNumber, + ServerMessageVoiceInputPhoneNumber_Twilio, + ServerMessageVoiceInputPhoneNumber_Vapi, + ServerMessageVoiceInputPhoneNumber_Vonage, + ServerMessageVoiceRequest, + ServerMessageVoiceRequestPhoneNumber, + ServerMessageVoiceRequestPhoneNumber_ByoPhoneNumber, + ServerMessageVoiceRequestPhoneNumber_Twilio, + ServerMessageVoiceRequestPhoneNumber_Vapi, + ServerMessageVoiceRequestPhoneNumber_Vonage, + SipTrunkGateway, + SipTrunkGatewayOutboundProtocol, + SipTrunkOutboundAuthenticationPlan, + SipTrunkOutboundSipRegisterPlan, + Squad, + SquadMemberDto, + StartSpeakingPlan, + StepDestination, + StepDestinationConditionsItem, + StepDestinationConditionsItem_ModelBased, + StepDestinationConditionsItem_RuleBased, + StopSpeakingPlan, + StructuredDataPlan, + SuccessEvaluationPlan, + SuccessEvaluationPlanRubric, + SummaryPlan, + SyncVoiceLibraryDto, + SyncVoiceLibraryDtoProvidersItem, + SystemMessage, + TalkscriberTranscriber, + TalkscriberTranscriberLanguage, + Template, + TemplateDetails, + TemplateDetails_Dtmf, + TemplateDetails_EndCall, + TemplateDetails_Function, + TemplateDetails_Ghl, + TemplateDetails_Make, + TemplateDetails_TransferCall, + TemplateDetails_Voicemail, + TemplateProvider, + TemplateProviderDetails, + TemplateProviderDetails_Function, + TemplateProviderDetails_Ghl, + TemplateProviderDetails_Make, + TemplateVisibility, + TimeRange, + TimeRangeStep, + TogetherAiCredential, + TogetherAiModel, + TogetherAiModelToolsItem, + TogetherAiModelToolsItem_Dtmf, + TogetherAiModelToolsItem_EndCall, + TogetherAiModelToolsItem_Function, + TogetherAiModelToolsItem_Ghl, + TogetherAiModelToolsItem_Make, + TogetherAiModelToolsItem_TransferCall, + TogetherAiModelToolsItem_Voicemail, + Token, + TokenRestrictions, + TokenTag, + ToolCall, + ToolCallBlock, + ToolCallBlockMessagesItem, + ToolCallBlockMessagesItem_BlockComplete, + ToolCallBlockMessagesItem_BlockStart, + ToolCallBlockTool, + ToolCallBlockTool_Dtmf, + ToolCallBlockTool_EndCall, + ToolCallBlockTool_Function, + ToolCallBlockTool_Ghl, + ToolCallBlockTool_Make, + ToolCallBlockTool_TransferCall, + ToolCallBlockTool_Voicemail, + ToolCallFunction, + ToolCallMessage, + ToolCallResult, + ToolCallResultMessage, + ToolCallResultMessageItem, + ToolCallResultMessageItem_RequestComplete, + ToolCallResultMessageItem_RequestFailed, + ToolMessageComplete, + ToolMessageCompleteRole, + ToolMessageDelayed, + ToolMessageFailed, + ToolMessageStart, + ToolTemplateMetadata, + ToolTemplateSetup, + TranscriberCost, + TranscriptPlan, + TranscriptionEndpointingPlan, + TransferCallTool, + TransferCallToolDestinationsItem, + TransferCallToolDestinationsItem_Assistant, + TransferCallToolDestinationsItem_Number, + TransferCallToolDestinationsItem_Sip, + TransferCallToolDestinationsItem_Step, + TransferCallToolMessagesItem, + TransferCallToolMessagesItem_RequestComplete, + TransferCallToolMessagesItem_RequestFailed, + TransferCallToolMessagesItem_RequestResponseDelayed, + TransferCallToolMessagesItem_RequestStart, + TransferDestinationAssistant, + TransferDestinationAssistantTransferMode, + TransferDestinationNumber, + TransferDestinationSip, + TransferDestinationStep, + TransportConfigurationTwilio, + TransportConfigurationTwilioRecordingChannels, + TransportCost, + TwilioCredential, + TwilioPhoneNumber, + TwilioPhoneNumberFallbackDestination, + TwilioPhoneNumberFallbackDestination_Number, + TwilioPhoneNumberFallbackDestination_Sip, + TwilioVoicemailDetection, + TwilioVoicemailDetectionVoicemailDetectionTypesItem, + UpdateAnthropicCredentialDto, + UpdateAnyscaleCredentialDto, + UpdateAzureOpenAiCredentialDto, + UpdateAzureOpenAiCredentialDtoModelsItem, + UpdateAzureOpenAiCredentialDtoRegion, + UpdateByoSipTrunkCredentialDto, + UpdateCartesiaCredentialDto, + UpdateCustomLlmCredentialDto, + UpdateDeepInfraCredentialDto, + UpdateDeepgramCredentialDto, + UpdateElevenLabsCredentialDto, + UpdateGcpCredentialDto, + UpdateGladiaCredentialDto, + UpdateGoHighLevelCredentialDto, + UpdateGroqCredentialDto, + UpdateLmntCredentialDto, + UpdateMakeCredentialDto, + UpdateOpenAiCredentialDto, + UpdateOpenRouterCredentialDto, + UpdateOrgDto, + UpdatePerplexityAiCredentialDto, + UpdatePlayHtCredentialDto, + UpdateRimeAiCredentialDto, + UpdateRunpodCredentialDto, + UpdateS3CredentialDto, + UpdateTogetherAiCredentialDto, + UpdateToolTemplateDto, + UpdateToolTemplateDtoDetails, + UpdateToolTemplateDtoDetails_Dtmf, + UpdateToolTemplateDtoDetails_EndCall, + UpdateToolTemplateDtoDetails_Function, + UpdateToolTemplateDtoDetails_Ghl, + UpdateToolTemplateDtoDetails_Make, + UpdateToolTemplateDtoDetails_TransferCall, + UpdateToolTemplateDtoDetails_Voicemail, + UpdateToolTemplateDtoProvider, + UpdateToolTemplateDtoProviderDetails, + UpdateToolTemplateDtoProviderDetails_Function, + UpdateToolTemplateDtoProviderDetails_Ghl, + UpdateToolTemplateDtoProviderDetails_Make, + UpdateToolTemplateDtoVisibility, + UpdateTwilioCredentialDto, + UpdateUserRoleDto, + UpdateUserRoleDtoRole, + UpdateVonageCredentialDto, + User, + UserMessage, + VapiCost, + VapiModel, + VapiModelStepsItem, + VapiModelStepsItem_Callback, + VapiModelStepsItem_Handoff, + VapiModelToolsItem, + VapiModelToolsItem_Dtmf, + VapiModelToolsItem_EndCall, + VapiModelToolsItem_Function, + VapiModelToolsItem_Ghl, + VapiModelToolsItem_Make, + VapiModelToolsItem_TransferCall, + VapiModelToolsItem_Voicemail, + VapiPhoneNumber, + VapiPhoneNumberFallbackDestination, + VapiPhoneNumberFallbackDestination_Number, + VapiPhoneNumberFallbackDestination_Sip, + VoiceCost, + VoiceLibrary, + VoiceLibraryGender, + VoiceLibraryVoiceResponse, + VonageCredential, + VonagePhoneNumber, + VonagePhoneNumberFallbackDestination, + VonagePhoneNumberFallbackDestination_Number, + VonagePhoneNumberFallbackDestination_Sip, + WorkflowBlock, + WorkflowBlockMessagesItem, + WorkflowBlockMessagesItem_BlockComplete, + WorkflowBlockMessagesItem_BlockStart, + WorkflowBlockStepsItem, + WorkflowBlockStepsItem_Callback, + WorkflowBlockStepsItem_Handoff, +) +from .errors import BadRequestError +from . import analytics, assistants, blocks, calls, files, logs, phone_numbers, squads, tools +from .assistants import ( + UpdateAssistantDtoBackgroundSound, + UpdateAssistantDtoClientMessagesItem, + UpdateAssistantDtoFirstMessageMode, + UpdateAssistantDtoModel, + UpdateAssistantDtoModel_Anthropic, + UpdateAssistantDtoModel_Anyscale, + UpdateAssistantDtoModel_CustomLlm, + UpdateAssistantDtoModel_Deepinfra, + UpdateAssistantDtoModel_Groq, + UpdateAssistantDtoModel_Openai, + UpdateAssistantDtoModel_Openrouter, + UpdateAssistantDtoModel_PerplexityAi, + UpdateAssistantDtoModel_TogetherAi, + UpdateAssistantDtoModel_Vapi, + UpdateAssistantDtoServerMessagesItem, + UpdateAssistantDtoTranscriber, + UpdateAssistantDtoTranscriber_Deepgram, + UpdateAssistantDtoTranscriber_Gladia, + UpdateAssistantDtoTranscriber_Talkscriber, + UpdateAssistantDtoVoice, + UpdateAssistantDtoVoice_11Labs, + UpdateAssistantDtoVoice_Azure, + UpdateAssistantDtoVoice_Cartesia, + UpdateAssistantDtoVoice_Deepgram, + UpdateAssistantDtoVoice_Lmnt, + UpdateAssistantDtoVoice_Neets, + UpdateAssistantDtoVoice_Openai, + UpdateAssistantDtoVoice_Playht, + UpdateAssistantDtoVoice_RimeAi, +) +from .blocks import ( + BlocksCreateRequest, + BlocksCreateRequest_Conversation, + BlocksCreateRequest_ToolCall, + BlocksCreateRequest_Workflow, + BlocksCreateResponse, + BlocksCreateResponse_Conversation, + BlocksCreateResponse_ToolCall, + BlocksCreateResponse_Workflow, + BlocksDeleteResponse, + BlocksDeleteResponse_Conversation, + BlocksDeleteResponse_ToolCall, + BlocksDeleteResponse_Workflow, + BlocksGetResponse, + BlocksGetResponse_Conversation, + BlocksGetResponse_ToolCall, + BlocksGetResponse_Workflow, + BlocksListResponseItem, + BlocksListResponseItem_Conversation, + BlocksListResponseItem_ToolCall, + BlocksListResponseItem_Workflow, + BlocksUpdateResponse, + BlocksUpdateResponse_Conversation, + BlocksUpdateResponse_ToolCall, + BlocksUpdateResponse_Workflow, + UpdateBlockDtoMessagesItem, + UpdateBlockDtoMessagesItem_BlockComplete, + UpdateBlockDtoMessagesItem_BlockStart, + UpdateBlockDtoStepsItem, + UpdateBlockDtoStepsItem_Callback, + UpdateBlockDtoStepsItem_Handoff, + UpdateBlockDtoTool, + UpdateBlockDtoTool_Dtmf, + UpdateBlockDtoTool_EndCall, + UpdateBlockDtoTool_Function, + UpdateBlockDtoTool_Ghl, + UpdateBlockDtoTool_Make, + UpdateBlockDtoTool_TransferCall, + UpdateBlockDtoTool_Voicemail, +) +from .client import AsyncVapi, Vapi +from .environment import VapiEnvironment +from .logs import LogsGetRequestSortOrder, LogsGetRequestType +from .phone_numbers import ( + PhoneNumbersCreateRequest, + PhoneNumbersCreateRequest_ByoPhoneNumber, + PhoneNumbersCreateRequest_Twilio, + PhoneNumbersCreateRequest_Vapi, + PhoneNumbersCreateRequest_Vonage, + PhoneNumbersCreateResponse, + PhoneNumbersCreateResponse_ByoPhoneNumber, + PhoneNumbersCreateResponse_Twilio, + PhoneNumbersCreateResponse_Vapi, + PhoneNumbersCreateResponse_Vonage, + PhoneNumbersDeleteResponse, + PhoneNumbersDeleteResponse_ByoPhoneNumber, + PhoneNumbersDeleteResponse_Twilio, + PhoneNumbersDeleteResponse_Vapi, + PhoneNumbersDeleteResponse_Vonage, + PhoneNumbersGetResponse, + PhoneNumbersGetResponse_ByoPhoneNumber, + PhoneNumbersGetResponse_Twilio, + PhoneNumbersGetResponse_Vapi, + PhoneNumbersGetResponse_Vonage, + PhoneNumbersListResponseItem, + PhoneNumbersListResponseItem_ByoPhoneNumber, + PhoneNumbersListResponseItem_Twilio, + PhoneNumbersListResponseItem_Vapi, + PhoneNumbersListResponseItem_Vonage, + PhoneNumbersUpdateResponse, + PhoneNumbersUpdateResponse_ByoPhoneNumber, + PhoneNumbersUpdateResponse_Twilio, + PhoneNumbersUpdateResponse_Vapi, + PhoneNumbersUpdateResponse_Vonage, + UpdatePhoneNumberDtoFallbackDestination, + UpdatePhoneNumberDtoFallbackDestination_Number, + UpdatePhoneNumberDtoFallbackDestination_Sip, +) +from .tools import ( + ToolsCreateRequest, + ToolsCreateRequest_Dtmf, + ToolsCreateRequest_EndCall, + ToolsCreateRequest_Function, + ToolsCreateRequest_Ghl, + ToolsCreateRequest_Make, + ToolsCreateRequest_Output, + ToolsCreateRequest_TransferCall, + ToolsCreateResponse, + ToolsCreateResponse_Dtmf, + ToolsCreateResponse_EndCall, + ToolsCreateResponse_Function, + ToolsCreateResponse_Ghl, + ToolsCreateResponse_Make, + ToolsCreateResponse_Output, + ToolsCreateResponse_TransferCall, + ToolsDeleteResponse, + ToolsDeleteResponse_Dtmf, + ToolsDeleteResponse_EndCall, + ToolsDeleteResponse_Function, + ToolsDeleteResponse_Ghl, + ToolsDeleteResponse_Make, + ToolsDeleteResponse_Output, + ToolsDeleteResponse_TransferCall, + ToolsGetResponse, + ToolsGetResponse_Dtmf, + ToolsGetResponse_EndCall, + ToolsGetResponse_Function, + ToolsGetResponse_Ghl, + ToolsGetResponse_Make, + ToolsGetResponse_Output, + ToolsGetResponse_TransferCall, + ToolsListResponseItem, + ToolsListResponseItem_Dtmf, + ToolsListResponseItem_EndCall, + ToolsListResponseItem_Function, + ToolsListResponseItem_Ghl, + ToolsListResponseItem_Make, + ToolsListResponseItem_Output, + ToolsListResponseItem_TransferCall, + ToolsUpdateResponse, + ToolsUpdateResponse_Dtmf, + ToolsUpdateResponse_EndCall, + ToolsUpdateResponse_Function, + ToolsUpdateResponse_Ghl, + ToolsUpdateResponse_Make, + ToolsUpdateResponse_Output, + ToolsUpdateResponse_TransferCall, + UpdateToolDtoMessagesItem, + UpdateToolDtoMessagesItem_RequestComplete, + UpdateToolDtoMessagesItem_RequestFailed, + UpdateToolDtoMessagesItem_RequestResponseDelayed, + UpdateToolDtoMessagesItem_RequestStart, +) +from .version import __version__ + +__all__ = [ + "AddVoiceToProviderDto", + "Analysis", + "AnalysisCost", + "AnalysisCostAnalysisType", + "AnalysisCostBreakdown", + "AnalysisPlan", + "AnalyticsOperation", + "AnalyticsOperationColumn", + "AnalyticsOperationOperation", + "AnalyticsQuery", + "AnalyticsQueryGroupByItem", + "AnalyticsQueryResult", + "AnthropicCredential", + "AnthropicModel", + "AnthropicModelModel", + "AnthropicModelToolsItem", + "AnthropicModelToolsItem_Dtmf", + "AnthropicModelToolsItem_EndCall", + "AnthropicModelToolsItem_Function", + "AnthropicModelToolsItem_Ghl", + "AnthropicModelToolsItem_Make", + "AnthropicModelToolsItem_TransferCall", + "AnthropicModelToolsItem_Voicemail", + "AnyscaleCredential", + "AnyscaleModel", + "AnyscaleModelToolsItem", + "AnyscaleModelToolsItem_Dtmf", + "AnyscaleModelToolsItem_EndCall", + "AnyscaleModelToolsItem_Function", + "AnyscaleModelToolsItem_Ghl", + "AnyscaleModelToolsItem_Make", + "AnyscaleModelToolsItem_TransferCall", + "AnyscaleModelToolsItem_Voicemail", + "Artifact", + "ArtifactMessagesItem", + "ArtifactPlan", + "AssignmentMutation", + "AssignmentMutationConditionsItem", + "AssignmentMutationConditionsItem_ModelBased", + "AssignmentMutationConditionsItem_RuleBased", + "Assistant", + "AssistantBackgroundSound", + "AssistantClientMessagesItem", + "AssistantFirstMessageMode", + "AssistantModel", + "AssistantModel_Anthropic", + "AssistantModel_Anyscale", + "AssistantModel_CustomLlm", + "AssistantModel_Deepinfra", + "AssistantModel_Groq", + "AssistantModel_Openai", + "AssistantModel_Openrouter", + "AssistantModel_PerplexityAi", + "AssistantModel_TogetherAi", + "AssistantModel_Vapi", + "AssistantOverrides", + "AssistantOverridesBackgroundSound", + "AssistantOverridesClientMessagesItem", + "AssistantOverridesFirstMessageMode", + "AssistantOverridesModel", + "AssistantOverridesModel_Anthropic", + "AssistantOverridesModel_Anyscale", + "AssistantOverridesModel_CustomLlm", + "AssistantOverridesModel_Deepinfra", + "AssistantOverridesModel_Groq", + "AssistantOverridesModel_Openai", + "AssistantOverridesModel_Openrouter", + "AssistantOverridesModel_PerplexityAi", + "AssistantOverridesModel_TogetherAi", + "AssistantOverridesModel_Vapi", + "AssistantOverridesServerMessagesItem", + "AssistantOverridesTranscriber", + "AssistantOverridesTranscriber_Deepgram", + "AssistantOverridesTranscriber_Gladia", + "AssistantOverridesTranscriber_Talkscriber", + "AssistantOverridesVoice", + "AssistantOverridesVoice_11Labs", + "AssistantOverridesVoice_Azure", + "AssistantOverridesVoice_Cartesia", + "AssistantOverridesVoice_Deepgram", + "AssistantOverridesVoice_Lmnt", + "AssistantOverridesVoice_Neets", + "AssistantOverridesVoice_Openai", + "AssistantOverridesVoice_Playht", + "AssistantOverridesVoice_RimeAi", + "AssistantServerMessagesItem", + "AssistantTranscriber", + "AssistantTranscriber_Deepgram", + "AssistantTranscriber_Gladia", + "AssistantTranscriber_Talkscriber", + "AssistantVoice", + "AssistantVoice_11Labs", + "AssistantVoice_Azure", + "AssistantVoice_Cartesia", + "AssistantVoice_Deepgram", + "AssistantVoice_Lmnt", + "AssistantVoice_Neets", + "AssistantVoice_Openai", + "AssistantVoice_Playht", + "AssistantVoice_RimeAi", + "AsyncVapi", + "AzureOpenAiCredential", + "AzureOpenAiCredentialModelsItem", + "AzureOpenAiCredentialRegion", + "AzureVoice", + "AzureVoiceVoiceId", + "BadRequestError", + "BlockCompleteMessage", + "BlockCompleteMessageConditionsItem", + "BlockCompleteMessageConditionsItem_ModelBased", + "BlockCompleteMessageConditionsItem_RuleBased", + "BlockStartMessage", + "BlockStartMessageConditionsItem", + "BlockStartMessageConditionsItem_ModelBased", + "BlockStartMessageConditionsItem_RuleBased", + "BlocksCreateRequest", + "BlocksCreateRequest_Conversation", + "BlocksCreateRequest_ToolCall", + "BlocksCreateRequest_Workflow", + "BlocksCreateResponse", + "BlocksCreateResponse_Conversation", + "BlocksCreateResponse_ToolCall", + "BlocksCreateResponse_Workflow", + "BlocksDeleteResponse", + "BlocksDeleteResponse_Conversation", + "BlocksDeleteResponse_ToolCall", + "BlocksDeleteResponse_Workflow", + "BlocksGetResponse", + "BlocksGetResponse_Conversation", + "BlocksGetResponse_ToolCall", + "BlocksGetResponse_Workflow", + "BlocksListResponseItem", + "BlocksListResponseItem_Conversation", + "BlocksListResponseItem_ToolCall", + "BlocksListResponseItem_Workflow", + "BlocksUpdateResponse", + "BlocksUpdateResponse_Conversation", + "BlocksUpdateResponse_ToolCall", + "BlocksUpdateResponse_Workflow", + "BotMessage", + "BucketPlan", + "BuyPhoneNumberDto", + "BuyPhoneNumberDtoFallbackDestination", + "BuyPhoneNumberDtoFallbackDestination_Number", + "BuyPhoneNumberDtoFallbackDestination_Sip", + "ByoPhoneNumber", + "ByoPhoneNumberFallbackDestination", + "ByoPhoneNumberFallbackDestination_Number", + "ByoPhoneNumberFallbackDestination_Sip", + "ByoSipTrunkCredential", + "Call", + "CallCostsItem", + "CallCostsItem_Analysis", + "CallCostsItem_Model", + "CallCostsItem_Transcriber", + "CallCostsItem_Transport", + "CallCostsItem_Vapi", + "CallCostsItem_Voice", + "CallDestination", + "CallDestination_Number", + "CallDestination_Sip", + "CallEndedReason", + "CallMessagesItem", + "CallPaginatedResponse", + "CallPhoneCallProvider", + "CallPhoneCallTransport", + "CallStatus", + "CallType", + "CallbackStep", + "CallbackStepBlock", + "CallbackStepBlock_Conversation", + "CallbackStepBlock_ToolCall", + "CallbackStepBlock_Workflow", + "CartesiaCredential", + "CartesiaVoice", + "CartesiaVoiceLanguage", + "CartesiaVoiceModel", + "ChunkPlan", + "ChunkPlanPunctuationBoundariesItem", + "ClientInboundMessage", + "ClientInboundMessageAddMessage", + "ClientInboundMessageControl", + "ClientInboundMessageControlControl", + "ClientInboundMessageMessage", + "ClientInboundMessageMessage_AddMessage", + "ClientInboundMessageMessage_Control", + "ClientInboundMessageMessage_Say", + "ClientInboundMessageSay", + "ClientMessage", + "ClientMessageConversationUpdate", + "ClientMessageConversationUpdateMessagesItem", + "ClientMessageHang", + "ClientMessageLanguageChanged", + "ClientMessageMessage", + "ClientMessageMessage_ConversationUpdate", + "ClientMessageMessage_Hang", + "ClientMessageMessage_LanguageChanged", + "ClientMessageMessage_Metadata", + "ClientMessageMessage_ModelOutput", + "ClientMessageMessage_SpeechUpdate", + "ClientMessageMessage_ToolCalls", + "ClientMessageMessage_ToolCallsResult", + "ClientMessageMessage_Transcript", + "ClientMessageMessage_UserInterrupted", + "ClientMessageMessage_VoiceInput", + "ClientMessageMetadata", + "ClientMessageModelOutput", + "ClientMessageSpeechUpdate", + "ClientMessageSpeechUpdateRole", + "ClientMessageSpeechUpdateStatus", + "ClientMessageToolCalls", + "ClientMessageToolCallsResult", + "ClientMessageToolCallsToolWithToolCallListItem", + "ClientMessageToolCallsToolWithToolCallListItem_Function", + "ClientMessageToolCallsToolWithToolCallListItem_Ghl", + "ClientMessageToolCallsToolWithToolCallListItem_Make", + "ClientMessageTranscript", + "ClientMessageTranscriptRole", + "ClientMessageTranscriptTranscriptType", + "ClientMessageUserInterrupted", + "ClientMessageVoiceInput", + "CloneVoiceDto", + "Condition", + "ConditionOperator", + "ConversationBlock", + "ConversationBlockMessagesItem", + "ConversationBlockMessagesItem_BlockComplete", + "ConversationBlockMessagesItem_BlockStart", + "CostBreakdown", + "CreateAnthropicCredentialDto", + "CreateAnyscaleCredentialDto", + "CreateAssistantDto", + "CreateAssistantDtoBackgroundSound", + "CreateAssistantDtoClientMessagesItem", + "CreateAssistantDtoFirstMessageMode", + "CreateAssistantDtoModel", + "CreateAssistantDtoModel_Anthropic", + "CreateAssistantDtoModel_Anyscale", + "CreateAssistantDtoModel_CustomLlm", + "CreateAssistantDtoModel_Deepinfra", + "CreateAssistantDtoModel_Groq", + "CreateAssistantDtoModel_Openai", + "CreateAssistantDtoModel_Openrouter", + "CreateAssistantDtoModel_PerplexityAi", + "CreateAssistantDtoModel_TogetherAi", + "CreateAssistantDtoModel_Vapi", + "CreateAssistantDtoServerMessagesItem", + "CreateAssistantDtoTranscriber", + "CreateAssistantDtoTranscriber_Deepgram", + "CreateAssistantDtoTranscriber_Gladia", + "CreateAssistantDtoTranscriber_Talkscriber", + "CreateAssistantDtoVoice", + "CreateAssistantDtoVoice_11Labs", + "CreateAssistantDtoVoice_Azure", + "CreateAssistantDtoVoice_Cartesia", + "CreateAssistantDtoVoice_Deepgram", + "CreateAssistantDtoVoice_Lmnt", + "CreateAssistantDtoVoice_Neets", + "CreateAssistantDtoVoice_Openai", + "CreateAssistantDtoVoice_Playht", + "CreateAssistantDtoVoice_RimeAi", + "CreateAzureOpenAiCredentialDto", + "CreateAzureOpenAiCredentialDtoModelsItem", + "CreateAzureOpenAiCredentialDtoRegion", + "CreateByoPhoneNumberDto", + "CreateByoPhoneNumberDtoFallbackDestination", + "CreateByoPhoneNumberDtoFallbackDestination_Number", + "CreateByoPhoneNumberDtoFallbackDestination_Sip", + "CreateByoSipTrunkCredentialDto", + "CreateCartesiaCredentialDto", + "CreateConversationBlockDto", + "CreateConversationBlockDtoMessagesItem", + "CreateConversationBlockDtoMessagesItem_BlockComplete", + "CreateConversationBlockDtoMessagesItem_BlockStart", + "CreateCustomLlmCredentialDto", + "CreateCustomerDto", + "CreateDeepInfraCredentialDto", + "CreateDeepgramCredentialDto", + "CreateDtmfToolDto", + "CreateDtmfToolDtoMessagesItem", + "CreateDtmfToolDtoMessagesItem_RequestComplete", + "CreateDtmfToolDtoMessagesItem_RequestFailed", + "CreateDtmfToolDtoMessagesItem_RequestResponseDelayed", + "CreateDtmfToolDtoMessagesItem_RequestStart", + "CreateElevenLabsCredentialDto", + "CreateEndCallToolDto", + "CreateEndCallToolDtoMessagesItem", + "CreateEndCallToolDtoMessagesItem_RequestComplete", + "CreateEndCallToolDtoMessagesItem_RequestFailed", + "CreateEndCallToolDtoMessagesItem_RequestResponseDelayed", + "CreateEndCallToolDtoMessagesItem_RequestStart", + "CreateFunctionToolDto", + "CreateFunctionToolDtoMessagesItem", + "CreateFunctionToolDtoMessagesItem_RequestComplete", + "CreateFunctionToolDtoMessagesItem_RequestFailed", + "CreateFunctionToolDtoMessagesItem_RequestResponseDelayed", + "CreateFunctionToolDtoMessagesItem_RequestStart", + "CreateGcpCredentialDto", + "CreateGhlToolDto", + "CreateGhlToolDtoMessagesItem", + "CreateGhlToolDtoMessagesItem_RequestComplete", + "CreateGhlToolDtoMessagesItem_RequestFailed", + "CreateGhlToolDtoMessagesItem_RequestResponseDelayed", + "CreateGhlToolDtoMessagesItem_RequestStart", + "CreateGladiaCredentialDto", + "CreateGoHighLevelCredentialDto", + "CreateGroqCredentialDto", + "CreateLmntCredentialDto", + "CreateMakeCredentialDto", + "CreateMakeToolDto", + "CreateMakeToolDtoMessagesItem", + "CreateMakeToolDtoMessagesItem_RequestComplete", + "CreateMakeToolDtoMessagesItem_RequestFailed", + "CreateMakeToolDtoMessagesItem_RequestResponseDelayed", + "CreateMakeToolDtoMessagesItem_RequestStart", + "CreateOpenAiCredentialDto", + "CreateOpenRouterCredentialDto", + "CreateOrgDto", + "CreateOutboundCallDto", + "CreateOutputToolDto", + "CreateOutputToolDtoMessagesItem", + "CreateOutputToolDtoMessagesItem_RequestComplete", + "CreateOutputToolDtoMessagesItem_RequestFailed", + "CreateOutputToolDtoMessagesItem_RequestResponseDelayed", + "CreateOutputToolDtoMessagesItem_RequestStart", + "CreatePerplexityAiCredentialDto", + "CreatePlayHtCredentialDto", + "CreateRimeAiCredentialDto", + "CreateRunpodCredentialDto", + "CreateS3CredentialDto", + "CreateSquadDto", + "CreateTogetherAiCredentialDto", + "CreateTokenDto", + "CreateTokenDtoTag", + "CreateToolCallBlockDto", + "CreateToolCallBlockDtoMessagesItem", + "CreateToolCallBlockDtoMessagesItem_BlockComplete", + "CreateToolCallBlockDtoMessagesItem_BlockStart", + "CreateToolCallBlockDtoTool", + "CreateToolCallBlockDtoTool_Dtmf", + "CreateToolCallBlockDtoTool_EndCall", + "CreateToolCallBlockDtoTool_Function", + "CreateToolCallBlockDtoTool_Ghl", + "CreateToolCallBlockDtoTool_Make", + "CreateToolCallBlockDtoTool_TransferCall", + "CreateToolCallBlockDtoTool_Voicemail", + "CreateToolTemplateDto", + "CreateToolTemplateDtoDetails", + "CreateToolTemplateDtoDetails_Dtmf", + "CreateToolTemplateDtoDetails_EndCall", + "CreateToolTemplateDtoDetails_Function", + "CreateToolTemplateDtoDetails_Ghl", + "CreateToolTemplateDtoDetails_Make", + "CreateToolTemplateDtoDetails_TransferCall", + "CreateToolTemplateDtoDetails_Voicemail", + "CreateToolTemplateDtoProvider", + "CreateToolTemplateDtoProviderDetails", + "CreateToolTemplateDtoProviderDetails_Function", + "CreateToolTemplateDtoProviderDetails_Ghl", + "CreateToolTemplateDtoProviderDetails_Make", + "CreateToolTemplateDtoVisibility", + "CreateTransferCallToolDto", + "CreateTransferCallToolDtoDestinationsItem", + "CreateTransferCallToolDtoDestinationsItem_Assistant", + "CreateTransferCallToolDtoDestinationsItem_Number", + "CreateTransferCallToolDtoDestinationsItem_Sip", + "CreateTransferCallToolDtoDestinationsItem_Step", + "CreateTransferCallToolDtoMessagesItem", + "CreateTransferCallToolDtoMessagesItem_RequestComplete", + "CreateTransferCallToolDtoMessagesItem_RequestFailed", + "CreateTransferCallToolDtoMessagesItem_RequestResponseDelayed", + "CreateTransferCallToolDtoMessagesItem_RequestStart", + "CreateTwilioCredentialDto", + "CreateTwilioPhoneNumberDto", + "CreateTwilioPhoneNumberDtoFallbackDestination", + "CreateTwilioPhoneNumberDtoFallbackDestination_Number", + "CreateTwilioPhoneNumberDtoFallbackDestination_Sip", + "CreateVapiPhoneNumberDto", + "CreateVapiPhoneNumberDtoFallbackDestination", + "CreateVapiPhoneNumberDtoFallbackDestination_Number", + "CreateVapiPhoneNumberDtoFallbackDestination_Sip", + "CreateVoicemailToolDto", + "CreateVoicemailToolDtoMessagesItem", + "CreateVoicemailToolDtoMessagesItem_RequestComplete", + "CreateVoicemailToolDtoMessagesItem_RequestFailed", + "CreateVoicemailToolDtoMessagesItem_RequestResponseDelayed", + "CreateVoicemailToolDtoMessagesItem_RequestStart", + "CreateVonageCredentialDto", + "CreateVonagePhoneNumberDto", + "CreateVonagePhoneNumberDtoFallbackDestination", + "CreateVonagePhoneNumberDtoFallbackDestination_Number", + "CreateVonagePhoneNumberDtoFallbackDestination_Sip", + "CreateWebCallDto", + "CreateWorkflowBlockDto", + "CreateWorkflowBlockDtoMessagesItem", + "CreateWorkflowBlockDtoMessagesItem_BlockComplete", + "CreateWorkflowBlockDtoMessagesItem_BlockStart", + "CreateWorkflowBlockDtoStepsItem", + "CreateWorkflowBlockDtoStepsItem_Callback", + "CreateWorkflowBlockDtoStepsItem_Handoff", + "CustomLlmCredential", + "CustomLlmModel", + "CustomLlmModelMetadataSendMode", + "CustomLlmModelToolsItem", + "CustomLlmModelToolsItem_Dtmf", + "CustomLlmModelToolsItem_EndCall", + "CustomLlmModelToolsItem_Function", + "CustomLlmModelToolsItem_Ghl", + "CustomLlmModelToolsItem_Make", + "CustomLlmModelToolsItem_TransferCall", + "CustomLlmModelToolsItem_Voicemail", + "DeepInfraCredential", + "DeepInfraModel", + "DeepInfraModelToolsItem", + "DeepInfraModelToolsItem_Dtmf", + "DeepInfraModelToolsItem_EndCall", + "DeepInfraModelToolsItem_Function", + "DeepInfraModelToolsItem_Ghl", + "DeepInfraModelToolsItem_Make", + "DeepInfraModelToolsItem_TransferCall", + "DeepInfraModelToolsItem_Voicemail", + "DeepgramCredential", + "DeepgramTranscriber", + "DeepgramTranscriberLanguage", + "DeepgramTranscriberModel", + "DeepgramVoice", + "DeepgramVoiceVoiceId", + "DtmfTool", + "DtmfToolMessagesItem", + "DtmfToolMessagesItem_RequestComplete", + "DtmfToolMessagesItem_RequestFailed", + "DtmfToolMessagesItem_RequestResponseDelayed", + "DtmfToolMessagesItem_RequestStart", + "ElevenLabsCredential", + "ElevenLabsVoice", + "ElevenLabsVoiceModel", + "ElevenLabsVoiceVoiceId", + "EndCallTool", + "EndCallToolMessagesItem", + "EndCallToolMessagesItem_RequestComplete", + "EndCallToolMessagesItem_RequestFailed", + "EndCallToolMessagesItem_RequestResponseDelayed", + "EndCallToolMessagesItem_RequestStart", + "Error", + "ExactReplacement", + "File", + "FileStatus", + "FormatPlan", + "FormatPlanReplacementsItem", + "FormatPlanReplacementsItem_Exact", + "FormatPlanReplacementsItem_Regex", + "FunctionTool", + "FunctionToolMessagesItem", + "FunctionToolMessagesItem_RequestComplete", + "FunctionToolMessagesItem_RequestFailed", + "FunctionToolMessagesItem_RequestResponseDelayed", + "FunctionToolMessagesItem_RequestStart", + "FunctionToolProviderDetails", + "FunctionToolWithToolCall", + "FunctionToolWithToolCallMessagesItem", + "FunctionToolWithToolCallMessagesItem_RequestComplete", + "FunctionToolWithToolCallMessagesItem_RequestFailed", + "FunctionToolWithToolCallMessagesItem_RequestResponseDelayed", + "FunctionToolWithToolCallMessagesItem_RequestStart", + "GcpCredential", + "GcpKey", + "GhlTool", + "GhlToolMessagesItem", + "GhlToolMessagesItem_RequestComplete", + "GhlToolMessagesItem_RequestFailed", + "GhlToolMessagesItem_RequestResponseDelayed", + "GhlToolMessagesItem_RequestStart", + "GhlToolMetadata", + "GhlToolProviderDetails", + "GhlToolWithToolCall", + "GhlToolWithToolCallMessagesItem", + "GhlToolWithToolCallMessagesItem_RequestComplete", + "GhlToolWithToolCallMessagesItem_RequestFailed", + "GhlToolWithToolCallMessagesItem_RequestResponseDelayed", + "GhlToolWithToolCallMessagesItem_RequestStart", + "GladiaCredential", + "GladiaTranscriber", + "GladiaTranscriberLanguage", + "GladiaTranscriberLanguageBehaviour", + "GladiaTranscriberModel", + "GoHighLevelCredential", + "GroqCredential", + "GroqModel", + "GroqModelModel", + "GroqModelToolsItem", + "GroqModelToolsItem_Dtmf", + "GroqModelToolsItem_EndCall", + "GroqModelToolsItem_Function", + "GroqModelToolsItem_Ghl", + "GroqModelToolsItem_Make", + "GroqModelToolsItem_TransferCall", + "GroqModelToolsItem_Voicemail", + "HandoffStep", + "HandoffStepBlock", + "HandoffStepBlock_Conversation", + "HandoffStepBlock_ToolCall", + "HandoffStepBlock_Workflow", + "ImportTwilioPhoneNumberDto", + "ImportTwilioPhoneNumberDtoFallbackDestination", + "ImportTwilioPhoneNumberDtoFallbackDestination_Number", + "ImportTwilioPhoneNumberDtoFallbackDestination_Sip", + "ImportVonagePhoneNumberDto", + "ImportVonagePhoneNumberDtoFallbackDestination", + "ImportVonagePhoneNumberDtoFallbackDestination_Number", + "ImportVonagePhoneNumberDtoFallbackDestination_Sip", + "InviteUserDto", + "InviteUserDtoRole", + "JsonSchema", + "JsonSchemaType", + "KnowledgeBase", + "LmntCredential", + "LmntVoice", + "LmntVoiceVoiceId", + "Log", + "LogRequestHttpMethod", + "LogResource", + "LogType", + "LogsGetRequestSortOrder", + "LogsGetRequestType", + "LogsPaginatedResponse", + "MakeCredential", + "MakeTool", + "MakeToolMessagesItem", + "MakeToolMessagesItem_RequestComplete", + "MakeToolMessagesItem_RequestFailed", + "MakeToolMessagesItem_RequestResponseDelayed", + "MakeToolMessagesItem_RequestStart", + "MakeToolMetadata", + "MakeToolProviderDetails", + "MakeToolWithToolCall", + "MakeToolWithToolCallMessagesItem", + "MakeToolWithToolCallMessagesItem_RequestComplete", + "MakeToolWithToolCallMessagesItem_RequestFailed", + "MakeToolWithToolCallMessagesItem_RequestResponseDelayed", + "MakeToolWithToolCallMessagesItem_RequestStart", + "MessagePlan", + "Metrics", + "ModelBasedCondition", + "ModelCost", + "Monitor", + "MonitorPlan", + "NeetsVoice", + "NeetsVoiceVoiceId", + "OpenAiCredential", + "OpenAiFunction", + "OpenAiFunctionParameters", + "OpenAiMessage", + "OpenAiMessageRole", + "OpenAiModel", + "OpenAiModelFallbackModelsItem", + "OpenAiModelModel", + "OpenAiModelToolsItem", + "OpenAiModelToolsItem_Dtmf", + "OpenAiModelToolsItem_EndCall", + "OpenAiModelToolsItem_Function", + "OpenAiModelToolsItem_Ghl", + "OpenAiModelToolsItem_Make", + "OpenAiModelToolsItem_TransferCall", + "OpenAiModelToolsItem_Voicemail", + "OpenAiVoice", + "OpenAiVoiceVoiceId", + "OpenRouterCredential", + "OpenRouterModel", + "OpenRouterModelToolsItem", + "OpenRouterModelToolsItem_Dtmf", + "OpenRouterModelToolsItem_EndCall", + "OpenRouterModelToolsItem_Function", + "OpenRouterModelToolsItem_Ghl", + "OpenRouterModelToolsItem_Make", + "OpenRouterModelToolsItem_TransferCall", + "OpenRouterModelToolsItem_Voicemail", + "Org", + "OrgPlan", + "OutputTool", + "OutputToolMessagesItem", + "OutputToolMessagesItem_RequestComplete", + "OutputToolMessagesItem_RequestFailed", + "OutputToolMessagesItem_RequestResponseDelayed", + "OutputToolMessagesItem_RequestStart", + "PaginationMeta", + "PerplexityAiCredential", + "PerplexityAiModel", + "PerplexityAiModelToolsItem", + "PerplexityAiModelToolsItem_Dtmf", + "PerplexityAiModelToolsItem_EndCall", + "PerplexityAiModelToolsItem_Function", + "PerplexityAiModelToolsItem_Ghl", + "PerplexityAiModelToolsItem_Make", + "PerplexityAiModelToolsItem_TransferCall", + "PerplexityAiModelToolsItem_Voicemail", + "PhoneNumbersCreateRequest", + "PhoneNumbersCreateRequest_ByoPhoneNumber", + "PhoneNumbersCreateRequest_Twilio", + "PhoneNumbersCreateRequest_Vapi", + "PhoneNumbersCreateRequest_Vonage", + "PhoneNumbersCreateResponse", + "PhoneNumbersCreateResponse_ByoPhoneNumber", + "PhoneNumbersCreateResponse_Twilio", + "PhoneNumbersCreateResponse_Vapi", + "PhoneNumbersCreateResponse_Vonage", + "PhoneNumbersDeleteResponse", + "PhoneNumbersDeleteResponse_ByoPhoneNumber", + "PhoneNumbersDeleteResponse_Twilio", + "PhoneNumbersDeleteResponse_Vapi", + "PhoneNumbersDeleteResponse_Vonage", + "PhoneNumbersGetResponse", + "PhoneNumbersGetResponse_ByoPhoneNumber", + "PhoneNumbersGetResponse_Twilio", + "PhoneNumbersGetResponse_Vapi", + "PhoneNumbersGetResponse_Vonage", + "PhoneNumbersListResponseItem", + "PhoneNumbersListResponseItem_ByoPhoneNumber", + "PhoneNumbersListResponseItem_Twilio", + "PhoneNumbersListResponseItem_Vapi", + "PhoneNumbersListResponseItem_Vonage", + "PhoneNumbersUpdateResponse", + "PhoneNumbersUpdateResponse_ByoPhoneNumber", + "PhoneNumbersUpdateResponse_Twilio", + "PhoneNumbersUpdateResponse_Vapi", + "PhoneNumbersUpdateResponse_Vonage", + "PlayHtCredential", + "PlayHtVoice", + "PlayHtVoiceEmotion", + "PlayHtVoiceVoiceId", + "RegexOption", + "RegexOptionType", + "RegexReplacement", + "RimeAiCredential", + "RimeAiVoice", + "RimeAiVoiceModel", + "RimeAiVoiceVoiceId", + "RuleBasedCondition", + "RuleBasedConditionOperator", + "RunpodCredential", + "S3Credential", + "SbcConfiguration", + "Server", + "ServerMessage", + "ServerMessageAssistantRequest", + "ServerMessageAssistantRequestPhoneNumber", + "ServerMessageAssistantRequestPhoneNumber_ByoPhoneNumber", + "ServerMessageAssistantRequestPhoneNumber_Twilio", + "ServerMessageAssistantRequestPhoneNumber_Vapi", + "ServerMessageAssistantRequestPhoneNumber_Vonage", + "ServerMessageConversationUpdate", + "ServerMessageConversationUpdateMessagesItem", + "ServerMessageConversationUpdatePhoneNumber", + "ServerMessageConversationUpdatePhoneNumber_ByoPhoneNumber", + "ServerMessageConversationUpdatePhoneNumber_Twilio", + "ServerMessageConversationUpdatePhoneNumber_Vapi", + "ServerMessageConversationUpdatePhoneNumber_Vonage", + "ServerMessageEndOfCallReport", + "ServerMessageEndOfCallReportCostsItem", + "ServerMessageEndOfCallReportCostsItem_Analysis", + "ServerMessageEndOfCallReportCostsItem_Model", + "ServerMessageEndOfCallReportCostsItem_Transcriber", + "ServerMessageEndOfCallReportCostsItem_Transport", + "ServerMessageEndOfCallReportCostsItem_Vapi", + "ServerMessageEndOfCallReportCostsItem_Voice", + "ServerMessageEndOfCallReportEndedReason", + "ServerMessageEndOfCallReportPhoneNumber", + "ServerMessageEndOfCallReportPhoneNumber_ByoPhoneNumber", + "ServerMessageEndOfCallReportPhoneNumber_Twilio", + "ServerMessageEndOfCallReportPhoneNumber_Vapi", + "ServerMessageEndOfCallReportPhoneNumber_Vonage", + "ServerMessageHang", + "ServerMessageHangPhoneNumber", + "ServerMessageHangPhoneNumber_ByoPhoneNumber", + "ServerMessageHangPhoneNumber_Twilio", + "ServerMessageHangPhoneNumber_Vapi", + "ServerMessageHangPhoneNumber_Vonage", + "ServerMessageLanguageChanged", + "ServerMessageLanguageChangedPhoneNumber", + "ServerMessageLanguageChangedPhoneNumber_ByoPhoneNumber", + "ServerMessageLanguageChangedPhoneNumber_Twilio", + "ServerMessageLanguageChangedPhoneNumber_Vapi", + "ServerMessageLanguageChangedPhoneNumber_Vonage", + "ServerMessageMessage", + "ServerMessageMessage_AssistantRequest", + "ServerMessageMessage_ConversationUpdate", + "ServerMessageMessage_EndOfCallReport", + "ServerMessageMessage_Hang", + "ServerMessageMessage_LanguageChanged", + "ServerMessageMessage_ModelOutput", + "ServerMessageMessage_PhoneCallControl", + "ServerMessageMessage_SpeechUpdate", + "ServerMessageMessage_StatusUpdate", + "ServerMessageMessage_ToolCalls", + "ServerMessageMessage_Transcript", + "ServerMessageMessage_TransferDestinationRequest", + "ServerMessageMessage_TransferUpdate", + "ServerMessageMessage_UserInterrupted", + "ServerMessageMessage_VoiceInput", + "ServerMessageMessage_VoiceRequest", + "ServerMessageModelOutput", + "ServerMessageModelOutputPhoneNumber", + "ServerMessageModelOutputPhoneNumber_ByoPhoneNumber", + "ServerMessageModelOutputPhoneNumber_Twilio", + "ServerMessageModelOutputPhoneNumber_Vapi", + "ServerMessageModelOutputPhoneNumber_Vonage", + "ServerMessagePhoneCallControl", + "ServerMessagePhoneCallControlDestination", + "ServerMessagePhoneCallControlDestination_Number", + "ServerMessagePhoneCallControlDestination_Sip", + "ServerMessagePhoneCallControlPhoneNumber", + "ServerMessagePhoneCallControlPhoneNumber_ByoPhoneNumber", + "ServerMessagePhoneCallControlPhoneNumber_Twilio", + "ServerMessagePhoneCallControlPhoneNumber_Vapi", + "ServerMessagePhoneCallControlPhoneNumber_Vonage", + "ServerMessagePhoneCallControlRequest", + "ServerMessageResponse", + "ServerMessageResponseAssistantRequest", + "ServerMessageResponseAssistantRequestDestination", + "ServerMessageResponseAssistantRequestDestination_Number", + "ServerMessageResponseAssistantRequestDestination_Sip", + "ServerMessageResponseMessageResponse", + "ServerMessageResponseToolCalls", + "ServerMessageResponseTransferDestinationRequest", + "ServerMessageResponseTransferDestinationRequestDestination", + "ServerMessageResponseTransferDestinationRequestDestination_Assistant", + "ServerMessageResponseTransferDestinationRequestDestination_Number", + "ServerMessageResponseTransferDestinationRequestDestination_Sip", + "ServerMessageResponseTransferDestinationRequestDestination_Step", + "ServerMessageResponseVoiceRequest", + "ServerMessageSpeechUpdate", + "ServerMessageSpeechUpdatePhoneNumber", + "ServerMessageSpeechUpdatePhoneNumber_ByoPhoneNumber", + "ServerMessageSpeechUpdatePhoneNumber_Twilio", + "ServerMessageSpeechUpdatePhoneNumber_Vapi", + "ServerMessageSpeechUpdatePhoneNumber_Vonage", + "ServerMessageSpeechUpdateRole", + "ServerMessageSpeechUpdateStatus", + "ServerMessageStatusUpdate", + "ServerMessageStatusUpdateDestination", + "ServerMessageStatusUpdateDestination_Number", + "ServerMessageStatusUpdateDestination_Sip", + "ServerMessageStatusUpdateEndedReason", + "ServerMessageStatusUpdateMessagesItem", + "ServerMessageStatusUpdatePhoneNumber", + "ServerMessageStatusUpdatePhoneNumber_ByoPhoneNumber", + "ServerMessageStatusUpdatePhoneNumber_Twilio", + "ServerMessageStatusUpdatePhoneNumber_Vapi", + "ServerMessageStatusUpdatePhoneNumber_Vonage", + "ServerMessageStatusUpdateStatus", + "ServerMessageToolCalls", + "ServerMessageToolCallsPhoneNumber", + "ServerMessageToolCallsPhoneNumber_ByoPhoneNumber", + "ServerMessageToolCallsPhoneNumber_Twilio", + "ServerMessageToolCallsPhoneNumber_Vapi", + "ServerMessageToolCallsPhoneNumber_Vonage", + "ServerMessageToolCallsToolWithToolCallListItem", + "ServerMessageToolCallsToolWithToolCallListItem_Function", + "ServerMessageToolCallsToolWithToolCallListItem_Ghl", + "ServerMessageToolCallsToolWithToolCallListItem_Make", + "ServerMessageTranscript", + "ServerMessageTranscriptPhoneNumber", + "ServerMessageTranscriptPhoneNumber_ByoPhoneNumber", + "ServerMessageTranscriptPhoneNumber_Twilio", + "ServerMessageTranscriptPhoneNumber_Vapi", + "ServerMessageTranscriptPhoneNumber_Vonage", + "ServerMessageTranscriptRole", + "ServerMessageTranscriptTranscriptType", + "ServerMessageTransferDestinationRequest", + "ServerMessageTransferDestinationRequestPhoneNumber", + "ServerMessageTransferDestinationRequestPhoneNumber_ByoPhoneNumber", + "ServerMessageTransferDestinationRequestPhoneNumber_Twilio", + "ServerMessageTransferDestinationRequestPhoneNumber_Vapi", + "ServerMessageTransferDestinationRequestPhoneNumber_Vonage", + "ServerMessageTransferUpdate", + "ServerMessageTransferUpdateDestination", + "ServerMessageTransferUpdateDestination_Assistant", + "ServerMessageTransferUpdateDestination_Number", + "ServerMessageTransferUpdateDestination_Sip", + "ServerMessageTransferUpdateDestination_Step", + "ServerMessageTransferUpdatePhoneNumber", + "ServerMessageTransferUpdatePhoneNumber_ByoPhoneNumber", + "ServerMessageTransferUpdatePhoneNumber_Twilio", + "ServerMessageTransferUpdatePhoneNumber_Vapi", + "ServerMessageTransferUpdatePhoneNumber_Vonage", + "ServerMessageUserInterrupted", + "ServerMessageUserInterruptedPhoneNumber", + "ServerMessageUserInterruptedPhoneNumber_ByoPhoneNumber", + "ServerMessageUserInterruptedPhoneNumber_Twilio", + "ServerMessageUserInterruptedPhoneNumber_Vapi", + "ServerMessageUserInterruptedPhoneNumber_Vonage", + "ServerMessageVoiceInput", + "ServerMessageVoiceInputPhoneNumber", + "ServerMessageVoiceInputPhoneNumber_ByoPhoneNumber", + "ServerMessageVoiceInputPhoneNumber_Twilio", + "ServerMessageVoiceInputPhoneNumber_Vapi", + "ServerMessageVoiceInputPhoneNumber_Vonage", + "ServerMessageVoiceRequest", + "ServerMessageVoiceRequestPhoneNumber", + "ServerMessageVoiceRequestPhoneNumber_ByoPhoneNumber", + "ServerMessageVoiceRequestPhoneNumber_Twilio", + "ServerMessageVoiceRequestPhoneNumber_Vapi", + "ServerMessageVoiceRequestPhoneNumber_Vonage", + "SipTrunkGateway", + "SipTrunkGatewayOutboundProtocol", + "SipTrunkOutboundAuthenticationPlan", + "SipTrunkOutboundSipRegisterPlan", + "Squad", + "SquadMemberDto", + "StartSpeakingPlan", + "StepDestination", + "StepDestinationConditionsItem", + "StepDestinationConditionsItem_ModelBased", + "StepDestinationConditionsItem_RuleBased", + "StopSpeakingPlan", + "StructuredDataPlan", + "SuccessEvaluationPlan", + "SuccessEvaluationPlanRubric", + "SummaryPlan", + "SyncVoiceLibraryDto", + "SyncVoiceLibraryDtoProvidersItem", + "SystemMessage", + "TalkscriberTranscriber", + "TalkscriberTranscriberLanguage", + "Template", + "TemplateDetails", + "TemplateDetails_Dtmf", + "TemplateDetails_EndCall", + "TemplateDetails_Function", + "TemplateDetails_Ghl", + "TemplateDetails_Make", + "TemplateDetails_TransferCall", + "TemplateDetails_Voicemail", + "TemplateProvider", + "TemplateProviderDetails", + "TemplateProviderDetails_Function", + "TemplateProviderDetails_Ghl", + "TemplateProviderDetails_Make", + "TemplateVisibility", + "TimeRange", + "TimeRangeStep", + "TogetherAiCredential", + "TogetherAiModel", + "TogetherAiModelToolsItem", + "TogetherAiModelToolsItem_Dtmf", + "TogetherAiModelToolsItem_EndCall", + "TogetherAiModelToolsItem_Function", + "TogetherAiModelToolsItem_Ghl", + "TogetherAiModelToolsItem_Make", + "TogetherAiModelToolsItem_TransferCall", + "TogetherAiModelToolsItem_Voicemail", + "Token", + "TokenRestrictions", + "TokenTag", + "ToolCall", + "ToolCallBlock", + "ToolCallBlockMessagesItem", + "ToolCallBlockMessagesItem_BlockComplete", + "ToolCallBlockMessagesItem_BlockStart", + "ToolCallBlockTool", + "ToolCallBlockTool_Dtmf", + "ToolCallBlockTool_EndCall", + "ToolCallBlockTool_Function", + "ToolCallBlockTool_Ghl", + "ToolCallBlockTool_Make", + "ToolCallBlockTool_TransferCall", + "ToolCallBlockTool_Voicemail", + "ToolCallFunction", + "ToolCallMessage", + "ToolCallResult", + "ToolCallResultMessage", + "ToolCallResultMessageItem", + "ToolCallResultMessageItem_RequestComplete", + "ToolCallResultMessageItem_RequestFailed", + "ToolMessageComplete", + "ToolMessageCompleteRole", + "ToolMessageDelayed", + "ToolMessageFailed", + "ToolMessageStart", + "ToolTemplateMetadata", + "ToolTemplateSetup", + "ToolsCreateRequest", + "ToolsCreateRequest_Dtmf", + "ToolsCreateRequest_EndCall", + "ToolsCreateRequest_Function", + "ToolsCreateRequest_Ghl", + "ToolsCreateRequest_Make", + "ToolsCreateRequest_Output", + "ToolsCreateRequest_TransferCall", + "ToolsCreateResponse", + "ToolsCreateResponse_Dtmf", + "ToolsCreateResponse_EndCall", + "ToolsCreateResponse_Function", + "ToolsCreateResponse_Ghl", + "ToolsCreateResponse_Make", + "ToolsCreateResponse_Output", + "ToolsCreateResponse_TransferCall", + "ToolsDeleteResponse", + "ToolsDeleteResponse_Dtmf", + "ToolsDeleteResponse_EndCall", + "ToolsDeleteResponse_Function", + "ToolsDeleteResponse_Ghl", + "ToolsDeleteResponse_Make", + "ToolsDeleteResponse_Output", + "ToolsDeleteResponse_TransferCall", + "ToolsGetResponse", + "ToolsGetResponse_Dtmf", + "ToolsGetResponse_EndCall", + "ToolsGetResponse_Function", + "ToolsGetResponse_Ghl", + "ToolsGetResponse_Make", + "ToolsGetResponse_Output", + "ToolsGetResponse_TransferCall", + "ToolsListResponseItem", + "ToolsListResponseItem_Dtmf", + "ToolsListResponseItem_EndCall", + "ToolsListResponseItem_Function", + "ToolsListResponseItem_Ghl", + "ToolsListResponseItem_Make", + "ToolsListResponseItem_Output", + "ToolsListResponseItem_TransferCall", + "ToolsUpdateResponse", + "ToolsUpdateResponse_Dtmf", + "ToolsUpdateResponse_EndCall", + "ToolsUpdateResponse_Function", + "ToolsUpdateResponse_Ghl", + "ToolsUpdateResponse_Make", + "ToolsUpdateResponse_Output", + "ToolsUpdateResponse_TransferCall", + "TranscriberCost", + "TranscriptPlan", + "TranscriptionEndpointingPlan", + "TransferCallTool", + "TransferCallToolDestinationsItem", + "TransferCallToolDestinationsItem_Assistant", + "TransferCallToolDestinationsItem_Number", + "TransferCallToolDestinationsItem_Sip", + "TransferCallToolDestinationsItem_Step", + "TransferCallToolMessagesItem", + "TransferCallToolMessagesItem_RequestComplete", + "TransferCallToolMessagesItem_RequestFailed", + "TransferCallToolMessagesItem_RequestResponseDelayed", + "TransferCallToolMessagesItem_RequestStart", + "TransferDestinationAssistant", + "TransferDestinationAssistantTransferMode", + "TransferDestinationNumber", + "TransferDestinationSip", + "TransferDestinationStep", + "TransportConfigurationTwilio", + "TransportConfigurationTwilioRecordingChannels", + "TransportCost", + "TwilioCredential", + "TwilioPhoneNumber", + "TwilioPhoneNumberFallbackDestination", + "TwilioPhoneNumberFallbackDestination_Number", + "TwilioPhoneNumberFallbackDestination_Sip", + "TwilioVoicemailDetection", + "TwilioVoicemailDetectionVoicemailDetectionTypesItem", + "UpdateAnthropicCredentialDto", + "UpdateAnyscaleCredentialDto", + "UpdateAssistantDtoBackgroundSound", + "UpdateAssistantDtoClientMessagesItem", + "UpdateAssistantDtoFirstMessageMode", + "UpdateAssistantDtoModel", + "UpdateAssistantDtoModel_Anthropic", + "UpdateAssistantDtoModel_Anyscale", + "UpdateAssistantDtoModel_CustomLlm", + "UpdateAssistantDtoModel_Deepinfra", + "UpdateAssistantDtoModel_Groq", + "UpdateAssistantDtoModel_Openai", + "UpdateAssistantDtoModel_Openrouter", + "UpdateAssistantDtoModel_PerplexityAi", + "UpdateAssistantDtoModel_TogetherAi", + "UpdateAssistantDtoModel_Vapi", + "UpdateAssistantDtoServerMessagesItem", + "UpdateAssistantDtoTranscriber", + "UpdateAssistantDtoTranscriber_Deepgram", + "UpdateAssistantDtoTranscriber_Gladia", + "UpdateAssistantDtoTranscriber_Talkscriber", + "UpdateAssistantDtoVoice", + "UpdateAssistantDtoVoice_11Labs", + "UpdateAssistantDtoVoice_Azure", + "UpdateAssistantDtoVoice_Cartesia", + "UpdateAssistantDtoVoice_Deepgram", + "UpdateAssistantDtoVoice_Lmnt", + "UpdateAssistantDtoVoice_Neets", + "UpdateAssistantDtoVoice_Openai", + "UpdateAssistantDtoVoice_Playht", + "UpdateAssistantDtoVoice_RimeAi", + "UpdateAzureOpenAiCredentialDto", + "UpdateAzureOpenAiCredentialDtoModelsItem", + "UpdateAzureOpenAiCredentialDtoRegion", + "UpdateBlockDtoMessagesItem", + "UpdateBlockDtoMessagesItem_BlockComplete", + "UpdateBlockDtoMessagesItem_BlockStart", + "UpdateBlockDtoStepsItem", + "UpdateBlockDtoStepsItem_Callback", + "UpdateBlockDtoStepsItem_Handoff", + "UpdateBlockDtoTool", + "UpdateBlockDtoTool_Dtmf", + "UpdateBlockDtoTool_EndCall", + "UpdateBlockDtoTool_Function", + "UpdateBlockDtoTool_Ghl", + "UpdateBlockDtoTool_Make", + "UpdateBlockDtoTool_TransferCall", + "UpdateBlockDtoTool_Voicemail", + "UpdateByoSipTrunkCredentialDto", + "UpdateCartesiaCredentialDto", + "UpdateCustomLlmCredentialDto", + "UpdateDeepInfraCredentialDto", + "UpdateDeepgramCredentialDto", + "UpdateElevenLabsCredentialDto", + "UpdateGcpCredentialDto", + "UpdateGladiaCredentialDto", + "UpdateGoHighLevelCredentialDto", + "UpdateGroqCredentialDto", + "UpdateLmntCredentialDto", + "UpdateMakeCredentialDto", + "UpdateOpenAiCredentialDto", + "UpdateOpenRouterCredentialDto", + "UpdateOrgDto", + "UpdatePerplexityAiCredentialDto", + "UpdatePhoneNumberDtoFallbackDestination", + "UpdatePhoneNumberDtoFallbackDestination_Number", + "UpdatePhoneNumberDtoFallbackDestination_Sip", + "UpdatePlayHtCredentialDto", + "UpdateRimeAiCredentialDto", + "UpdateRunpodCredentialDto", + "UpdateS3CredentialDto", + "UpdateTogetherAiCredentialDto", + "UpdateToolDtoMessagesItem", + "UpdateToolDtoMessagesItem_RequestComplete", + "UpdateToolDtoMessagesItem_RequestFailed", + "UpdateToolDtoMessagesItem_RequestResponseDelayed", + "UpdateToolDtoMessagesItem_RequestStart", + "UpdateToolTemplateDto", + "UpdateToolTemplateDtoDetails", + "UpdateToolTemplateDtoDetails_Dtmf", + "UpdateToolTemplateDtoDetails_EndCall", + "UpdateToolTemplateDtoDetails_Function", + "UpdateToolTemplateDtoDetails_Ghl", + "UpdateToolTemplateDtoDetails_Make", + "UpdateToolTemplateDtoDetails_TransferCall", + "UpdateToolTemplateDtoDetails_Voicemail", + "UpdateToolTemplateDtoProvider", + "UpdateToolTemplateDtoProviderDetails", + "UpdateToolTemplateDtoProviderDetails_Function", + "UpdateToolTemplateDtoProviderDetails_Ghl", + "UpdateToolTemplateDtoProviderDetails_Make", + "UpdateToolTemplateDtoVisibility", + "UpdateTwilioCredentialDto", + "UpdateUserRoleDto", + "UpdateUserRoleDtoRole", + "UpdateVonageCredentialDto", + "User", + "UserMessage", + "Vapi", + "VapiCost", + "VapiEnvironment", + "VapiModel", + "VapiModelStepsItem", + "VapiModelStepsItem_Callback", + "VapiModelStepsItem_Handoff", + "VapiModelToolsItem", + "VapiModelToolsItem_Dtmf", + "VapiModelToolsItem_EndCall", + "VapiModelToolsItem_Function", + "VapiModelToolsItem_Ghl", + "VapiModelToolsItem_Make", + "VapiModelToolsItem_TransferCall", + "VapiModelToolsItem_Voicemail", + "VapiPhoneNumber", + "VapiPhoneNumberFallbackDestination", + "VapiPhoneNumberFallbackDestination_Number", + "VapiPhoneNumberFallbackDestination_Sip", + "VoiceCost", + "VoiceLibrary", + "VoiceLibraryGender", + "VoiceLibraryVoiceResponse", + "VonageCredential", + "VonagePhoneNumber", + "VonagePhoneNumberFallbackDestination", + "VonagePhoneNumberFallbackDestination_Number", + "VonagePhoneNumberFallbackDestination_Sip", + "WorkflowBlock", + "WorkflowBlockMessagesItem", + "WorkflowBlockMessagesItem_BlockComplete", + "WorkflowBlockMessagesItem_BlockStart", + "WorkflowBlockStepsItem", + "WorkflowBlockStepsItem_Callback", + "WorkflowBlockStepsItem_Handoff", + "__version__", + "analytics", + "assistants", + "blocks", + "calls", + "files", + "logs", + "phone_numbers", + "squads", + "tools", +] diff --git a/src/vapi/analytics/__init__.py b/src/vapi/analytics/__init__.py new file mode 100644 index 0000000..f3ea265 --- /dev/null +++ b/src/vapi/analytics/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/vapi/analytics/client.py b/src/vapi/analytics/client.py new file mode 100644 index 0000000..8f7a9e7 --- /dev/null +++ b/src/vapi/analytics/client.py @@ -0,0 +1,159 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ..core.client_wrapper import SyncClientWrapper +from ..types.analytics_query import AnalyticsQuery +from ..core.request_options import RequestOptions +from ..types.analytics_query_result import AnalyticsQueryResult +from ..core.serialization import convert_and_respect_annotation_metadata +from ..core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class AnalyticsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get( + self, *, queries: typing.Sequence[AnalyticsQuery], request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[AnalyticsQueryResult]: + """ + Parameters + ---------- + queries : typing.Sequence[AnalyticsQuery] + This is the list of metric queries you want to perform. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[AnalyticsQueryResult] + + + Examples + -------- + from vapi import AnalyticsOperation, AnalyticsQuery, Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.analytics.get( + queries=[ + AnalyticsQuery( + name="name", + operations=[ + AnalyticsOperation( + operation="sum", + column="id", + ) + ], + ) + ], + ) + """ + _response = self._client_wrapper.httpx_client.request( + "analytics", + method="POST", + json={ + "queries": convert_and_respect_annotation_metadata( + object_=queries, annotation=typing.Sequence[AnalyticsQuery], direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[AnalyticsQueryResult], + parse_obj_as( + type_=typing.List[AnalyticsQueryResult], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncAnalyticsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get( + self, *, queries: typing.Sequence[AnalyticsQuery], request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[AnalyticsQueryResult]: + """ + Parameters + ---------- + queries : typing.Sequence[AnalyticsQuery] + This is the list of metric queries you want to perform. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[AnalyticsQueryResult] + + + Examples + -------- + import asyncio + + from vapi import AnalyticsOperation, AnalyticsQuery, AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.analytics.get( + queries=[ + AnalyticsQuery( + name="name", + operations=[ + AnalyticsOperation( + operation="sum", + column="id", + ) + ], + ) + ], + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "analytics", + method="POST", + json={ + "queries": convert_and_respect_annotation_metadata( + object_=queries, annotation=typing.Sequence[AnalyticsQuery], direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[AnalyticsQueryResult], + parse_obj_as( + type_=typing.List[AnalyticsQueryResult], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/vapi/assistants/__init__.py b/src/vapi/assistants/__init__.py new file mode 100644 index 0000000..4fd0118 --- /dev/null +++ b/src/vapi/assistants/__init__.py @@ -0,0 +1,65 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import ( + UpdateAssistantDtoBackgroundSound, + UpdateAssistantDtoClientMessagesItem, + UpdateAssistantDtoFirstMessageMode, + UpdateAssistantDtoModel, + UpdateAssistantDtoModel_Anthropic, + UpdateAssistantDtoModel_Anyscale, + UpdateAssistantDtoModel_CustomLlm, + UpdateAssistantDtoModel_Deepinfra, + UpdateAssistantDtoModel_Groq, + UpdateAssistantDtoModel_Openai, + UpdateAssistantDtoModel_Openrouter, + UpdateAssistantDtoModel_PerplexityAi, + UpdateAssistantDtoModel_TogetherAi, + UpdateAssistantDtoModel_Vapi, + UpdateAssistantDtoServerMessagesItem, + UpdateAssistantDtoTranscriber, + UpdateAssistantDtoTranscriber_Deepgram, + UpdateAssistantDtoTranscriber_Gladia, + UpdateAssistantDtoTranscriber_Talkscriber, + UpdateAssistantDtoVoice, + UpdateAssistantDtoVoice_11Labs, + UpdateAssistantDtoVoice_Azure, + UpdateAssistantDtoVoice_Cartesia, + UpdateAssistantDtoVoice_Deepgram, + UpdateAssistantDtoVoice_Lmnt, + UpdateAssistantDtoVoice_Neets, + UpdateAssistantDtoVoice_Openai, + UpdateAssistantDtoVoice_Playht, + UpdateAssistantDtoVoice_RimeAi, +) + +__all__ = [ + "UpdateAssistantDtoBackgroundSound", + "UpdateAssistantDtoClientMessagesItem", + "UpdateAssistantDtoFirstMessageMode", + "UpdateAssistantDtoModel", + "UpdateAssistantDtoModel_Anthropic", + "UpdateAssistantDtoModel_Anyscale", + "UpdateAssistantDtoModel_CustomLlm", + "UpdateAssistantDtoModel_Deepinfra", + "UpdateAssistantDtoModel_Groq", + "UpdateAssistantDtoModel_Openai", + "UpdateAssistantDtoModel_Openrouter", + "UpdateAssistantDtoModel_PerplexityAi", + "UpdateAssistantDtoModel_TogetherAi", + "UpdateAssistantDtoModel_Vapi", + "UpdateAssistantDtoServerMessagesItem", + "UpdateAssistantDtoTranscriber", + "UpdateAssistantDtoTranscriber_Deepgram", + "UpdateAssistantDtoTranscriber_Gladia", + "UpdateAssistantDtoTranscriber_Talkscriber", + "UpdateAssistantDtoVoice", + "UpdateAssistantDtoVoice_11Labs", + "UpdateAssistantDtoVoice_Azure", + "UpdateAssistantDtoVoice_Cartesia", + "UpdateAssistantDtoVoice_Deepgram", + "UpdateAssistantDtoVoice_Lmnt", + "UpdateAssistantDtoVoice_Neets", + "UpdateAssistantDtoVoice_Openai", + "UpdateAssistantDtoVoice_Playht", + "UpdateAssistantDtoVoice_RimeAi", +] diff --git a/src/vapi/assistants/client.py b/src/vapi/assistants/client.py new file mode 100644 index 0000000..d654956 --- /dev/null +++ b/src/vapi/assistants/client.py @@ -0,0 +1,1593 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ..core.client_wrapper import SyncClientWrapper +import datetime as dt +from ..core.request_options import RequestOptions +from ..types.assistant import Assistant +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..types.create_assistant_dto_transcriber import CreateAssistantDtoTranscriber +from ..types.create_assistant_dto_model import CreateAssistantDtoModel +from ..types.create_assistant_dto_voice import CreateAssistantDtoVoice +from ..types.create_assistant_dto_first_message_mode import CreateAssistantDtoFirstMessageMode +from ..types.create_assistant_dto_client_messages_item import CreateAssistantDtoClientMessagesItem +from ..types.create_assistant_dto_server_messages_item import CreateAssistantDtoServerMessagesItem +from ..types.create_assistant_dto_background_sound import CreateAssistantDtoBackgroundSound +from ..types.transport_configuration_twilio import TransportConfigurationTwilio +from ..types.twilio_voicemail_detection import TwilioVoicemailDetection +from ..types.analysis_plan import AnalysisPlan +from ..types.artifact_plan import ArtifactPlan +from ..types.message_plan import MessagePlan +from ..types.start_speaking_plan import StartSpeakingPlan +from ..types.stop_speaking_plan import StopSpeakingPlan +from ..types.monitor_plan import MonitorPlan +from ..core.serialization import convert_and_respect_annotation_metadata +from ..core.jsonable_encoder import jsonable_encoder +from .types.update_assistant_dto_transcriber import UpdateAssistantDtoTranscriber +from .types.update_assistant_dto_model import UpdateAssistantDtoModel +from .types.update_assistant_dto_voice import UpdateAssistantDtoVoice +from .types.update_assistant_dto_first_message_mode import UpdateAssistantDtoFirstMessageMode +from .types.update_assistant_dto_client_messages_item import UpdateAssistantDtoClientMessagesItem +from .types.update_assistant_dto_server_messages_item import UpdateAssistantDtoServerMessagesItem +from .types.update_assistant_dto_background_sound import UpdateAssistantDtoBackgroundSound +from ..core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class AssistantsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[Assistant]: + """ + Parameters + ---------- + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[Assistant] + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.assistants.list() + """ + _response = self._client_wrapper.httpx_client.request( + "assistant", + method="GET", + params={ + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[Assistant], + parse_obj_as( + type_=typing.List[Assistant], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def create( + self, + *, + transcriber: typing.Optional[CreateAssistantDtoTranscriber] = OMIT, + model: typing.Optional[CreateAssistantDtoModel] = OMIT, + voice: typing.Optional[CreateAssistantDtoVoice] = OMIT, + first_message_mode: typing.Optional[CreateAssistantDtoFirstMessageMode] = OMIT, + hipaa_enabled: typing.Optional[bool] = OMIT, + client_messages: typing.Optional[typing.Sequence[CreateAssistantDtoClientMessagesItem]] = OMIT, + server_messages: typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]] = OMIT, + silence_timeout_seconds: typing.Optional[float] = OMIT, + max_duration_seconds: typing.Optional[float] = OMIT, + background_sound: typing.Optional[CreateAssistantDtoBackgroundSound] = OMIT, + backchanneling_enabled: typing.Optional[bool] = OMIT, + background_denoising_enabled: typing.Optional[bool] = OMIT, + model_output_in_messages_enabled: typing.Optional[bool] = OMIT, + transport_configurations: typing.Optional[typing.Sequence[TransportConfigurationTwilio]] = OMIT, + name: typing.Optional[str] = OMIT, + first_message: typing.Optional[str] = OMIT, + voicemail_detection: typing.Optional[TwilioVoicemailDetection] = OMIT, + voicemail_message: typing.Optional[str] = OMIT, + end_call_message: typing.Optional[str] = OMIT, + end_call_phrases: typing.Optional[typing.Sequence[str]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + server_url: typing.Optional[str] = OMIT, + server_url_secret: typing.Optional[str] = OMIT, + analysis_plan: typing.Optional[AnalysisPlan] = OMIT, + artifact_plan: typing.Optional[ArtifactPlan] = OMIT, + message_plan: typing.Optional[MessagePlan] = OMIT, + start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, + stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, + monitor_plan: typing.Optional[MonitorPlan] = OMIT, + credential_ids: typing.Optional[typing.Sequence[str]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> Assistant: + """ + Parameters + ---------- + transcriber : typing.Optional[CreateAssistantDtoTranscriber] + These are the options for the assistant's transcriber. + + model : typing.Optional[CreateAssistantDtoModel] + These are the options for the assistant's LLM. + + voice : typing.Optional[CreateAssistantDtoVoice] + These are the options for the assistant's voice. + + first_message_mode : typing.Optional[CreateAssistantDtoFirstMessageMode] + This is the mode for the first message. Default is 'assistant-speaks-first'. + + Use: + + - 'assistant-speaks-first' to have the assistant speak first. + - 'assistant-waits-for-user' to have the assistant wait for the user to speak first. + - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + + @default 'assistant-speaks-first' + + hipaa_enabled : typing.Optional[bool] + When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + + client_messages : typing.Optional[typing.Sequence[CreateAssistantDtoClientMessagesItem]] + These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + + server_messages : typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]] + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. + + silence_timeout_seconds : typing.Optional[float] + How many seconds of silence to wait before ending the call. Defaults to 30. + + @default 30 + + max_duration_seconds : typing.Optional[float] + This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + + @default 600 (10 minutes) + + background_sound : typing.Optional[CreateAssistantDtoBackgroundSound] + This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + + backchanneling_enabled : typing.Optional[bool] + This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. + + Default `false` while in beta. + + @default false + + background_denoising_enabled : typing.Optional[bool] + This enables filtering of noise and background speech while the user is talking. + + Default `false` while in beta. + + @default false + + model_output_in_messages_enabled : typing.Optional[bool] + This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + + Default `false` while in beta. + + @default false + + transport_configurations : typing.Optional[typing.Sequence[TransportConfigurationTwilio]] + These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + + name : typing.Optional[str] + This is the name of the assistant. + + This is required when you want to transfer between assistants in a call. + + first_message : typing.Optional[str] + This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + + If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + + voicemail_detection : typing.Optional[TwilioVoicemailDetection] + These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. + You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + + voicemail_message : typing.Optional[str] + This is the message that the assistant will say if the call is forwarded to voicemail. + + If unspecified, it will hang up. + + end_call_message : typing.Optional[str] + This is the message that the assistant will say if it ends the call. + + If unspecified, it will hang up without saying anything. + + end_call_phrases : typing.Optional[typing.Sequence[str]] + This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + + metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] + This is for metadata you want to store on the assistant. + + server_url : typing.Optional[str] + This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + + All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl + + server_url_secret : typing.Optional[str] + This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + + analysis_plan : typing.Optional[AnalysisPlan] + This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + + artifact_plan : typing.Optional[ArtifactPlan] + This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + + Note: `recordingEnabled` is currently at the root level. It will be moved to `artifactPlan` in the future, but will remain backwards compatible. + + message_plan : typing.Optional[MessagePlan] + This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. + + Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. + + start_speaking_plan : typing.Optional[StartSpeakingPlan] + This is the plan for when the assistant should start talking. + + You should configure this if you're running into these issues: + + - The assistant is too slow to start talking after the customer is done speaking. + - The assistant is too fast to start talking after the customer is done speaking. + - The assistant is so fast that it's actually interrupting the customer. + + stop_speaking_plan : typing.Optional[StopSpeakingPlan] + This is the plan for when assistant should stop talking on customer interruption. + + You should configure this if you're running into these issues: + + - The assistant is too slow to recognize customer's interruption. + - The assistant is too fast to recognize customer's interruption. + - The assistant is getting interrupted by phrases that are just acknowledgments. + - The assistant is getting interrupted by background noises. + - The assistant is not properly stopping -- it starts talking right after getting interrupted. + + monitor_plan : typing.Optional[MonitorPlan] + This is the plan for real-time monitoring of the assistant's calls. + + Usage: + + - To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. + - To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + + Note, `serverMessages`, `clientMessages`, `serverUrl` and `serverUrlSecret` are currently at the root level but will be moved to `monitorPlan` in the future. Will remain backwards compatible + + credential_ids : typing.Optional[typing.Sequence[str]] + These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Assistant + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.assistants.create() + """ + _response = self._client_wrapper.httpx_client.request( + "assistant", + method="POST", + json={ + "transcriber": convert_and_respect_annotation_metadata( + object_=transcriber, annotation=CreateAssistantDtoTranscriber, direction="write" + ), + "model": convert_and_respect_annotation_metadata( + object_=model, annotation=CreateAssistantDtoModel, direction="write" + ), + "voice": convert_and_respect_annotation_metadata( + object_=voice, annotation=CreateAssistantDtoVoice, direction="write" + ), + "firstMessageMode": first_message_mode, + "hipaaEnabled": hipaa_enabled, + "clientMessages": client_messages, + "serverMessages": server_messages, + "silenceTimeoutSeconds": silence_timeout_seconds, + "maxDurationSeconds": max_duration_seconds, + "backgroundSound": background_sound, + "backchannelingEnabled": backchanneling_enabled, + "backgroundDenoisingEnabled": background_denoising_enabled, + "modelOutputInMessagesEnabled": model_output_in_messages_enabled, + "transportConfigurations": convert_and_respect_annotation_metadata( + object_=transport_configurations, + annotation=typing.Sequence[TransportConfigurationTwilio], + direction="write", + ), + "name": name, + "firstMessage": first_message, + "voicemailDetection": convert_and_respect_annotation_metadata( + object_=voicemail_detection, annotation=TwilioVoicemailDetection, direction="write" + ), + "voicemailMessage": voicemail_message, + "endCallMessage": end_call_message, + "endCallPhrases": end_call_phrases, + "metadata": metadata, + "serverUrl": server_url, + "serverUrlSecret": server_url_secret, + "analysisPlan": convert_and_respect_annotation_metadata( + object_=analysis_plan, annotation=AnalysisPlan, direction="write" + ), + "artifactPlan": convert_and_respect_annotation_metadata( + object_=artifact_plan, annotation=ArtifactPlan, direction="write" + ), + "messagePlan": convert_and_respect_annotation_metadata( + object_=message_plan, annotation=MessagePlan, direction="write" + ), + "startSpeakingPlan": convert_and_respect_annotation_metadata( + object_=start_speaking_plan, annotation=StartSpeakingPlan, direction="write" + ), + "stopSpeakingPlan": convert_and_respect_annotation_metadata( + object_=stop_speaking_plan, annotation=StopSpeakingPlan, direction="write" + ), + "monitorPlan": convert_and_respect_annotation_metadata( + object_=monitor_plan, annotation=MonitorPlan, direction="write" + ), + "credentialIds": credential_ids, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Assistant, + parse_obj_as( + type_=Assistant, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Assistant: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Assistant + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.assistants.get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"assistant/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Assistant, + parse_obj_as( + type_=Assistant, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Assistant: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Assistant + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.assistants.delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"assistant/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Assistant, + parse_obj_as( + type_=Assistant, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def update( + self, + id: str, + *, + transcriber: typing.Optional[UpdateAssistantDtoTranscriber] = OMIT, + model: typing.Optional[UpdateAssistantDtoModel] = OMIT, + voice: typing.Optional[UpdateAssistantDtoVoice] = OMIT, + first_message_mode: typing.Optional[UpdateAssistantDtoFirstMessageMode] = OMIT, + hipaa_enabled: typing.Optional[bool] = OMIT, + client_messages: typing.Optional[typing.Sequence[UpdateAssistantDtoClientMessagesItem]] = OMIT, + server_messages: typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]] = OMIT, + silence_timeout_seconds: typing.Optional[float] = OMIT, + max_duration_seconds: typing.Optional[float] = OMIT, + background_sound: typing.Optional[UpdateAssistantDtoBackgroundSound] = OMIT, + backchanneling_enabled: typing.Optional[bool] = OMIT, + background_denoising_enabled: typing.Optional[bool] = OMIT, + model_output_in_messages_enabled: typing.Optional[bool] = OMIT, + transport_configurations: typing.Optional[typing.Sequence[TransportConfigurationTwilio]] = OMIT, + name: typing.Optional[str] = OMIT, + first_message: typing.Optional[str] = OMIT, + voicemail_detection: typing.Optional[TwilioVoicemailDetection] = OMIT, + voicemail_message: typing.Optional[str] = OMIT, + end_call_message: typing.Optional[str] = OMIT, + end_call_phrases: typing.Optional[typing.Sequence[str]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + server_url: typing.Optional[str] = OMIT, + server_url_secret: typing.Optional[str] = OMIT, + analysis_plan: typing.Optional[AnalysisPlan] = OMIT, + artifact_plan: typing.Optional[ArtifactPlan] = OMIT, + message_plan: typing.Optional[MessagePlan] = OMIT, + start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, + stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, + monitor_plan: typing.Optional[MonitorPlan] = OMIT, + credential_ids: typing.Optional[typing.Sequence[str]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> Assistant: + """ + Parameters + ---------- + id : str + + transcriber : typing.Optional[UpdateAssistantDtoTranscriber] + These are the options for the assistant's transcriber. + + model : typing.Optional[UpdateAssistantDtoModel] + These are the options for the assistant's LLM. + + voice : typing.Optional[UpdateAssistantDtoVoice] + These are the options for the assistant's voice. + + first_message_mode : typing.Optional[UpdateAssistantDtoFirstMessageMode] + This is the mode for the first message. Default is 'assistant-speaks-first'. + + Use: + - 'assistant-speaks-first' to have the assistant speak first. + - 'assistant-waits-for-user' to have the assistant wait for the user to speak first. + - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + + @default 'assistant-speaks-first' + + hipaa_enabled : typing.Optional[bool] + When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + + client_messages : typing.Optional[typing.Sequence[UpdateAssistantDtoClientMessagesItem]] + These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + + server_messages : typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]] + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. + + silence_timeout_seconds : typing.Optional[float] + How many seconds of silence to wait before ending the call. Defaults to 30. + + @default 30 + + max_duration_seconds : typing.Optional[float] + This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + + @default 600 (10 minutes) + + background_sound : typing.Optional[UpdateAssistantDtoBackgroundSound] + This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + + backchanneling_enabled : typing.Optional[bool] + This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. + + Default `false` while in beta. + + @default false + + background_denoising_enabled : typing.Optional[bool] + This enables filtering of noise and background speech while the user is talking. + + Default `false` while in beta. + + @default false + + model_output_in_messages_enabled : typing.Optional[bool] + This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + + Default `false` while in beta. + + @default false + + transport_configurations : typing.Optional[typing.Sequence[TransportConfigurationTwilio]] + These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + + name : typing.Optional[str] + This is the name of the assistant. + + This is required when you want to transfer between assistants in a call. + + first_message : typing.Optional[str] + This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + + If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + + voicemail_detection : typing.Optional[TwilioVoicemailDetection] + These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. + You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + + voicemail_message : typing.Optional[str] + This is the message that the assistant will say if the call is forwarded to voicemail. + + If unspecified, it will hang up. + + end_call_message : typing.Optional[str] + This is the message that the assistant will say if it ends the call. + + If unspecified, it will hang up without saying anything. + + end_call_phrases : typing.Optional[typing.Sequence[str]] + This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + + metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] + This is for metadata you want to store on the assistant. + + server_url : typing.Optional[str] + This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + + All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl + + server_url_secret : typing.Optional[str] + This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + + analysis_plan : typing.Optional[AnalysisPlan] + This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + + artifact_plan : typing.Optional[ArtifactPlan] + This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + + Note: `recordingEnabled` is currently at the root level. It will be moved to `artifactPlan` in the future, but will remain backwards compatible. + + message_plan : typing.Optional[MessagePlan] + This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. + + Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. + + start_speaking_plan : typing.Optional[StartSpeakingPlan] + This is the plan for when the assistant should start talking. + + You should configure this if you're running into these issues: + - The assistant is too slow to start talking after the customer is done speaking. + - The assistant is too fast to start talking after the customer is done speaking. + - The assistant is so fast that it's actually interrupting the customer. + + stop_speaking_plan : typing.Optional[StopSpeakingPlan] + This is the plan for when assistant should stop talking on customer interruption. + + You should configure this if you're running into these issues: + - The assistant is too slow to recognize customer's interruption. + - The assistant is too fast to recognize customer's interruption. + - The assistant is getting interrupted by phrases that are just acknowledgments. + - The assistant is getting interrupted by background noises. + - The assistant is not properly stopping -- it starts talking right after getting interrupted. + + monitor_plan : typing.Optional[MonitorPlan] + This is the plan for real-time monitoring of the assistant's calls. + + Usage: + - To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. + - To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + + Note, `serverMessages`, `clientMessages`, `serverUrl` and `serverUrlSecret` are currently at the root level but will be moved to `monitorPlan` in the future. Will remain backwards compatible + + credential_ids : typing.Optional[typing.Sequence[str]] + These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Assistant + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.assistants.update( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"assistant/{jsonable_encoder(id)}", + method="PATCH", + json={ + "transcriber": convert_and_respect_annotation_metadata( + object_=transcriber, annotation=UpdateAssistantDtoTranscriber, direction="write" + ), + "model": convert_and_respect_annotation_metadata( + object_=model, annotation=UpdateAssistantDtoModel, direction="write" + ), + "voice": convert_and_respect_annotation_metadata( + object_=voice, annotation=UpdateAssistantDtoVoice, direction="write" + ), + "firstMessageMode": first_message_mode, + "hipaaEnabled": hipaa_enabled, + "clientMessages": client_messages, + "serverMessages": server_messages, + "silenceTimeoutSeconds": silence_timeout_seconds, + "maxDurationSeconds": max_duration_seconds, + "backgroundSound": background_sound, + "backchannelingEnabled": backchanneling_enabled, + "backgroundDenoisingEnabled": background_denoising_enabled, + "modelOutputInMessagesEnabled": model_output_in_messages_enabled, + "transportConfigurations": convert_and_respect_annotation_metadata( + object_=transport_configurations, + annotation=typing.Sequence[TransportConfigurationTwilio], + direction="write", + ), + "name": name, + "firstMessage": first_message, + "voicemailDetection": convert_and_respect_annotation_metadata( + object_=voicemail_detection, annotation=TwilioVoicemailDetection, direction="write" + ), + "voicemailMessage": voicemail_message, + "endCallMessage": end_call_message, + "endCallPhrases": end_call_phrases, + "metadata": metadata, + "serverUrl": server_url, + "serverUrlSecret": server_url_secret, + "analysisPlan": convert_and_respect_annotation_metadata( + object_=analysis_plan, annotation=AnalysisPlan, direction="write" + ), + "artifactPlan": convert_and_respect_annotation_metadata( + object_=artifact_plan, annotation=ArtifactPlan, direction="write" + ), + "messagePlan": convert_and_respect_annotation_metadata( + object_=message_plan, annotation=MessagePlan, direction="write" + ), + "startSpeakingPlan": convert_and_respect_annotation_metadata( + object_=start_speaking_plan, annotation=StartSpeakingPlan, direction="write" + ), + "stopSpeakingPlan": convert_and_respect_annotation_metadata( + object_=stop_speaking_plan, annotation=StopSpeakingPlan, direction="write" + ), + "monitorPlan": convert_and_respect_annotation_metadata( + object_=monitor_plan, annotation=MonitorPlan, direction="write" + ), + "credentialIds": credential_ids, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Assistant, + parse_obj_as( + type_=Assistant, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncAssistantsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[Assistant]: + """ + Parameters + ---------- + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[Assistant] + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.assistants.list() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "assistant", + method="GET", + params={ + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[Assistant], + parse_obj_as( + type_=typing.List[Assistant], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def create( + self, + *, + transcriber: typing.Optional[CreateAssistantDtoTranscriber] = OMIT, + model: typing.Optional[CreateAssistantDtoModel] = OMIT, + voice: typing.Optional[CreateAssistantDtoVoice] = OMIT, + first_message_mode: typing.Optional[CreateAssistantDtoFirstMessageMode] = OMIT, + hipaa_enabled: typing.Optional[bool] = OMIT, + client_messages: typing.Optional[typing.Sequence[CreateAssistantDtoClientMessagesItem]] = OMIT, + server_messages: typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]] = OMIT, + silence_timeout_seconds: typing.Optional[float] = OMIT, + max_duration_seconds: typing.Optional[float] = OMIT, + background_sound: typing.Optional[CreateAssistantDtoBackgroundSound] = OMIT, + backchanneling_enabled: typing.Optional[bool] = OMIT, + background_denoising_enabled: typing.Optional[bool] = OMIT, + model_output_in_messages_enabled: typing.Optional[bool] = OMIT, + transport_configurations: typing.Optional[typing.Sequence[TransportConfigurationTwilio]] = OMIT, + name: typing.Optional[str] = OMIT, + first_message: typing.Optional[str] = OMIT, + voicemail_detection: typing.Optional[TwilioVoicemailDetection] = OMIT, + voicemail_message: typing.Optional[str] = OMIT, + end_call_message: typing.Optional[str] = OMIT, + end_call_phrases: typing.Optional[typing.Sequence[str]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + server_url: typing.Optional[str] = OMIT, + server_url_secret: typing.Optional[str] = OMIT, + analysis_plan: typing.Optional[AnalysisPlan] = OMIT, + artifact_plan: typing.Optional[ArtifactPlan] = OMIT, + message_plan: typing.Optional[MessagePlan] = OMIT, + start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, + stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, + monitor_plan: typing.Optional[MonitorPlan] = OMIT, + credential_ids: typing.Optional[typing.Sequence[str]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> Assistant: + """ + Parameters + ---------- + transcriber : typing.Optional[CreateAssistantDtoTranscriber] + These are the options for the assistant's transcriber. + + model : typing.Optional[CreateAssistantDtoModel] + These are the options for the assistant's LLM. + + voice : typing.Optional[CreateAssistantDtoVoice] + These are the options for the assistant's voice. + + first_message_mode : typing.Optional[CreateAssistantDtoFirstMessageMode] + This is the mode for the first message. Default is 'assistant-speaks-first'. + + Use: + + - 'assistant-speaks-first' to have the assistant speak first. + - 'assistant-waits-for-user' to have the assistant wait for the user to speak first. + - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + + @default 'assistant-speaks-first' + + hipaa_enabled : typing.Optional[bool] + When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + + client_messages : typing.Optional[typing.Sequence[CreateAssistantDtoClientMessagesItem]] + These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + + server_messages : typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]] + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. + + silence_timeout_seconds : typing.Optional[float] + How many seconds of silence to wait before ending the call. Defaults to 30. + + @default 30 + + max_duration_seconds : typing.Optional[float] + This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + + @default 600 (10 minutes) + + background_sound : typing.Optional[CreateAssistantDtoBackgroundSound] + This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + + backchanneling_enabled : typing.Optional[bool] + This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. + + Default `false` while in beta. + + @default false + + background_denoising_enabled : typing.Optional[bool] + This enables filtering of noise and background speech while the user is talking. + + Default `false` while in beta. + + @default false + + model_output_in_messages_enabled : typing.Optional[bool] + This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + + Default `false` while in beta. + + @default false + + transport_configurations : typing.Optional[typing.Sequence[TransportConfigurationTwilio]] + These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + + name : typing.Optional[str] + This is the name of the assistant. + + This is required when you want to transfer between assistants in a call. + + first_message : typing.Optional[str] + This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + + If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + + voicemail_detection : typing.Optional[TwilioVoicemailDetection] + These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. + You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + + voicemail_message : typing.Optional[str] + This is the message that the assistant will say if the call is forwarded to voicemail. + + If unspecified, it will hang up. + + end_call_message : typing.Optional[str] + This is the message that the assistant will say if it ends the call. + + If unspecified, it will hang up without saying anything. + + end_call_phrases : typing.Optional[typing.Sequence[str]] + This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + + metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] + This is for metadata you want to store on the assistant. + + server_url : typing.Optional[str] + This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + + All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl + + server_url_secret : typing.Optional[str] + This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + + analysis_plan : typing.Optional[AnalysisPlan] + This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + + artifact_plan : typing.Optional[ArtifactPlan] + This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + + Note: `recordingEnabled` is currently at the root level. It will be moved to `artifactPlan` in the future, but will remain backwards compatible. + + message_plan : typing.Optional[MessagePlan] + This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. + + Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. + + start_speaking_plan : typing.Optional[StartSpeakingPlan] + This is the plan for when the assistant should start talking. + + You should configure this if you're running into these issues: + + - The assistant is too slow to start talking after the customer is done speaking. + - The assistant is too fast to start talking after the customer is done speaking. + - The assistant is so fast that it's actually interrupting the customer. + + stop_speaking_plan : typing.Optional[StopSpeakingPlan] + This is the plan for when assistant should stop talking on customer interruption. + + You should configure this if you're running into these issues: + + - The assistant is too slow to recognize customer's interruption. + - The assistant is too fast to recognize customer's interruption. + - The assistant is getting interrupted by phrases that are just acknowledgments. + - The assistant is getting interrupted by background noises. + - The assistant is not properly stopping -- it starts talking right after getting interrupted. + + monitor_plan : typing.Optional[MonitorPlan] + This is the plan for real-time monitoring of the assistant's calls. + + Usage: + + - To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. + - To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + + Note, `serverMessages`, `clientMessages`, `serverUrl` and `serverUrlSecret` are currently at the root level but will be moved to `monitorPlan` in the future. Will remain backwards compatible + + credential_ids : typing.Optional[typing.Sequence[str]] + These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Assistant + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.assistants.create() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "assistant", + method="POST", + json={ + "transcriber": convert_and_respect_annotation_metadata( + object_=transcriber, annotation=CreateAssistantDtoTranscriber, direction="write" + ), + "model": convert_and_respect_annotation_metadata( + object_=model, annotation=CreateAssistantDtoModel, direction="write" + ), + "voice": convert_and_respect_annotation_metadata( + object_=voice, annotation=CreateAssistantDtoVoice, direction="write" + ), + "firstMessageMode": first_message_mode, + "hipaaEnabled": hipaa_enabled, + "clientMessages": client_messages, + "serverMessages": server_messages, + "silenceTimeoutSeconds": silence_timeout_seconds, + "maxDurationSeconds": max_duration_seconds, + "backgroundSound": background_sound, + "backchannelingEnabled": backchanneling_enabled, + "backgroundDenoisingEnabled": background_denoising_enabled, + "modelOutputInMessagesEnabled": model_output_in_messages_enabled, + "transportConfigurations": convert_and_respect_annotation_metadata( + object_=transport_configurations, + annotation=typing.Sequence[TransportConfigurationTwilio], + direction="write", + ), + "name": name, + "firstMessage": first_message, + "voicemailDetection": convert_and_respect_annotation_metadata( + object_=voicemail_detection, annotation=TwilioVoicemailDetection, direction="write" + ), + "voicemailMessage": voicemail_message, + "endCallMessage": end_call_message, + "endCallPhrases": end_call_phrases, + "metadata": metadata, + "serverUrl": server_url, + "serverUrlSecret": server_url_secret, + "analysisPlan": convert_and_respect_annotation_metadata( + object_=analysis_plan, annotation=AnalysisPlan, direction="write" + ), + "artifactPlan": convert_and_respect_annotation_metadata( + object_=artifact_plan, annotation=ArtifactPlan, direction="write" + ), + "messagePlan": convert_and_respect_annotation_metadata( + object_=message_plan, annotation=MessagePlan, direction="write" + ), + "startSpeakingPlan": convert_and_respect_annotation_metadata( + object_=start_speaking_plan, annotation=StartSpeakingPlan, direction="write" + ), + "stopSpeakingPlan": convert_and_respect_annotation_metadata( + object_=stop_speaking_plan, annotation=StopSpeakingPlan, direction="write" + ), + "monitorPlan": convert_and_respect_annotation_metadata( + object_=monitor_plan, annotation=MonitorPlan, direction="write" + ), + "credentialIds": credential_ids, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Assistant, + parse_obj_as( + type_=Assistant, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Assistant: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Assistant + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.assistants.get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"assistant/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Assistant, + parse_obj_as( + type_=Assistant, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Assistant: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Assistant + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.assistants.delete( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"assistant/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Assistant, + parse_obj_as( + type_=Assistant, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def update( + self, + id: str, + *, + transcriber: typing.Optional[UpdateAssistantDtoTranscriber] = OMIT, + model: typing.Optional[UpdateAssistantDtoModel] = OMIT, + voice: typing.Optional[UpdateAssistantDtoVoice] = OMIT, + first_message_mode: typing.Optional[UpdateAssistantDtoFirstMessageMode] = OMIT, + hipaa_enabled: typing.Optional[bool] = OMIT, + client_messages: typing.Optional[typing.Sequence[UpdateAssistantDtoClientMessagesItem]] = OMIT, + server_messages: typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]] = OMIT, + silence_timeout_seconds: typing.Optional[float] = OMIT, + max_duration_seconds: typing.Optional[float] = OMIT, + background_sound: typing.Optional[UpdateAssistantDtoBackgroundSound] = OMIT, + backchanneling_enabled: typing.Optional[bool] = OMIT, + background_denoising_enabled: typing.Optional[bool] = OMIT, + model_output_in_messages_enabled: typing.Optional[bool] = OMIT, + transport_configurations: typing.Optional[typing.Sequence[TransportConfigurationTwilio]] = OMIT, + name: typing.Optional[str] = OMIT, + first_message: typing.Optional[str] = OMIT, + voicemail_detection: typing.Optional[TwilioVoicemailDetection] = OMIT, + voicemail_message: typing.Optional[str] = OMIT, + end_call_message: typing.Optional[str] = OMIT, + end_call_phrases: typing.Optional[typing.Sequence[str]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + server_url: typing.Optional[str] = OMIT, + server_url_secret: typing.Optional[str] = OMIT, + analysis_plan: typing.Optional[AnalysisPlan] = OMIT, + artifact_plan: typing.Optional[ArtifactPlan] = OMIT, + message_plan: typing.Optional[MessagePlan] = OMIT, + start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, + stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, + monitor_plan: typing.Optional[MonitorPlan] = OMIT, + credential_ids: typing.Optional[typing.Sequence[str]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> Assistant: + """ + Parameters + ---------- + id : str + + transcriber : typing.Optional[UpdateAssistantDtoTranscriber] + These are the options for the assistant's transcriber. + + model : typing.Optional[UpdateAssistantDtoModel] + These are the options for the assistant's LLM. + + voice : typing.Optional[UpdateAssistantDtoVoice] + These are the options for the assistant's voice. + + first_message_mode : typing.Optional[UpdateAssistantDtoFirstMessageMode] + This is the mode for the first message. Default is 'assistant-speaks-first'. + + Use: + - 'assistant-speaks-first' to have the assistant speak first. + - 'assistant-waits-for-user' to have the assistant wait for the user to speak first. + - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + + @default 'assistant-speaks-first' + + hipaa_enabled : typing.Optional[bool] + When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + + client_messages : typing.Optional[typing.Sequence[UpdateAssistantDtoClientMessagesItem]] + These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + + server_messages : typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]] + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. + + silence_timeout_seconds : typing.Optional[float] + How many seconds of silence to wait before ending the call. Defaults to 30. + + @default 30 + + max_duration_seconds : typing.Optional[float] + This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + + @default 600 (10 minutes) + + background_sound : typing.Optional[UpdateAssistantDtoBackgroundSound] + This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + + backchanneling_enabled : typing.Optional[bool] + This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. + + Default `false` while in beta. + + @default false + + background_denoising_enabled : typing.Optional[bool] + This enables filtering of noise and background speech while the user is talking. + + Default `false` while in beta. + + @default false + + model_output_in_messages_enabled : typing.Optional[bool] + This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + + Default `false` while in beta. + + @default false + + transport_configurations : typing.Optional[typing.Sequence[TransportConfigurationTwilio]] + These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + + name : typing.Optional[str] + This is the name of the assistant. + + This is required when you want to transfer between assistants in a call. + + first_message : typing.Optional[str] + This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + + If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + + voicemail_detection : typing.Optional[TwilioVoicemailDetection] + These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. + You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + + voicemail_message : typing.Optional[str] + This is the message that the assistant will say if the call is forwarded to voicemail. + + If unspecified, it will hang up. + + end_call_message : typing.Optional[str] + This is the message that the assistant will say if it ends the call. + + If unspecified, it will hang up without saying anything. + + end_call_phrases : typing.Optional[typing.Sequence[str]] + This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + + metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] + This is for metadata you want to store on the assistant. + + server_url : typing.Optional[str] + This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + + All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl + + server_url_secret : typing.Optional[str] + This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + + analysis_plan : typing.Optional[AnalysisPlan] + This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + + artifact_plan : typing.Optional[ArtifactPlan] + This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + + Note: `recordingEnabled` is currently at the root level. It will be moved to `artifactPlan` in the future, but will remain backwards compatible. + + message_plan : typing.Optional[MessagePlan] + This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. + + Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. + + start_speaking_plan : typing.Optional[StartSpeakingPlan] + This is the plan for when the assistant should start talking. + + You should configure this if you're running into these issues: + - The assistant is too slow to start talking after the customer is done speaking. + - The assistant is too fast to start talking after the customer is done speaking. + - The assistant is so fast that it's actually interrupting the customer. + + stop_speaking_plan : typing.Optional[StopSpeakingPlan] + This is the plan for when assistant should stop talking on customer interruption. + + You should configure this if you're running into these issues: + - The assistant is too slow to recognize customer's interruption. + - The assistant is too fast to recognize customer's interruption. + - The assistant is getting interrupted by phrases that are just acknowledgments. + - The assistant is getting interrupted by background noises. + - The assistant is not properly stopping -- it starts talking right after getting interrupted. + + monitor_plan : typing.Optional[MonitorPlan] + This is the plan for real-time monitoring of the assistant's calls. + + Usage: + - To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. + - To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + + Note, `serverMessages`, `clientMessages`, `serverUrl` and `serverUrlSecret` are currently at the root level but will be moved to `monitorPlan` in the future. Will remain backwards compatible + + credential_ids : typing.Optional[typing.Sequence[str]] + These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Assistant + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.assistants.update( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"assistant/{jsonable_encoder(id)}", + method="PATCH", + json={ + "transcriber": convert_and_respect_annotation_metadata( + object_=transcriber, annotation=UpdateAssistantDtoTranscriber, direction="write" + ), + "model": convert_and_respect_annotation_metadata( + object_=model, annotation=UpdateAssistantDtoModel, direction="write" + ), + "voice": convert_and_respect_annotation_metadata( + object_=voice, annotation=UpdateAssistantDtoVoice, direction="write" + ), + "firstMessageMode": first_message_mode, + "hipaaEnabled": hipaa_enabled, + "clientMessages": client_messages, + "serverMessages": server_messages, + "silenceTimeoutSeconds": silence_timeout_seconds, + "maxDurationSeconds": max_duration_seconds, + "backgroundSound": background_sound, + "backchannelingEnabled": backchanneling_enabled, + "backgroundDenoisingEnabled": background_denoising_enabled, + "modelOutputInMessagesEnabled": model_output_in_messages_enabled, + "transportConfigurations": convert_and_respect_annotation_metadata( + object_=transport_configurations, + annotation=typing.Sequence[TransportConfigurationTwilio], + direction="write", + ), + "name": name, + "firstMessage": first_message, + "voicemailDetection": convert_and_respect_annotation_metadata( + object_=voicemail_detection, annotation=TwilioVoicemailDetection, direction="write" + ), + "voicemailMessage": voicemail_message, + "endCallMessage": end_call_message, + "endCallPhrases": end_call_phrases, + "metadata": metadata, + "serverUrl": server_url, + "serverUrlSecret": server_url_secret, + "analysisPlan": convert_and_respect_annotation_metadata( + object_=analysis_plan, annotation=AnalysisPlan, direction="write" + ), + "artifactPlan": convert_and_respect_annotation_metadata( + object_=artifact_plan, annotation=ArtifactPlan, direction="write" + ), + "messagePlan": convert_and_respect_annotation_metadata( + object_=message_plan, annotation=MessagePlan, direction="write" + ), + "startSpeakingPlan": convert_and_respect_annotation_metadata( + object_=start_speaking_plan, annotation=StartSpeakingPlan, direction="write" + ), + "stopSpeakingPlan": convert_and_respect_annotation_metadata( + object_=stop_speaking_plan, annotation=StopSpeakingPlan, direction="write" + ), + "monitorPlan": convert_and_respect_annotation_metadata( + object_=monitor_plan, annotation=MonitorPlan, direction="write" + ), + "credentialIds": credential_ids, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Assistant, + parse_obj_as( + type_=Assistant, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/vapi/assistants/types/__init__.py b/src/vapi/assistants/types/__init__.py new file mode 100644 index 0000000..bbb3617 --- /dev/null +++ b/src/vapi/assistants/types/__init__.py @@ -0,0 +1,69 @@ +# This file was auto-generated by Fern from our API Definition. + +from .update_assistant_dto_background_sound import UpdateAssistantDtoBackgroundSound +from .update_assistant_dto_client_messages_item import UpdateAssistantDtoClientMessagesItem +from .update_assistant_dto_first_message_mode import UpdateAssistantDtoFirstMessageMode +from .update_assistant_dto_model import ( + UpdateAssistantDtoModel, + UpdateAssistantDtoModel_Anthropic, + UpdateAssistantDtoModel_Anyscale, + UpdateAssistantDtoModel_CustomLlm, + UpdateAssistantDtoModel_Deepinfra, + UpdateAssistantDtoModel_Groq, + UpdateAssistantDtoModel_Openai, + UpdateAssistantDtoModel_Openrouter, + UpdateAssistantDtoModel_PerplexityAi, + UpdateAssistantDtoModel_TogetherAi, + UpdateAssistantDtoModel_Vapi, +) +from .update_assistant_dto_server_messages_item import UpdateAssistantDtoServerMessagesItem +from .update_assistant_dto_transcriber import ( + UpdateAssistantDtoTranscriber, + UpdateAssistantDtoTranscriber_Deepgram, + UpdateAssistantDtoTranscriber_Gladia, + UpdateAssistantDtoTranscriber_Talkscriber, +) +from .update_assistant_dto_voice import ( + UpdateAssistantDtoVoice, + UpdateAssistantDtoVoice_11Labs, + UpdateAssistantDtoVoice_Azure, + UpdateAssistantDtoVoice_Cartesia, + UpdateAssistantDtoVoice_Deepgram, + UpdateAssistantDtoVoice_Lmnt, + UpdateAssistantDtoVoice_Neets, + UpdateAssistantDtoVoice_Openai, + UpdateAssistantDtoVoice_Playht, + UpdateAssistantDtoVoice_RimeAi, +) + +__all__ = [ + "UpdateAssistantDtoBackgroundSound", + "UpdateAssistantDtoClientMessagesItem", + "UpdateAssistantDtoFirstMessageMode", + "UpdateAssistantDtoModel", + "UpdateAssistantDtoModel_Anthropic", + "UpdateAssistantDtoModel_Anyscale", + "UpdateAssistantDtoModel_CustomLlm", + "UpdateAssistantDtoModel_Deepinfra", + "UpdateAssistantDtoModel_Groq", + "UpdateAssistantDtoModel_Openai", + "UpdateAssistantDtoModel_Openrouter", + "UpdateAssistantDtoModel_PerplexityAi", + "UpdateAssistantDtoModel_TogetherAi", + "UpdateAssistantDtoModel_Vapi", + "UpdateAssistantDtoServerMessagesItem", + "UpdateAssistantDtoTranscriber", + "UpdateAssistantDtoTranscriber_Deepgram", + "UpdateAssistantDtoTranscriber_Gladia", + "UpdateAssistantDtoTranscriber_Talkscriber", + "UpdateAssistantDtoVoice", + "UpdateAssistantDtoVoice_11Labs", + "UpdateAssistantDtoVoice_Azure", + "UpdateAssistantDtoVoice_Cartesia", + "UpdateAssistantDtoVoice_Deepgram", + "UpdateAssistantDtoVoice_Lmnt", + "UpdateAssistantDtoVoice_Neets", + "UpdateAssistantDtoVoice_Openai", + "UpdateAssistantDtoVoice_Playht", + "UpdateAssistantDtoVoice_RimeAi", +] diff --git a/src/vapi/assistants/types/update_assistant_dto_background_sound.py b/src/vapi/assistants/types/update_assistant_dto_background_sound.py new file mode 100644 index 0000000..77833dc --- /dev/null +++ b/src/vapi/assistants/types/update_assistant_dto_background_sound.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateAssistantDtoBackgroundSound = typing.Union[typing.Literal["off", "office"], typing.Any] diff --git a/src/vapi/assistants/types/update_assistant_dto_client_messages_item.py b/src/vapi/assistants/types/update_assistant_dto_client_messages_item.py new file mode 100644 index 0000000..543bf4d --- /dev/null +++ b/src/vapi/assistants/types/update_assistant_dto_client_messages_item.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateAssistantDtoClientMessagesItem = typing.Union[ + typing.Literal[ + "conversation-update", + "function-call", + "function-call-result", + "hang", + "language-changed", + "metadata", + "model-output", + "speech-update", + "status-update", + "transcript", + "tool-calls", + "tool-calls-result", + "user-interrupted", + "voice-input", + ], + typing.Any, +] diff --git a/src/vapi/assistants/types/update_assistant_dto_first_message_mode.py b/src/vapi/assistants/types/update_assistant_dto_first_message_mode.py new file mode 100644 index 0000000..dde8c6a --- /dev/null +++ b/src/vapi/assistants/types/update_assistant_dto_first_message_mode.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateAssistantDtoFirstMessageMode = typing.Union[ + typing.Literal[ + "assistant-speaks-first", "assistant-speaks-first-with-model-generated-message", "assistant-waits-for-user" + ], + typing.Any, +] diff --git a/src/vapi/assistants/types/update_assistant_dto_model.py b/src/vapi/assistants/types/update_assistant_dto_model.py new file mode 100644 index 0000000..87b2284 --- /dev/null +++ b/src/vapi/assistants/types/update_assistant_dto_model.py @@ -0,0 +1,359 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +from ...types.open_ai_message import OpenAiMessage +from ...types.anyscale_model_tools_item import AnyscaleModelToolsItem +import typing_extensions +from ...core.serialization import FieldMetadata +from ...types.knowledge_base import KnowledgeBase +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.anthropic_model_tools_item import AnthropicModelToolsItem +from ...types.anthropic_model_model import AnthropicModelModel +from ...types.custom_llm_model_tools_item import CustomLlmModelToolsItem +from ...types.custom_llm_model_metadata_send_mode import CustomLlmModelMetadataSendMode +from ...types.deep_infra_model_tools_item import DeepInfraModelToolsItem +from ...types.groq_model_tools_item import GroqModelToolsItem +from ...types.groq_model_model import GroqModelModel +from ...types.open_ai_model_tools_item import OpenAiModelToolsItem +from ...types.open_ai_model_model import OpenAiModelModel +from ...types.open_ai_model_fallback_models_item import OpenAiModelFallbackModelsItem +from ...types.open_router_model_tools_item import OpenRouterModelToolsItem +from ...types.perplexity_ai_model_tools_item import PerplexityAiModelToolsItem +from ...types.together_ai_model_tools_item import TogetherAiModelToolsItem +from ...types.callback_step import CallbackStep +from ...types.create_workflow_block_dto import CreateWorkflowBlockDto +from ...types.handoff_step import HandoffStep +from ...types.vapi_model_tools_item import VapiModelToolsItem +from ...types.vapi_model_steps_item import VapiModelStepsItem +from ...core.pydantic_utilities import update_forward_refs + + +class UpdateAssistantDtoModel_Anyscale(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["anyscale"] = "anyscale" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[AnyscaleModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoModel_Anthropic(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["anthropic"] = "anthropic" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[AnthropicModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: AnthropicModelModel + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoModel_CustomLlm(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["custom-llm"] = "custom-llm" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[CustomLlmModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + metadata_send_mode: typing_extensions.Annotated[ + typing.Optional[CustomLlmModelMetadataSendMode], FieldMetadata(alias="metadataSendMode") + ] = None + url: str + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoModel_Deepinfra(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["deepinfra"] = "deepinfra" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[DeepInfraModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoModel_Groq(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["groq"] = "groq" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[GroqModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: GroqModelModel + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoModel_Openai(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["openai"] = "openai" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[OpenAiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: OpenAiModelModel + fallback_models: typing_extensions.Annotated[ + typing.Optional[typing.List[OpenAiModelFallbackModelsItem]], FieldMetadata(alias="fallbackModels") + ] = None + semantic_caching_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="semanticCachingEnabled") + ] = None + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoModel_Openrouter(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["openrouter"] = "openrouter" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[OpenRouterModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoModel_PerplexityAi(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["perplexity-ai"] = "perplexity-ai" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[PerplexityAiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoModel_TogetherAi(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["together-ai"] = "together-ai" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[TogetherAiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoModel_Vapi(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["vapi"] = "vapi" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[VapiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + steps: typing.Optional[typing.List[VapiModelStepsItem]] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +UpdateAssistantDtoModel = typing.Union[ + UpdateAssistantDtoModel_Anyscale, + UpdateAssistantDtoModel_Anthropic, + UpdateAssistantDtoModel_CustomLlm, + UpdateAssistantDtoModel_Deepinfra, + UpdateAssistantDtoModel_Groq, + UpdateAssistantDtoModel_Openai, + UpdateAssistantDtoModel_Openrouter, + UpdateAssistantDtoModel_PerplexityAi, + UpdateAssistantDtoModel_TogetherAi, + UpdateAssistantDtoModel_Vapi, +] +update_forward_refs(CallbackStep, UpdateAssistantDtoModel_Vapi=UpdateAssistantDtoModel_Vapi) +update_forward_refs(CreateWorkflowBlockDto, UpdateAssistantDtoModel_Vapi=UpdateAssistantDtoModel_Vapi) +update_forward_refs(HandoffStep, UpdateAssistantDtoModel_Vapi=UpdateAssistantDtoModel_Vapi) diff --git a/src/vapi/assistants/types/update_assistant_dto_server_messages_item.py b/src/vapi/assistants/types/update_assistant_dto_server_messages_item.py new file mode 100644 index 0000000..f903250 --- /dev/null +++ b/src/vapi/assistants/types/update_assistant_dto_server_messages_item.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateAssistantDtoServerMessagesItem = typing.Union[ + typing.Literal[ + "conversation-update", + "end-of-call-report", + "function-call", + "hang", + "language-changed", + "model-output", + "phone-call-control", + "speech-update", + "status-update", + "transcript", + "tool-calls", + "transfer-destination-request", + "transfer-update", + "user-interrupted", + "voice-input", + ], + typing.Any, +] diff --git a/src/vapi/assistants/types/update_assistant_dto_transcriber.py b/src/vapi/assistants/types/update_assistant_dto_transcriber.py new file mode 100644 index 0000000..44da895 --- /dev/null +++ b/src/vapi/assistants/types/update_assistant_dto_transcriber.py @@ -0,0 +1,93 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +from ...types.deepgram_transcriber_model import DeepgramTranscriberModel +from ...types.deepgram_transcriber_language import DeepgramTranscriberLanguage +import typing_extensions +from ...core.serialization import FieldMetadata +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.gladia_transcriber_model import GladiaTranscriberModel +from ...types.gladia_transcriber_language_behaviour import GladiaTranscriberLanguageBehaviour +from ...types.gladia_transcriber_language import GladiaTranscriberLanguage +from ...types.talkscriber_transcriber_language import TalkscriberTranscriberLanguage + + +class UpdateAssistantDtoTranscriber_Deepgram(UniversalBaseModel): + """ + These are the options for the assistant's transcriber. + """ + + provider: typing.Literal["deepgram"] = "deepgram" + model: typing.Optional[DeepgramTranscriberModel] = None + language: typing.Optional[DeepgramTranscriberLanguage] = None + smart_format: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="smartFormat")] = None + language_detection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="languageDetectionEnabled") + ] = None + keywords: typing.Optional[typing.List[str]] = None + endpointing: typing.Optional[float] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoTranscriber_Gladia(UniversalBaseModel): + """ + These are the options for the assistant's transcriber. + """ + + provider: typing.Literal["gladia"] = "gladia" + model: typing.Optional[GladiaTranscriberModel] = None + language_behaviour: typing_extensions.Annotated[ + typing.Optional[GladiaTranscriberLanguageBehaviour], FieldMetadata(alias="languageBehaviour") + ] = None + language: typing.Optional[GladiaTranscriberLanguage] = None + transcription_hint: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="transcriptionHint")] = ( + None + ) + prosody: typing.Optional[bool] = None + audio_enhancer: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="audioEnhancer")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoTranscriber_Talkscriber(UniversalBaseModel): + """ + These are the options for the assistant's transcriber. + """ + + provider: typing.Literal["talkscriber"] = "talkscriber" + model: typing.Optional[typing.Literal["whisper"]] = None + language: typing.Optional[TalkscriberTranscriberLanguage] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +UpdateAssistantDtoTranscriber = typing.Union[ + UpdateAssistantDtoTranscriber_Deepgram, + UpdateAssistantDtoTranscriber_Gladia, + UpdateAssistantDtoTranscriber_Talkscriber, +] diff --git a/src/vapi/assistants/types/update_assistant_dto_voice.py b/src/vapi/assistants/types/update_assistant_dto_voice.py new file mode 100644 index 0000000..dafad3d --- /dev/null +++ b/src/vapi/assistants/types/update_assistant_dto_voice.py @@ -0,0 +1,259 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...core.serialization import FieldMetadata +from ...types.azure_voice_voice_id import AzureVoiceVoiceId +from ...types.chunk_plan import ChunkPlan +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.cartesia_voice_model import CartesiaVoiceModel +from ...types.cartesia_voice_language import CartesiaVoiceLanguage +from ...types.deepgram_voice_voice_id import DeepgramVoiceVoiceId +from ...types.eleven_labs_voice_voice_id import ElevenLabsVoiceVoiceId +from ...types.eleven_labs_voice_model import ElevenLabsVoiceModel +from ...types.lmnt_voice_voice_id import LmntVoiceVoiceId +from ...types.neets_voice_voice_id import NeetsVoiceVoiceId +from ...types.open_ai_voice_voice_id import OpenAiVoiceVoiceId +from ...types.play_ht_voice_voice_id import PlayHtVoiceVoiceId +from ...types.play_ht_voice_emotion import PlayHtVoiceEmotion +from ...types.rime_ai_voice_voice_id import RimeAiVoiceVoiceId +from ...types.rime_ai_voice_model import RimeAiVoiceModel + + +class UpdateAssistantDtoVoice_Azure(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["azure"] = "azure" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[AzureVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoVoice_Cartesia(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["cartesia"] = "cartesia" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + model: typing.Optional[CartesiaVoiceModel] = None + language: typing.Optional[CartesiaVoiceLanguage] = None + voice_id: typing_extensions.Annotated[str, FieldMetadata(alias="voiceId")] + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoVoice_Deepgram(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["deepgram"] = "deepgram" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[DeepgramVoiceVoiceId, FieldMetadata(alias="voiceId")] + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoVoice_11Labs(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["11labs"] = "11labs" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[ElevenLabsVoiceVoiceId, FieldMetadata(alias="voiceId")] + stability: typing.Optional[float] = None + similarity_boost: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="similarityBoost")] = None + style: typing.Optional[float] = None + use_speaker_boost: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="useSpeakerBoost")] = None + optimize_streaming_latency: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="optimizeStreamingLatency") + ] = None + enable_ssml_parsing: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="enableSsmlParsing") + ] = None + model: typing.Optional[ElevenLabsVoiceModel] = None + language: typing.Optional[str] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoVoice_Lmnt(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["lmnt"] = "lmnt" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[LmntVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoVoice_Neets(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["neets"] = "neets" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[NeetsVoiceVoiceId, FieldMetadata(alias="voiceId")] + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoVoice_Openai(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["openai"] = "openai" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[OpenAiVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoVoice_Playht(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["playht"] = "playht" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[PlayHtVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + temperature: typing.Optional[float] = None + emotion: typing.Optional[PlayHtVoiceEmotion] = None + voice_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="voiceGuidance")] = None + style_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="styleGuidance")] = None + text_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="textGuidance")] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateAssistantDtoVoice_RimeAi(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["rime-ai"] = "rime-ai" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[RimeAiVoiceVoiceId, FieldMetadata(alias="voiceId")] + model: typing.Optional[RimeAiVoiceModel] = None + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +UpdateAssistantDtoVoice = typing.Union[ + UpdateAssistantDtoVoice_Azure, + UpdateAssistantDtoVoice_Cartesia, + UpdateAssistantDtoVoice_Deepgram, + UpdateAssistantDtoVoice_11Labs, + UpdateAssistantDtoVoice_Lmnt, + UpdateAssistantDtoVoice_Neets, + UpdateAssistantDtoVoice_Openai, + UpdateAssistantDtoVoice_Playht, + UpdateAssistantDtoVoice_RimeAi, +] diff --git a/src/vapi/blocks/__init__.py b/src/vapi/blocks/__init__.py new file mode 100644 index 0000000..580bcb3 --- /dev/null +++ b/src/vapi/blocks/__init__.py @@ -0,0 +1,83 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import ( + BlocksCreateRequest, + BlocksCreateRequest_Conversation, + BlocksCreateRequest_ToolCall, + BlocksCreateRequest_Workflow, + BlocksCreateResponse, + BlocksCreateResponse_Conversation, + BlocksCreateResponse_ToolCall, + BlocksCreateResponse_Workflow, + BlocksDeleteResponse, + BlocksDeleteResponse_Conversation, + BlocksDeleteResponse_ToolCall, + BlocksDeleteResponse_Workflow, + BlocksGetResponse, + BlocksGetResponse_Conversation, + BlocksGetResponse_ToolCall, + BlocksGetResponse_Workflow, + BlocksListResponseItem, + BlocksListResponseItem_Conversation, + BlocksListResponseItem_ToolCall, + BlocksListResponseItem_Workflow, + BlocksUpdateResponse, + BlocksUpdateResponse_Conversation, + BlocksUpdateResponse_ToolCall, + BlocksUpdateResponse_Workflow, + UpdateBlockDtoMessagesItem, + UpdateBlockDtoMessagesItem_BlockComplete, + UpdateBlockDtoMessagesItem_BlockStart, + UpdateBlockDtoStepsItem, + UpdateBlockDtoStepsItem_Callback, + UpdateBlockDtoStepsItem_Handoff, + UpdateBlockDtoTool, + UpdateBlockDtoTool_Dtmf, + UpdateBlockDtoTool_EndCall, + UpdateBlockDtoTool_Function, + UpdateBlockDtoTool_Ghl, + UpdateBlockDtoTool_Make, + UpdateBlockDtoTool_TransferCall, + UpdateBlockDtoTool_Voicemail, +) + +__all__ = [ + "BlocksCreateRequest", + "BlocksCreateRequest_Conversation", + "BlocksCreateRequest_ToolCall", + "BlocksCreateRequest_Workflow", + "BlocksCreateResponse", + "BlocksCreateResponse_Conversation", + "BlocksCreateResponse_ToolCall", + "BlocksCreateResponse_Workflow", + "BlocksDeleteResponse", + "BlocksDeleteResponse_Conversation", + "BlocksDeleteResponse_ToolCall", + "BlocksDeleteResponse_Workflow", + "BlocksGetResponse", + "BlocksGetResponse_Conversation", + "BlocksGetResponse_ToolCall", + "BlocksGetResponse_Workflow", + "BlocksListResponseItem", + "BlocksListResponseItem_Conversation", + "BlocksListResponseItem_ToolCall", + "BlocksListResponseItem_Workflow", + "BlocksUpdateResponse", + "BlocksUpdateResponse_Conversation", + "BlocksUpdateResponse_ToolCall", + "BlocksUpdateResponse_Workflow", + "UpdateBlockDtoMessagesItem", + "UpdateBlockDtoMessagesItem_BlockComplete", + "UpdateBlockDtoMessagesItem_BlockStart", + "UpdateBlockDtoStepsItem", + "UpdateBlockDtoStepsItem_Callback", + "UpdateBlockDtoStepsItem_Handoff", + "UpdateBlockDtoTool", + "UpdateBlockDtoTool_Dtmf", + "UpdateBlockDtoTool_EndCall", + "UpdateBlockDtoTool_Function", + "UpdateBlockDtoTool_Ghl", + "UpdateBlockDtoTool_Make", + "UpdateBlockDtoTool_TransferCall", + "UpdateBlockDtoTool_Voicemail", +] diff --git a/src/vapi/blocks/client.py b/src/vapi/blocks/client.py new file mode 100644 index 0000000..599ce23 --- /dev/null +++ b/src/vapi/blocks/client.py @@ -0,0 +1,802 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ..core.client_wrapper import SyncClientWrapper +import datetime as dt +from ..core.request_options import RequestOptions +from .types.blocks_list_response_item import BlocksListResponseItem +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from .types.blocks_create_request import BlocksCreateRequest +from .types.blocks_create_response import BlocksCreateResponse +from ..core.serialization import convert_and_respect_annotation_metadata +from .types.blocks_get_response import BlocksGetResponse +from ..core.jsonable_encoder import jsonable_encoder +from .types.blocks_delete_response import BlocksDeleteResponse +from .types.update_block_dto_messages_item import UpdateBlockDtoMessagesItem +from ..types.json_schema import JsonSchema +from .types.update_block_dto_tool import UpdateBlockDtoTool +from .types.update_block_dto_steps_item import UpdateBlockDtoStepsItem +from .types.blocks_update_response import BlocksUpdateResponse +from ..core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class BlocksClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[BlocksListResponseItem]: + """ + Parameters + ---------- + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[BlocksListResponseItem] + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.blocks.list() + """ + _response = self._client_wrapper.httpx_client.request( + "block", + method="GET", + params={ + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[BlocksListResponseItem], + parse_obj_as( + type_=typing.List[BlocksListResponseItem], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def create( + self, *, request: BlocksCreateRequest, request_options: typing.Optional[RequestOptions] = None + ) -> BlocksCreateResponse: + """ + Parameters + ---------- + request : BlocksCreateRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BlocksCreateResponse + + + Examples + -------- + from vapi import Vapi + from vapi.blocks import BlocksCreateRequest_Workflow + + client = Vapi( + token="YOUR_TOKEN", + ) + client.blocks.create( + request=BlocksCreateRequest_Workflow(), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "block", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=BlocksCreateRequest, direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BlocksCreateResponse, + parse_obj_as( + type_=BlocksCreateResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> BlocksGetResponse: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BlocksGetResponse + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.blocks.get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"block/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BlocksGetResponse, + parse_obj_as( + type_=BlocksGetResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> BlocksDeleteResponse: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BlocksDeleteResponse + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.blocks.delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"block/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BlocksDeleteResponse, + parse_obj_as( + type_=BlocksDeleteResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def update( + self, + id: str, + *, + messages: typing.Optional[typing.Sequence[UpdateBlockDtoMessagesItem]] = OMIT, + input_schema: typing.Optional[JsonSchema] = OMIT, + output_schema: typing.Optional[JsonSchema] = OMIT, + tool: typing.Optional[UpdateBlockDtoTool] = OMIT, + steps: typing.Optional[typing.Sequence[UpdateBlockDtoStepsItem]] = OMIT, + name: typing.Optional[str] = OMIT, + instruction: typing.Optional[str] = OMIT, + tool_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> BlocksUpdateResponse: + """ + Parameters + ---------- + id : str + + messages : typing.Optional[typing.Sequence[UpdateBlockDtoMessagesItem]] + These are the pre-configured messages that will be spoken to the user while the block is running. + + input_schema : typing.Optional[JsonSchema] + This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` + + These are accessible as variables: + - ({{input.propertyName}}) in context of the block execution (step) + - ({{stepName.input.propertyName}}) in context of the workflow + + output_schema : typing.Optional[JsonSchema] + This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). + + These are accessible as variables: + - ({{output.propertyName}}) in context of the block execution (step) + - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) + - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) + + Caveats: + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + + tool : typing.Optional[UpdateBlockDtoTool] + This is the tool that the block will call. To use an existing tool, use `toolId`. + + steps : typing.Optional[typing.Sequence[UpdateBlockDtoStepsItem]] + These are the steps in the workflow. + + name : typing.Optional[str] + This is the name of the block. This is just for your reference. + + instruction : typing.Optional[str] + This is the instruction to the model. + + You can reference any variable in the context of the current block execution (step): + - "{{input.your-property-name}}" for the current step's input + - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) + - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) + - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) + - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) + - "{{workflow.input.your-property-name}}" for the current workflow's input + - "{{global.your-property-name}}" for the global context + + This can be as simple or as complex as you want it to be. + - "say hello and ask the user about their day!" + - "collect the user's first and last name" + - "user is {{input.firstName}} {{input.lastName}}. their age is {{input.age}}. ask them about their salary and if they might be interested in buying a house. we offer {{input.offer}}" + + Caveats: + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output/input.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output/input.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + + tool_id : typing.Optional[str] + This is the id of the tool that the block will call. To use a transient tool, use `tool`. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BlocksUpdateResponse + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.blocks.update( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"block/{jsonable_encoder(id)}", + method="PATCH", + json={ + "messages": convert_and_respect_annotation_metadata( + object_=messages, annotation=typing.Sequence[UpdateBlockDtoMessagesItem], direction="write" + ), + "inputSchema": convert_and_respect_annotation_metadata( + object_=input_schema, annotation=JsonSchema, direction="write" + ), + "outputSchema": convert_and_respect_annotation_metadata( + object_=output_schema, annotation=JsonSchema, direction="write" + ), + "tool": convert_and_respect_annotation_metadata( + object_=tool, annotation=UpdateBlockDtoTool, direction="write" + ), + "steps": convert_and_respect_annotation_metadata( + object_=steps, annotation=typing.Sequence[UpdateBlockDtoStepsItem], direction="write" + ), + "name": name, + "instruction": instruction, + "toolId": tool_id, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BlocksUpdateResponse, + parse_obj_as( + type_=BlocksUpdateResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncBlocksClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[BlocksListResponseItem]: + """ + Parameters + ---------- + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[BlocksListResponseItem] + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.blocks.list() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "block", + method="GET", + params={ + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[BlocksListResponseItem], + parse_obj_as( + type_=typing.List[BlocksListResponseItem], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def create( + self, *, request: BlocksCreateRequest, request_options: typing.Optional[RequestOptions] = None + ) -> BlocksCreateResponse: + """ + Parameters + ---------- + request : BlocksCreateRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BlocksCreateResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + from vapi.blocks import BlocksCreateRequest_Workflow + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.blocks.create( + request=BlocksCreateRequest_Workflow(), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "block", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=BlocksCreateRequest, direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BlocksCreateResponse, + parse_obj_as( + type_=BlocksCreateResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> BlocksGetResponse: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BlocksGetResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.blocks.get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"block/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BlocksGetResponse, + parse_obj_as( + type_=BlocksGetResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> BlocksDeleteResponse: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BlocksDeleteResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.blocks.delete( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"block/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BlocksDeleteResponse, + parse_obj_as( + type_=BlocksDeleteResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def update( + self, + id: str, + *, + messages: typing.Optional[typing.Sequence[UpdateBlockDtoMessagesItem]] = OMIT, + input_schema: typing.Optional[JsonSchema] = OMIT, + output_schema: typing.Optional[JsonSchema] = OMIT, + tool: typing.Optional[UpdateBlockDtoTool] = OMIT, + steps: typing.Optional[typing.Sequence[UpdateBlockDtoStepsItem]] = OMIT, + name: typing.Optional[str] = OMIT, + instruction: typing.Optional[str] = OMIT, + tool_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> BlocksUpdateResponse: + """ + Parameters + ---------- + id : str + + messages : typing.Optional[typing.Sequence[UpdateBlockDtoMessagesItem]] + These are the pre-configured messages that will be spoken to the user while the block is running. + + input_schema : typing.Optional[JsonSchema] + This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` + + These are accessible as variables: + - ({{input.propertyName}}) in context of the block execution (step) + - ({{stepName.input.propertyName}}) in context of the workflow + + output_schema : typing.Optional[JsonSchema] + This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). + + These are accessible as variables: + - ({{output.propertyName}}) in context of the block execution (step) + - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) + - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) + + Caveats: + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + + tool : typing.Optional[UpdateBlockDtoTool] + This is the tool that the block will call. To use an existing tool, use `toolId`. + + steps : typing.Optional[typing.Sequence[UpdateBlockDtoStepsItem]] + These are the steps in the workflow. + + name : typing.Optional[str] + This is the name of the block. This is just for your reference. + + instruction : typing.Optional[str] + This is the instruction to the model. + + You can reference any variable in the context of the current block execution (step): + - "{{input.your-property-name}}" for the current step's input + - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) + - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) + - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) + - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) + - "{{workflow.input.your-property-name}}" for the current workflow's input + - "{{global.your-property-name}}" for the global context + + This can be as simple or as complex as you want it to be. + - "say hello and ask the user about their day!" + - "collect the user's first and last name" + - "user is {{input.firstName}} {{input.lastName}}. their age is {{input.age}}. ask them about their salary and if they might be interested in buying a house. we offer {{input.offer}}" + + Caveats: + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output/input.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output/input.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + + tool_id : typing.Optional[str] + This is the id of the tool that the block will call. To use a transient tool, use `tool`. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BlocksUpdateResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.blocks.update( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"block/{jsonable_encoder(id)}", + method="PATCH", + json={ + "messages": convert_and_respect_annotation_metadata( + object_=messages, annotation=typing.Sequence[UpdateBlockDtoMessagesItem], direction="write" + ), + "inputSchema": convert_and_respect_annotation_metadata( + object_=input_schema, annotation=JsonSchema, direction="write" + ), + "outputSchema": convert_and_respect_annotation_metadata( + object_=output_schema, annotation=JsonSchema, direction="write" + ), + "tool": convert_and_respect_annotation_metadata( + object_=tool, annotation=UpdateBlockDtoTool, direction="write" + ), + "steps": convert_and_respect_annotation_metadata( + object_=steps, annotation=typing.Sequence[UpdateBlockDtoStepsItem], direction="write" + ), + "name": name, + "instruction": instruction, + "toolId": tool_id, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BlocksUpdateResponse, + parse_obj_as( + type_=BlocksUpdateResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/vapi/blocks/types/__init__.py b/src/vapi/blocks/types/__init__.py new file mode 100644 index 0000000..c58692c --- /dev/null +++ b/src/vapi/blocks/types/__init__.py @@ -0,0 +1,99 @@ +# This file was auto-generated by Fern from our API Definition. + +from .blocks_create_request import ( + BlocksCreateRequest, + BlocksCreateRequest_Conversation, + BlocksCreateRequest_ToolCall, + BlocksCreateRequest_Workflow, +) +from .blocks_create_response import ( + BlocksCreateResponse, + BlocksCreateResponse_Conversation, + BlocksCreateResponse_ToolCall, + BlocksCreateResponse_Workflow, +) +from .blocks_delete_response import ( + BlocksDeleteResponse, + BlocksDeleteResponse_Conversation, + BlocksDeleteResponse_ToolCall, + BlocksDeleteResponse_Workflow, +) +from .blocks_get_response import ( + BlocksGetResponse, + BlocksGetResponse_Conversation, + BlocksGetResponse_ToolCall, + BlocksGetResponse_Workflow, +) +from .blocks_list_response_item import ( + BlocksListResponseItem, + BlocksListResponseItem_Conversation, + BlocksListResponseItem_ToolCall, + BlocksListResponseItem_Workflow, +) +from .blocks_update_response import ( + BlocksUpdateResponse, + BlocksUpdateResponse_Conversation, + BlocksUpdateResponse_ToolCall, + BlocksUpdateResponse_Workflow, +) +from .update_block_dto_messages_item import ( + UpdateBlockDtoMessagesItem, + UpdateBlockDtoMessagesItem_BlockComplete, + UpdateBlockDtoMessagesItem_BlockStart, +) +from .update_block_dto_steps_item import ( + UpdateBlockDtoStepsItem, + UpdateBlockDtoStepsItem_Callback, + UpdateBlockDtoStepsItem_Handoff, +) +from .update_block_dto_tool import ( + UpdateBlockDtoTool, + UpdateBlockDtoTool_Dtmf, + UpdateBlockDtoTool_EndCall, + UpdateBlockDtoTool_Function, + UpdateBlockDtoTool_Ghl, + UpdateBlockDtoTool_Make, + UpdateBlockDtoTool_TransferCall, + UpdateBlockDtoTool_Voicemail, +) + +__all__ = [ + "BlocksCreateRequest", + "BlocksCreateRequest_Conversation", + "BlocksCreateRequest_ToolCall", + "BlocksCreateRequest_Workflow", + "BlocksCreateResponse", + "BlocksCreateResponse_Conversation", + "BlocksCreateResponse_ToolCall", + "BlocksCreateResponse_Workflow", + "BlocksDeleteResponse", + "BlocksDeleteResponse_Conversation", + "BlocksDeleteResponse_ToolCall", + "BlocksDeleteResponse_Workflow", + "BlocksGetResponse", + "BlocksGetResponse_Conversation", + "BlocksGetResponse_ToolCall", + "BlocksGetResponse_Workflow", + "BlocksListResponseItem", + "BlocksListResponseItem_Conversation", + "BlocksListResponseItem_ToolCall", + "BlocksListResponseItem_Workflow", + "BlocksUpdateResponse", + "BlocksUpdateResponse_Conversation", + "BlocksUpdateResponse_ToolCall", + "BlocksUpdateResponse_Workflow", + "UpdateBlockDtoMessagesItem", + "UpdateBlockDtoMessagesItem_BlockComplete", + "UpdateBlockDtoMessagesItem_BlockStart", + "UpdateBlockDtoStepsItem", + "UpdateBlockDtoStepsItem_Callback", + "UpdateBlockDtoStepsItem_Handoff", + "UpdateBlockDtoTool", + "UpdateBlockDtoTool_Dtmf", + "UpdateBlockDtoTool_EndCall", + "UpdateBlockDtoTool_Function", + "UpdateBlockDtoTool_Ghl", + "UpdateBlockDtoTool_Make", + "UpdateBlockDtoTool_TransferCall", + "UpdateBlockDtoTool_Voicemail", +] diff --git a/src/vapi/blocks/types/blocks_create_request.py b/src/vapi/blocks/types/blocks_create_request.py new file mode 100644 index 0000000..aa97036 --- /dev/null +++ b/src/vapi/blocks/types/blocks_create_request.py @@ -0,0 +1,84 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +from ...types.create_conversation_block_dto_messages_item import CreateConversationBlockDtoMessagesItem +import typing_extensions +from ...types.json_schema import JsonSchema +from ...core.serialization import FieldMetadata +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.create_tool_call_block_dto_messages_item import CreateToolCallBlockDtoMessagesItem +from ...types.create_tool_call_block_dto_tool import CreateToolCallBlockDtoTool +from ...types.create_workflow_block_dto_messages_item import CreateWorkflowBlockDtoMessagesItem +from ...core.pydantic_utilities import update_forward_refs + + +class BlocksCreateRequest_Conversation(UniversalBaseModel): + type: typing.Literal["conversation"] = "conversation" + messages: typing.Optional[typing.List[CreateConversationBlockDtoMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + instruction: str + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlocksCreateRequest_ToolCall(UniversalBaseModel): + type: typing.Literal["tool-call"] = "tool-call" + messages: typing.Optional[typing.List[CreateToolCallBlockDtoMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + tool: typing.Optional[CreateToolCallBlockDtoTool] = None + tool_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="toolId")] = None + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlocksCreateRequest_Workflow(UniversalBaseModel): + type: typing.Literal["workflow"] = "workflow" + messages: typing.Optional[typing.List[CreateWorkflowBlockDtoMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + steps: typing.Optional[typing.List["CreateWorkflowBlockDtoStepsItem"]] = None + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from ...types.callback_step import CallbackStep # noqa: E402 +from ...types.create_workflow_block_dto import CreateWorkflowBlockDto # noqa: E402 +from ...types.handoff_step import HandoffStep # noqa: E402 +from ...types.create_workflow_block_dto_steps_item import CreateWorkflowBlockDtoStepsItem # noqa: E402 + +BlocksCreateRequest = typing.Union[ + BlocksCreateRequest_Conversation, BlocksCreateRequest_ToolCall, BlocksCreateRequest_Workflow +] +update_forward_refs(CallbackStep, BlocksCreateRequest_Workflow=BlocksCreateRequest_Workflow) +update_forward_refs(CreateWorkflowBlockDto, BlocksCreateRequest_Workflow=BlocksCreateRequest_Workflow) +update_forward_refs(HandoffStep, BlocksCreateRequest_Workflow=BlocksCreateRequest_Workflow) +update_forward_refs(BlocksCreateRequest_Workflow) diff --git a/src/vapi/blocks/types/blocks_create_response.py b/src/vapi/blocks/types/blocks_create_response.py new file mode 100644 index 0000000..eb3ec81 --- /dev/null +++ b/src/vapi/blocks/types/blocks_create_response.py @@ -0,0 +1,95 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +from ...types.conversation_block_messages_item import ConversationBlockMessagesItem +import typing_extensions +from ...types.json_schema import JsonSchema +from ...core.serialization import FieldMetadata +import datetime as dt +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.tool_call_block_messages_item import ToolCallBlockMessagesItem +from ...types.tool_call_block_tool import ToolCallBlockTool +from ...types.callback_step import CallbackStep +from ...types.create_workflow_block_dto import CreateWorkflowBlockDto +from ...types.handoff_step import HandoffStep +from ...types.workflow_block_messages_item import WorkflowBlockMessagesItem +from ...types.workflow_block_steps_item import WorkflowBlockStepsItem +from ...core.pydantic_utilities import update_forward_refs + + +class BlocksCreateResponse_Conversation(UniversalBaseModel): + type: typing.Literal["conversation"] = "conversation" + messages: typing.Optional[typing.List[ConversationBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + instruction: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlocksCreateResponse_ToolCall(UniversalBaseModel): + type: typing.Literal["tool-call"] = "tool-call" + messages: typing.Optional[typing.List[ToolCallBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + tool: typing.Optional[ToolCallBlockTool] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + tool_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="toolId")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlocksCreateResponse_Workflow(UniversalBaseModel): + type: typing.Literal["workflow"] = "workflow" + messages: typing.Optional[typing.List[WorkflowBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + steps: typing.Optional[typing.List[WorkflowBlockStepsItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +BlocksCreateResponse = typing.Union[ + BlocksCreateResponse_Conversation, BlocksCreateResponse_ToolCall, BlocksCreateResponse_Workflow +] +update_forward_refs(CallbackStep, BlocksCreateResponse_Workflow=BlocksCreateResponse_Workflow) +update_forward_refs(CreateWorkflowBlockDto, BlocksCreateResponse_Workflow=BlocksCreateResponse_Workflow) +update_forward_refs(HandoffStep, BlocksCreateResponse_Workflow=BlocksCreateResponse_Workflow) diff --git a/src/vapi/blocks/types/blocks_delete_response.py b/src/vapi/blocks/types/blocks_delete_response.py new file mode 100644 index 0000000..266df00 --- /dev/null +++ b/src/vapi/blocks/types/blocks_delete_response.py @@ -0,0 +1,95 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +from ...types.conversation_block_messages_item import ConversationBlockMessagesItem +import typing_extensions +from ...types.json_schema import JsonSchema +from ...core.serialization import FieldMetadata +import datetime as dt +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.tool_call_block_messages_item import ToolCallBlockMessagesItem +from ...types.tool_call_block_tool import ToolCallBlockTool +from ...types.callback_step import CallbackStep +from ...types.create_workflow_block_dto import CreateWorkflowBlockDto +from ...types.handoff_step import HandoffStep +from ...types.workflow_block_messages_item import WorkflowBlockMessagesItem +from ...types.workflow_block_steps_item import WorkflowBlockStepsItem +from ...core.pydantic_utilities import update_forward_refs + + +class BlocksDeleteResponse_Conversation(UniversalBaseModel): + type: typing.Literal["conversation"] = "conversation" + messages: typing.Optional[typing.List[ConversationBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + instruction: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlocksDeleteResponse_ToolCall(UniversalBaseModel): + type: typing.Literal["tool-call"] = "tool-call" + messages: typing.Optional[typing.List[ToolCallBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + tool: typing.Optional[ToolCallBlockTool] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + tool_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="toolId")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlocksDeleteResponse_Workflow(UniversalBaseModel): + type: typing.Literal["workflow"] = "workflow" + messages: typing.Optional[typing.List[WorkflowBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + steps: typing.Optional[typing.List[WorkflowBlockStepsItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +BlocksDeleteResponse = typing.Union[ + BlocksDeleteResponse_Conversation, BlocksDeleteResponse_ToolCall, BlocksDeleteResponse_Workflow +] +update_forward_refs(CallbackStep, BlocksDeleteResponse_Workflow=BlocksDeleteResponse_Workflow) +update_forward_refs(CreateWorkflowBlockDto, BlocksDeleteResponse_Workflow=BlocksDeleteResponse_Workflow) +update_forward_refs(HandoffStep, BlocksDeleteResponse_Workflow=BlocksDeleteResponse_Workflow) diff --git a/src/vapi/blocks/types/blocks_get_response.py b/src/vapi/blocks/types/blocks_get_response.py new file mode 100644 index 0000000..a9b54ac --- /dev/null +++ b/src/vapi/blocks/types/blocks_get_response.py @@ -0,0 +1,93 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +from ...types.conversation_block_messages_item import ConversationBlockMessagesItem +import typing_extensions +from ...types.json_schema import JsonSchema +from ...core.serialization import FieldMetadata +import datetime as dt +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.tool_call_block_messages_item import ToolCallBlockMessagesItem +from ...types.tool_call_block_tool import ToolCallBlockTool +from ...types.callback_step import CallbackStep +from ...types.create_workflow_block_dto import CreateWorkflowBlockDto +from ...types.handoff_step import HandoffStep +from ...types.workflow_block_messages_item import WorkflowBlockMessagesItem +from ...types.workflow_block_steps_item import WorkflowBlockStepsItem +from ...core.pydantic_utilities import update_forward_refs + + +class BlocksGetResponse_Conversation(UniversalBaseModel): + type: typing.Literal["conversation"] = "conversation" + messages: typing.Optional[typing.List[ConversationBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + instruction: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlocksGetResponse_ToolCall(UniversalBaseModel): + type: typing.Literal["tool-call"] = "tool-call" + messages: typing.Optional[typing.List[ToolCallBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + tool: typing.Optional[ToolCallBlockTool] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + tool_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="toolId")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlocksGetResponse_Workflow(UniversalBaseModel): + type: typing.Literal["workflow"] = "workflow" + messages: typing.Optional[typing.List[WorkflowBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + steps: typing.Optional[typing.List[WorkflowBlockStepsItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +BlocksGetResponse = typing.Union[BlocksGetResponse_Conversation, BlocksGetResponse_ToolCall, BlocksGetResponse_Workflow] +update_forward_refs(CallbackStep, BlocksGetResponse_Workflow=BlocksGetResponse_Workflow) +update_forward_refs(CreateWorkflowBlockDto, BlocksGetResponse_Workflow=BlocksGetResponse_Workflow) +update_forward_refs(HandoffStep, BlocksGetResponse_Workflow=BlocksGetResponse_Workflow) diff --git a/src/vapi/blocks/types/blocks_list_response_item.py b/src/vapi/blocks/types/blocks_list_response_item.py new file mode 100644 index 0000000..a5e4784 --- /dev/null +++ b/src/vapi/blocks/types/blocks_list_response_item.py @@ -0,0 +1,95 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +from ...types.conversation_block_messages_item import ConversationBlockMessagesItem +import typing_extensions +from ...types.json_schema import JsonSchema +from ...core.serialization import FieldMetadata +import datetime as dt +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.tool_call_block_messages_item import ToolCallBlockMessagesItem +from ...types.tool_call_block_tool import ToolCallBlockTool +from ...types.callback_step import CallbackStep +from ...types.create_workflow_block_dto import CreateWorkflowBlockDto +from ...types.handoff_step import HandoffStep +from ...types.workflow_block_messages_item import WorkflowBlockMessagesItem +from ...types.workflow_block_steps_item import WorkflowBlockStepsItem +from ...core.pydantic_utilities import update_forward_refs + + +class BlocksListResponseItem_Conversation(UniversalBaseModel): + type: typing.Literal["conversation"] = "conversation" + messages: typing.Optional[typing.List[ConversationBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + instruction: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlocksListResponseItem_ToolCall(UniversalBaseModel): + type: typing.Literal["tool-call"] = "tool-call" + messages: typing.Optional[typing.List[ToolCallBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + tool: typing.Optional[ToolCallBlockTool] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + tool_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="toolId")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlocksListResponseItem_Workflow(UniversalBaseModel): + type: typing.Literal["workflow"] = "workflow" + messages: typing.Optional[typing.List[WorkflowBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + steps: typing.Optional[typing.List[WorkflowBlockStepsItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +BlocksListResponseItem = typing.Union[ + BlocksListResponseItem_Conversation, BlocksListResponseItem_ToolCall, BlocksListResponseItem_Workflow +] +update_forward_refs(CallbackStep, BlocksListResponseItem_Workflow=BlocksListResponseItem_Workflow) +update_forward_refs(CreateWorkflowBlockDto, BlocksListResponseItem_Workflow=BlocksListResponseItem_Workflow) +update_forward_refs(HandoffStep, BlocksListResponseItem_Workflow=BlocksListResponseItem_Workflow) diff --git a/src/vapi/blocks/types/blocks_update_response.py b/src/vapi/blocks/types/blocks_update_response.py new file mode 100644 index 0000000..8213167 --- /dev/null +++ b/src/vapi/blocks/types/blocks_update_response.py @@ -0,0 +1,95 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +from ...types.conversation_block_messages_item import ConversationBlockMessagesItem +import typing_extensions +from ...types.json_schema import JsonSchema +from ...core.serialization import FieldMetadata +import datetime as dt +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.tool_call_block_messages_item import ToolCallBlockMessagesItem +from ...types.tool_call_block_tool import ToolCallBlockTool +from ...types.callback_step import CallbackStep +from ...types.create_workflow_block_dto import CreateWorkflowBlockDto +from ...types.handoff_step import HandoffStep +from ...types.workflow_block_messages_item import WorkflowBlockMessagesItem +from ...types.workflow_block_steps_item import WorkflowBlockStepsItem +from ...core.pydantic_utilities import update_forward_refs + + +class BlocksUpdateResponse_Conversation(UniversalBaseModel): + type: typing.Literal["conversation"] = "conversation" + messages: typing.Optional[typing.List[ConversationBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + instruction: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlocksUpdateResponse_ToolCall(UniversalBaseModel): + type: typing.Literal["tool-call"] = "tool-call" + messages: typing.Optional[typing.List[ToolCallBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + tool: typing.Optional[ToolCallBlockTool] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + tool_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="toolId")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlocksUpdateResponse_Workflow(UniversalBaseModel): + type: typing.Literal["workflow"] = "workflow" + messages: typing.Optional[typing.List[WorkflowBlockMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + steps: typing.Optional[typing.List[WorkflowBlockStepsItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +BlocksUpdateResponse = typing.Union[ + BlocksUpdateResponse_Conversation, BlocksUpdateResponse_ToolCall, BlocksUpdateResponse_Workflow +] +update_forward_refs(CallbackStep, BlocksUpdateResponse_Workflow=BlocksUpdateResponse_Workflow) +update_forward_refs(CreateWorkflowBlockDto, BlocksUpdateResponse_Workflow=BlocksUpdateResponse_Workflow) +update_forward_refs(HandoffStep, BlocksUpdateResponse_Workflow=BlocksUpdateResponse_Workflow) diff --git a/src/vapi/blocks/types/update_block_dto_messages_item.py b/src/vapi/blocks/types/update_block_dto_messages_item.py new file mode 100644 index 0000000..2997b59 --- /dev/null +++ b/src/vapi/blocks/types/update_block_dto_messages_item.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +from ...types.block_start_message_conditions_item import BlockStartMessageConditionsItem +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.block_complete_message_conditions_item import BlockCompleteMessageConditionsItem + + +class UpdateBlockDtoMessagesItem_BlockStart(UniversalBaseModel): + type: typing.Literal["block-start"] = "block-start" + conditions: typing.Optional[typing.List[BlockStartMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateBlockDtoMessagesItem_BlockComplete(UniversalBaseModel): + type: typing.Literal["block-complete"] = "block-complete" + conditions: typing.Optional[typing.List[BlockCompleteMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +UpdateBlockDtoMessagesItem = typing.Union[ + UpdateBlockDtoMessagesItem_BlockStart, UpdateBlockDtoMessagesItem_BlockComplete +] diff --git a/src/vapi/blocks/types/update_block_dto_steps_item.py b/src/vapi/blocks/types/update_block_dto_steps_item.py new file mode 100644 index 0000000..7c50065 --- /dev/null +++ b/src/vapi/blocks/types/update_block_dto_steps_item.py @@ -0,0 +1,67 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +from ...types.step_destination import StepDestination +import typing_extensions +from ...core.serialization import FieldMetadata +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.assignment_mutation import AssignmentMutation +from ...core.pydantic_utilities import update_forward_refs + + +class UpdateBlockDtoStepsItem_Handoff(UniversalBaseModel): + type: typing.Literal["handoff"] = "handoff" + block: typing.Optional["HandoffStepBlock"] = None + destinations: typing.Optional[typing.List[StepDestination]] = None + name: str + block_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="blockId")] = None + input: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from ...types.handoff_step_block import HandoffStepBlock # noqa: E402 + + +class UpdateBlockDtoStepsItem_Callback(UniversalBaseModel): + type: typing.Literal["callback"] = "callback" + block: typing.Optional["CallbackStepBlock"] = None + mutations: typing.Optional[typing.List[AssignmentMutation]] = None + name: str + block_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="blockId")] = None + input: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from ...types.callback_step import CallbackStep # noqa: E402 +from ...types.create_workflow_block_dto import CreateWorkflowBlockDto # noqa: E402 +from ...types.handoff_step import HandoffStep # noqa: E402 +from ...types.callback_step_block import CallbackStepBlock # noqa: E402 + +UpdateBlockDtoStepsItem = typing.Union[UpdateBlockDtoStepsItem_Handoff, UpdateBlockDtoStepsItem_Callback] +update_forward_refs(CallbackStep, UpdateBlockDtoStepsItem_Handoff=UpdateBlockDtoStepsItem_Handoff) +update_forward_refs(CreateWorkflowBlockDto, UpdateBlockDtoStepsItem_Handoff=UpdateBlockDtoStepsItem_Handoff) +update_forward_refs(HandoffStep, UpdateBlockDtoStepsItem_Handoff=UpdateBlockDtoStepsItem_Handoff) +update_forward_refs(UpdateBlockDtoStepsItem_Handoff) +update_forward_refs(CallbackStep, UpdateBlockDtoStepsItem_Callback=UpdateBlockDtoStepsItem_Callback) +update_forward_refs(CreateWorkflowBlockDto, UpdateBlockDtoStepsItem_Callback=UpdateBlockDtoStepsItem_Callback) +update_forward_refs(HandoffStep, UpdateBlockDtoStepsItem_Callback=UpdateBlockDtoStepsItem_Callback) +update_forward_refs(UpdateBlockDtoStepsItem_Callback) diff --git a/src/vapi/blocks/types/update_block_dto_tool.py b/src/vapi/blocks/types/update_block_dto_tool.py new file mode 100644 index 0000000..5c86966 --- /dev/null +++ b/src/vapi/blocks/types/update_block_dto_tool.py @@ -0,0 +1,182 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...core.serialization import FieldMetadata +from ...types.create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from ...types.open_ai_function import OpenAiFunction +from ...types.server import Server +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from ...types.create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from ...types.create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from ...types.create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from ...types.ghl_tool_metadata import GhlToolMetadata +from ...types.create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from ...types.make_tool_metadata import MakeToolMetadata +from ...types.create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from ...types.create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class UpdateBlockDtoTool_Dtmf(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateBlockDtoTool_EndCall(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateBlockDtoTool_Voicemail(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateBlockDtoTool_Function(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateBlockDtoTool_Ghl(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateBlockDtoTool_Make(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateBlockDtoTool_TransferCall(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +UpdateBlockDtoTool = typing.Union[ + UpdateBlockDtoTool_Dtmf, + UpdateBlockDtoTool_EndCall, + UpdateBlockDtoTool_Voicemail, + UpdateBlockDtoTool_Function, + UpdateBlockDtoTool_Ghl, + UpdateBlockDtoTool_Make, + UpdateBlockDtoTool_TransferCall, +] diff --git a/src/vapi/calls/__init__.py b/src/vapi/calls/__init__.py new file mode 100644 index 0000000..f3ea265 --- /dev/null +++ b/src/vapi/calls/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/vapi/calls/client.py b/src/vapi/calls/client.py new file mode 100644 index 0000000..5328d82 --- /dev/null +++ b/src/vapi/calls/client.py @@ -0,0 +1,776 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ..core.client_wrapper import SyncClientWrapper +import datetime as dt +from ..core.request_options import RequestOptions +from ..types.call import Call +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..types.create_assistant_dto import CreateAssistantDto +from ..types.assistant_overrides import AssistantOverrides +from ..types.create_squad_dto import CreateSquadDto +from ..types.import_twilio_phone_number_dto import ImportTwilioPhoneNumberDto +from ..types.create_customer_dto import CreateCustomerDto +from ..core.serialization import convert_and_respect_annotation_metadata +from ..core.jsonable_encoder import jsonable_encoder +from ..core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class CallsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + assistant_id: typing.Optional[str] = None, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[Call]: + """ + Parameters + ---------- + assistant_id : typing.Optional[str] + This will return calls with the specified assistantId. + + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[Call] + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.calls.list() + """ + _response = self._client_wrapper.httpx_client.request( + "call", + method="GET", + params={ + "assistantId": assistant_id, + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[Call], + parse_obj_as( + type_=typing.List[Call], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def create( + self, + *, + name: typing.Optional[str] = OMIT, + assistant_id: typing.Optional[str] = OMIT, + assistant: typing.Optional[CreateAssistantDto] = OMIT, + assistant_overrides: typing.Optional[AssistantOverrides] = OMIT, + squad_id: typing.Optional[str] = OMIT, + squad: typing.Optional[CreateSquadDto] = OMIT, + phone_number_id: typing.Optional[str] = OMIT, + phone_number: typing.Optional[ImportTwilioPhoneNumberDto] = OMIT, + customer_id: typing.Optional[str] = OMIT, + customer: typing.Optional[CreateCustomerDto] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> Call: + """ + Parameters + ---------- + name : typing.Optional[str] + This is the name of the call. This is just for your own reference. + + assistant_id : typing.Optional[str] + This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + + assistant : typing.Optional[CreateAssistantDto] + This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. + + assistant_overrides : typing.Optional[AssistantOverrides] + These are the overrides for the `assistant` or `assistantId`'s settings and template variables. + + squad_id : typing.Optional[str] + This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + + squad : typing.Optional[CreateSquadDto] + This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + + phone_number_id : typing.Optional[str] + This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + + phone_number : typing.Optional[ImportTwilioPhoneNumberDto] + This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + + customer_id : typing.Optional[str] + This is the customer that will be called. To call a transient customer , use `customer` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + + customer : typing.Optional[CreateCustomerDto] + This is the customer that will be called. To call an existing customer, use `customerId` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Call + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.calls.create() + """ + _response = self._client_wrapper.httpx_client.request( + "call", + method="POST", + json={ + "name": name, + "assistantId": assistant_id, + "assistant": convert_and_respect_annotation_metadata( + object_=assistant, annotation=CreateAssistantDto, direction="write" + ), + "assistantOverrides": convert_and_respect_annotation_metadata( + object_=assistant_overrides, annotation=AssistantOverrides, direction="write" + ), + "squadId": squad_id, + "squad": convert_and_respect_annotation_metadata( + object_=squad, annotation=CreateSquadDto, direction="write" + ), + "phoneNumberId": phone_number_id, + "phoneNumber": convert_and_respect_annotation_metadata( + object_=phone_number, annotation=ImportTwilioPhoneNumberDto, direction="write" + ), + "customerId": customer_id, + "customer": convert_and_respect_annotation_metadata( + object_=customer, annotation=CreateCustomerDto, direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Call, + parse_obj_as( + type_=Call, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Call: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Call + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.calls.get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"call/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Call, + parse_obj_as( + type_=Call, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Call: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Call + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.calls.delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"call/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Call, + parse_obj_as( + type_=Call, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def update( + self, id: str, *, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> Call: + """ + Parameters + ---------- + id : str + + name : typing.Optional[str] + This is the name of the call. This is just for your own reference. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Call + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.calls.update( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"call/{jsonable_encoder(id)}", + method="PATCH", + json={ + "name": name, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Call, + parse_obj_as( + type_=Call, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncCallsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + assistant_id: typing.Optional[str] = None, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[Call]: + """ + Parameters + ---------- + assistant_id : typing.Optional[str] + This will return calls with the specified assistantId. + + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[Call] + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.calls.list() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "call", + method="GET", + params={ + "assistantId": assistant_id, + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[Call], + parse_obj_as( + type_=typing.List[Call], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def create( + self, + *, + name: typing.Optional[str] = OMIT, + assistant_id: typing.Optional[str] = OMIT, + assistant: typing.Optional[CreateAssistantDto] = OMIT, + assistant_overrides: typing.Optional[AssistantOverrides] = OMIT, + squad_id: typing.Optional[str] = OMIT, + squad: typing.Optional[CreateSquadDto] = OMIT, + phone_number_id: typing.Optional[str] = OMIT, + phone_number: typing.Optional[ImportTwilioPhoneNumberDto] = OMIT, + customer_id: typing.Optional[str] = OMIT, + customer: typing.Optional[CreateCustomerDto] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> Call: + """ + Parameters + ---------- + name : typing.Optional[str] + This is the name of the call. This is just for your own reference. + + assistant_id : typing.Optional[str] + This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + + assistant : typing.Optional[CreateAssistantDto] + This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. + + assistant_overrides : typing.Optional[AssistantOverrides] + These are the overrides for the `assistant` or `assistantId`'s settings and template variables. + + squad_id : typing.Optional[str] + This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + + squad : typing.Optional[CreateSquadDto] + This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + + phone_number_id : typing.Optional[str] + This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + + phone_number : typing.Optional[ImportTwilioPhoneNumberDto] + This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + + customer_id : typing.Optional[str] + This is the customer that will be called. To call a transient customer , use `customer` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + + customer : typing.Optional[CreateCustomerDto] + This is the customer that will be called. To call an existing customer, use `customerId` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Call + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.calls.create() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "call", + method="POST", + json={ + "name": name, + "assistantId": assistant_id, + "assistant": convert_and_respect_annotation_metadata( + object_=assistant, annotation=CreateAssistantDto, direction="write" + ), + "assistantOverrides": convert_and_respect_annotation_metadata( + object_=assistant_overrides, annotation=AssistantOverrides, direction="write" + ), + "squadId": squad_id, + "squad": convert_and_respect_annotation_metadata( + object_=squad, annotation=CreateSquadDto, direction="write" + ), + "phoneNumberId": phone_number_id, + "phoneNumber": convert_and_respect_annotation_metadata( + object_=phone_number, annotation=ImportTwilioPhoneNumberDto, direction="write" + ), + "customerId": customer_id, + "customer": convert_and_respect_annotation_metadata( + object_=customer, annotation=CreateCustomerDto, direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Call, + parse_obj_as( + type_=Call, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Call: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Call + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.calls.get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"call/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Call, + parse_obj_as( + type_=Call, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Call: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Call + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.calls.delete( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"call/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Call, + parse_obj_as( + type_=Call, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def update( + self, id: str, *, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> Call: + """ + Parameters + ---------- + id : str + + name : typing.Optional[str] + This is the name of the call. This is just for your own reference. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Call + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.calls.update( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"call/{jsonable_encoder(id)}", + method="PATCH", + json={ + "name": name, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Call, + parse_obj_as( + type_=Call, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/vapi/client.py b/src/vapi/client.py new file mode 100644 index 0000000..3c805ba --- /dev/null +++ b/src/vapi/client.py @@ -0,0 +1,172 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from .environment import VapiEnvironment +import httpx +from .core.client_wrapper import SyncClientWrapper +from .calls.client import CallsClient +from .assistants.client import AssistantsClient +from .phone_numbers.client import PhoneNumbersClient +from .squads.client import SquadsClient +from .blocks.client import BlocksClient +from .tools.client import ToolsClient +from .files.client import FilesClient +from .analytics.client import AnalyticsClient +from .logs.client import LogsClient +from .core.client_wrapper import AsyncClientWrapper +from .calls.client import AsyncCallsClient +from .assistants.client import AsyncAssistantsClient +from .phone_numbers.client import AsyncPhoneNumbersClient +from .squads.client import AsyncSquadsClient +from .blocks.client import AsyncBlocksClient +from .tools.client import AsyncToolsClient +from .files.client import AsyncFilesClient +from .analytics.client import AsyncAnalyticsClient +from .logs.client import AsyncLogsClient + + +class Vapi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. + + Parameters + ---------- + base_url : typing.Optional[str] + The base url to use for requests from the client. + + environment : VapiEnvironment + The environment to use for requests from the client. from .environment import VapiEnvironment + + + + Defaults to VapiEnvironment.DEFAULT + + + + token : typing.Union[str, typing.Callable[[], str]] + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. + + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. + + httpx_client : typing.Optional[httpx.Client] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + """ + + def __init__( + self, + *, + base_url: typing.Optional[str] = None, + environment: VapiEnvironment = VapiEnvironment.DEFAULT, + token: typing.Union[str, typing.Callable[[], str]], + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, + httpx_client: typing.Optional[httpx.Client] = None, + ): + _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None + self._client_wrapper = SyncClientWrapper( + base_url=_get_base_url(base_url=base_url, environment=environment), + token=token, + httpx_client=httpx_client + if httpx_client is not None + else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) + if follow_redirects is not None + else httpx.Client(timeout=_defaulted_timeout), + timeout=_defaulted_timeout, + ) + self.calls = CallsClient(client_wrapper=self._client_wrapper) + self.assistants = AssistantsClient(client_wrapper=self._client_wrapper) + self.phone_numbers = PhoneNumbersClient(client_wrapper=self._client_wrapper) + self.squads = SquadsClient(client_wrapper=self._client_wrapper) + self.blocks = BlocksClient(client_wrapper=self._client_wrapper) + self.tools = ToolsClient(client_wrapper=self._client_wrapper) + self.files = FilesClient(client_wrapper=self._client_wrapper) + self.analytics = AnalyticsClient(client_wrapper=self._client_wrapper) + self.logs = LogsClient(client_wrapper=self._client_wrapper) + + +class AsyncVapi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. + + Parameters + ---------- + base_url : typing.Optional[str] + The base url to use for requests from the client. + + environment : VapiEnvironment + The environment to use for requests from the client. from .environment import VapiEnvironment + + + + Defaults to VapiEnvironment.DEFAULT + + + + token : typing.Union[str, typing.Callable[[], str]] + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. + + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. + + httpx_client : typing.Optional[httpx.AsyncClient] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + + Examples + -------- + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + """ + + def __init__( + self, + *, + base_url: typing.Optional[str] = None, + environment: VapiEnvironment = VapiEnvironment.DEFAULT, + token: typing.Union[str, typing.Callable[[], str]], + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, + httpx_client: typing.Optional[httpx.AsyncClient] = None, + ): + _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None + self._client_wrapper = AsyncClientWrapper( + base_url=_get_base_url(base_url=base_url, environment=environment), + token=token, + httpx_client=httpx_client + if httpx_client is not None + else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) + if follow_redirects is not None + else httpx.AsyncClient(timeout=_defaulted_timeout), + timeout=_defaulted_timeout, + ) + self.calls = AsyncCallsClient(client_wrapper=self._client_wrapper) + self.assistants = AsyncAssistantsClient(client_wrapper=self._client_wrapper) + self.phone_numbers = AsyncPhoneNumbersClient(client_wrapper=self._client_wrapper) + self.squads = AsyncSquadsClient(client_wrapper=self._client_wrapper) + self.blocks = AsyncBlocksClient(client_wrapper=self._client_wrapper) + self.tools = AsyncToolsClient(client_wrapper=self._client_wrapper) + self.files = AsyncFilesClient(client_wrapper=self._client_wrapper) + self.analytics = AsyncAnalyticsClient(client_wrapper=self._client_wrapper) + self.logs = AsyncLogsClient(client_wrapper=self._client_wrapper) + + +def _get_base_url(*, base_url: typing.Optional[str] = None, environment: VapiEnvironment) -> str: + if base_url is not None: + return base_url + elif environment is not None: + return environment.value + else: + raise Exception("Please pass in either base_url or environment to construct the client") diff --git a/src/vapi/core/__init__.py b/src/vapi/core/__init__.py new file mode 100644 index 0000000..42031ad --- /dev/null +++ b/src/vapi/core/__init__.py @@ -0,0 +1,50 @@ +# This file was auto-generated by Fern from our API Definition. + +from .api_error import ApiError +from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper +from .datetime_utils import serialize_datetime +from .file import File, convert_file_dict_to_httpx_tuples, with_content_type +from .http_client import AsyncHttpClient, HttpClient +from .jsonable_encoder import jsonable_encoder +from .pagination import AsyncPager, SyncPager +from .pydantic_utilities import ( + IS_PYDANTIC_V2, + UniversalBaseModel, + UniversalRootModel, + parse_obj_as, + universal_field_validator, + universal_root_validator, + update_forward_refs, +) +from .query_encoder import encode_query +from .remove_none_from_dict import remove_none_from_dict +from .request_options import RequestOptions +from .serialization import FieldMetadata, convert_and_respect_annotation_metadata + +__all__ = [ + "ApiError", + "AsyncClientWrapper", + "AsyncHttpClient", + "AsyncPager", + "BaseClientWrapper", + "FieldMetadata", + "File", + "HttpClient", + "IS_PYDANTIC_V2", + "RequestOptions", + "SyncClientWrapper", + "SyncPager", + "UniversalBaseModel", + "UniversalRootModel", + "convert_and_respect_annotation_metadata", + "convert_file_dict_to_httpx_tuples", + "encode_query", + "jsonable_encoder", + "parse_obj_as", + "remove_none_from_dict", + "serialize_datetime", + "universal_field_validator", + "universal_root_validator", + "update_forward_refs", + "with_content_type", +] diff --git a/src/vapi/core/api_error.py b/src/vapi/core/api_error.py new file mode 100644 index 0000000..2e9fc54 --- /dev/null +++ b/src/vapi/core/api_error.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + + +class ApiError(Exception): + status_code: typing.Optional[int] + body: typing.Any + + def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None): + self.status_code = status_code + self.body = body + + def __str__(self) -> str: + return f"status_code: {self.status_code}, body: {self.body}" diff --git a/src/vapi/core/client_wrapper.py b/src/vapi/core/client_wrapper.py new file mode 100644 index 0000000..74e4085 --- /dev/null +++ b/src/vapi/core/client_wrapper.py @@ -0,0 +1,76 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import httpx +from .http_client import HttpClient +from .http_client import AsyncHttpClient + + +class BaseClientWrapper: + def __init__( + self, + *, + token: typing.Union[str, typing.Callable[[], str]], + base_url: str, + timeout: typing.Optional[float] = None, + ): + self._token = token + self._base_url = base_url + self._timeout = timeout + + def get_headers(self) -> typing.Dict[str, str]: + headers: typing.Dict[str, str] = { + "X-Fern-Language": "Python", + "X-Fern-SDK-Name": "Vapi", + "X-Fern-SDK-Version": "0.0.0", + } + headers["Authorization"] = f"Bearer {self._get_token()}" + return headers + + def _get_token(self) -> str: + if isinstance(self._token, str): + return self._token + else: + return self._token() + + def get_base_url(self) -> str: + return self._base_url + + def get_timeout(self) -> typing.Optional[float]: + return self._timeout + + +class SyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + token: typing.Union[str, typing.Callable[[], str]], + base_url: str, + timeout: typing.Optional[float] = None, + httpx_client: httpx.Client, + ): + super().__init__(token=token, base_url=base_url, timeout=timeout) + self.httpx_client = HttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers(), + base_timeout=self.get_timeout(), + base_url=self.get_base_url(), + ) + + +class AsyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + token: typing.Union[str, typing.Callable[[], str]], + base_url: str, + timeout: typing.Optional[float] = None, + httpx_client: httpx.AsyncClient, + ): + super().__init__(token=token, base_url=base_url, timeout=timeout) + self.httpx_client = AsyncHttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers(), + base_timeout=self.get_timeout(), + base_url=self.get_base_url(), + ) diff --git a/src/vapi/core/datetime_utils.py b/src/vapi/core/datetime_utils.py new file mode 100644 index 0000000..7c9864a --- /dev/null +++ b/src/vapi/core/datetime_utils.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt + + +def serialize_datetime(v: dt.datetime) -> str: + """ + Serialize a datetime including timezone info. + + Uses the timezone info provided if present, otherwise uses the current runtime's timezone info. + + UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00. + """ + + def _serialize_zoned_datetime(v: dt.datetime) -> str: + if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None): + # UTC is a special case where we use "Z" at the end instead of "+00:00" + return v.isoformat().replace("+00:00", "Z") + else: + # Delegate to the typical +/- offset format + return v.isoformat() + + if v.tzinfo is not None: + return _serialize_zoned_datetime(v) + else: + local_tz = dt.datetime.now().astimezone().tzinfo + localized_dt = v.replace(tzinfo=local_tz) + return _serialize_zoned_datetime(localized_dt) diff --git a/src/vapi/core/file.py b/src/vapi/core/file.py new file mode 100644 index 0000000..b4cbba3 --- /dev/null +++ b/src/vapi/core/file.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import IO, Dict, List, Mapping, Optional, Tuple, Union, cast + +# File typing inspired by the flexibility of types within the httpx library +# https://github.com/encode/httpx/blob/master/httpx/_types.py +FileContent = Union[IO[bytes], bytes, str] +File = Union[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + Tuple[Optional[str], FileContent], + # (filename, file (or bytes), content_type) + Tuple[Optional[str], FileContent, Optional[str]], + # (filename, file (or bytes), content_type, headers) + Tuple[ + Optional[str], + FileContent, + Optional[str], + Mapping[str, str], + ], +] + + +def convert_file_dict_to_httpx_tuples( + d: Dict[str, Union[File, List[File]]], +) -> List[Tuple[str, File]]: + """ + The format we use is a list of tuples, where the first element is the + name of the file and the second is the file object. Typically HTTPX wants + a dict, but to be able to send lists of files, you have to use the list + approach (which also works for non-lists) + https://github.com/encode/httpx/pull/1032 + """ + + httpx_tuples = [] + for key, file_like in d.items(): + if isinstance(file_like, list): + for file_like_item in file_like: + httpx_tuples.append((key, file_like_item)) + else: + httpx_tuples.append((key, file_like)) + return httpx_tuples + + +def with_content_type(*, file: File, content_type: str) -> File: + """ """ + if isinstance(file, tuple): + if len(file) == 2: + filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore + return (filename, content, content_type) + elif len(file) == 3: + filename, content, _ = cast(Tuple[Optional[str], FileContent, Optional[str]], file) # type: ignore + return (filename, content, content_type) + elif len(file) == 4: + filename, content, _, headers = cast( # type: ignore + Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], file + ) + return (filename, content, content_type, headers) + else: + raise ValueError(f"Unexpected tuple length: {len(file)}") + return (None, file, content_type) diff --git a/src/vapi/core/http_client.py b/src/vapi/core/http_client.py new file mode 100644 index 0000000..b07401b --- /dev/null +++ b/src/vapi/core/http_client.py @@ -0,0 +1,477 @@ +# This file was auto-generated by Fern from our API Definition. + +import asyncio +import email.utils +import json +import re +import time +import typing +import urllib.parse +from contextlib import asynccontextmanager, contextmanager +from random import random + +import httpx + +from .file import File, convert_file_dict_to_httpx_tuples +from .jsonable_encoder import jsonable_encoder +from .query_encoder import encode_query +from .remove_none_from_dict import remove_none_from_dict +from .request_options import RequestOptions + +INITIAL_RETRY_DELAY_SECONDS = 0.5 +MAX_RETRY_DELAY_SECONDS = 10 +MAX_RETRY_DELAY_SECONDS_FROM_HEADER = 30 + + +def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]: + """ + This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait. + + Inspired by the urllib3 retry implementation. + """ + retry_after_ms = response_headers.get("retry-after-ms") + if retry_after_ms is not None: + try: + return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0 + except Exception: + pass + + retry_after = response_headers.get("retry-after") + if retry_after is None: + return None + + # Attempt to parse the header as an int. + if re.match(r"^\s*[0-9]+\s*$", retry_after): + seconds = float(retry_after) + # Fallback to parsing it as a date. + else: + retry_date_tuple = email.utils.parsedate_tz(retry_after) + if retry_date_tuple is None: + return None + if retry_date_tuple[9] is None: # Python 2 + # Assume UTC if no timezone was specified + # On Python2.7, parsedate_tz returns None for a timezone offset + # instead of 0 if no timezone is given, where mktime_tz treats + # a None timezone offset as local time. + retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:] + + retry_date = email.utils.mktime_tz(retry_date_tuple) + seconds = retry_date - time.time() + + if seconds < 0: + seconds = 0 + + return seconds + + +def _retry_timeout(response: httpx.Response, retries: int) -> float: + """ + Determine the amount of time to wait before retrying a request. + This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff + with a jitter to determine the number of seconds to wait. + """ + + # If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says. + retry_after = _parse_retry_after(response.headers) + if retry_after is not None and retry_after <= MAX_RETRY_DELAY_SECONDS_FROM_HEADER: + return retry_after + + # Apply exponential backoff, capped at MAX_RETRY_DELAY_SECONDS. + retry_delay = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS) + + # Add a randomness / jitter to the retry delay to avoid overwhelming the server with retries. + timeout = retry_delay * (1 - 0.25 * random()) + return timeout if timeout >= 0 else 0 + + +def _should_retry(response: httpx.Response) -> bool: + retriable_400s = [429, 408, 409] + return response.status_code >= 500 or response.status_code in retriable_400s + + +def remove_omit_from_dict( + original: typing.Dict[str, typing.Optional[typing.Any]], + omit: typing.Optional[typing.Any], +) -> typing.Dict[str, typing.Any]: + if omit is None: + return original + new: typing.Dict[str, typing.Any] = {} + for key, value in original.items(): + if value is not omit: + new[key] = value + return new + + +def maybe_filter_request_body( + data: typing.Optional[typing.Any], + request_options: typing.Optional[RequestOptions], + omit: typing.Optional[typing.Any], +) -> typing.Optional[typing.Any]: + if data is None: + return ( + jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} + if request_options is not None + else None + ) + elif not isinstance(data, typing.Mapping): + data_content = jsonable_encoder(data) + else: + data_content = { + **(jsonable_encoder(remove_omit_from_dict(data, omit))), # type: ignore + **( + jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} + if request_options is not None + else {} + ), + } + return data_content + + +# Abstracted out for testing purposes +def get_request_body( + *, + json: typing.Optional[typing.Any], + data: typing.Optional[typing.Any], + request_options: typing.Optional[RequestOptions], + omit: typing.Optional[typing.Any], +) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Any]]: + json_body = None + data_body = None + if data is not None: + data_body = maybe_filter_request_body(data, request_options, omit) + else: + # If both data and json are None, we send json data in the event extra properties are specified + json_body = maybe_filter_request_body(json, request_options, omit) + + # If you have an empty JSON body, you should just send None + return (json_body if json_body != {} else None), data_body if data_body != {} else None + + +class HttpClient: + def __init__( + self, + *, + httpx_client: httpx.Client, + base_timeout: typing.Optional[float], + base_headers: typing.Dict[str, str], + base_url: typing.Optional[str] = None, + ): + self.base_url = base_url + self.base_timeout = base_timeout + self.base_headers = base_headers + self.httpx_client = httpx_client + + def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: + base_url = self.base_url if maybe_base_url is None else maybe_base_url + if base_url is None: + raise ValueError("A base_url is required to make this request, please provide one and try again.") + return base_url + + def request( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 0, + omit: typing.Optional[typing.Any] = None, + ) -> httpx.Response: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout + ) + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + response = self.httpx_client.request( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers, + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) or {} + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) if files is not None else None, + timeout=timeout, + ) + + max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 + if _should_retry(response=response): + if max_retries > retries: + time.sleep(_retry_timeout(response=response, retries=retries)) + return self.request( + path=path, + method=method, + base_url=base_url, + params=params, + json=json, + content=content, + files=files, + headers=headers, + request_options=request_options, + retries=retries + 1, + omit=omit, + ) + + return response + + @contextmanager + def stream( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 0, + omit: typing.Optional[typing.Any] = None, + ) -> typing.Iterator[httpx.Response]: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout + ) + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + with self.httpx_client.stream( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers, + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) if files is not None else None, + timeout=timeout, + ) as stream: + yield stream + + +class AsyncHttpClient: + def __init__( + self, + *, + httpx_client: httpx.AsyncClient, + base_timeout: typing.Optional[float], + base_headers: typing.Dict[str, str], + base_url: typing.Optional[str] = None, + ): + self.base_url = base_url + self.base_timeout = base_timeout + self.base_headers = base_headers + self.httpx_client = httpx_client + + def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: + base_url = self.base_url if maybe_base_url is None else maybe_base_url + if base_url is None: + raise ValueError("A base_url is required to make this request, please provide one and try again.") + return base_url + + async def request( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 0, + omit: typing.Optional[typing.Any] = None, + ) -> httpx.Response: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout + ) + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + # Add the input to each of these and do None-safety checks + response = await self.httpx_client.request( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers, + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) or {} + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) if files is not None else None, + timeout=timeout, + ) + + max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 + if _should_retry(response=response): + if max_retries > retries: + await asyncio.sleep(_retry_timeout(response=response, retries=retries)) + return await self.request( + path=path, + method=method, + base_url=base_url, + params=params, + json=json, + content=content, + files=files, + headers=headers, + request_options=request_options, + retries=retries + 1, + omit=omit, + ) + return response + + @asynccontextmanager + async def stream( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 0, + omit: typing.Optional[typing.Any] = None, + ) -> typing.AsyncIterator[httpx.Response]: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout + ) + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + async with self.httpx_client.stream( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers, + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + }, + omit=omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) if files is not None else None, + timeout=timeout, + ) as stream: + yield stream diff --git a/src/vapi/core/jsonable_encoder.py b/src/vapi/core/jsonable_encoder.py new file mode 100644 index 0000000..1b631e9 --- /dev/null +++ b/src/vapi/core/jsonable_encoder.py @@ -0,0 +1,101 @@ +# This file was auto-generated by Fern from our API Definition. + +""" +jsonable_encoder converts a Python object to a JSON-friendly dict +(e.g. datetimes to strings, Pydantic models to dicts). + +Taken from FastAPI, and made a bit simpler +https://github.com/tiangolo/fastapi/blob/master/fastapi/encoders.py +""" + +import base64 +import dataclasses +import datetime as dt +from enum import Enum +from pathlib import PurePath +from types import GeneratorType +from typing import Any, Callable, Dict, List, Optional, Set, Union + +import pydantic + +from .datetime_utils import serialize_datetime +from .pydantic_utilities import ( + IS_PYDANTIC_V2, + encode_by_type, + to_jsonable_with_fallback, +) + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] + + +def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any: + custom_encoder = custom_encoder or {} + if custom_encoder: + if type(obj) in custom_encoder: + return custom_encoder[type(obj)](obj) + else: + for encoder_type, encoder_instance in custom_encoder.items(): + if isinstance(obj, encoder_type): + return encoder_instance(obj) + if isinstance(obj, pydantic.BaseModel): + if IS_PYDANTIC_V2: + encoder = getattr(obj.model_config, "json_encoders", {}) # type: ignore # Pydantic v2 + else: + encoder = getattr(obj.__config__, "json_encoders", {}) # type: ignore # Pydantic v1 + if custom_encoder: + encoder.update(custom_encoder) + obj_dict = obj.dict(by_alias=True) + if "__root__" in obj_dict: + obj_dict = obj_dict["__root__"] + if "root" in obj_dict: + obj_dict = obj_dict["root"] + return jsonable_encoder(obj_dict, custom_encoder=encoder) + if dataclasses.is_dataclass(obj): + obj_dict = dataclasses.asdict(obj) # type: ignore + return jsonable_encoder(obj_dict, custom_encoder=custom_encoder) + if isinstance(obj, bytes): + return base64.b64encode(obj).decode("utf-8") + if isinstance(obj, Enum): + return obj.value + if isinstance(obj, PurePath): + return str(obj) + if isinstance(obj, (str, int, float, type(None))): + return obj + if isinstance(obj, dt.datetime): + return serialize_datetime(obj) + if isinstance(obj, dt.date): + return str(obj) + if isinstance(obj, dict): + encoded_dict = {} + allowed_keys = set(obj.keys()) + for key, value in obj.items(): + if key in allowed_keys: + encoded_key = jsonable_encoder(key, custom_encoder=custom_encoder) + encoded_value = jsonable_encoder(value, custom_encoder=custom_encoder) + encoded_dict[encoded_key] = encoded_value + return encoded_dict + if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)): + encoded_list = [] + for item in obj: + encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder)) + return encoded_list + + def fallback_serializer(o: Any) -> Any: + attempt_encode = encode_by_type(o) + if attempt_encode is not None: + return attempt_encode + + try: + data = dict(o) + except Exception as e: + errors: List[Exception] = [] + errors.append(e) + try: + data = vars(o) + except Exception as e: + errors.append(e) + raise ValueError(errors) from e + return jsonable_encoder(data, custom_encoder=custom_encoder) + + return to_jsonable_with_fallback(obj, fallback_serializer) diff --git a/src/vapi/core/pagination.py b/src/vapi/core/pagination.py new file mode 100644 index 0000000..5f48263 --- /dev/null +++ b/src/vapi/core/pagination.py @@ -0,0 +1,88 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from typing_extensions import Self + +import pydantic + +# Generic to represent the underlying type of the results within a page +T = typing.TypeVar("T") + + +# SDKs implement a Page ABC per-pagination request, the endpoint then retuns a pager that wraps this type +# for example, an endpoint will return SyncPager[UserPage] where UserPage implements the Page ABC. ex: +# +# SyncPager( +# has_next=response.list_metadata.after is not None, +# items=response.data, +# # This should be the outer function that returns the SyncPager again +# get_next=lambda: list(..., cursor: response.cursor) (or list(..., offset: offset + 1)) +# ) +class BasePage(pydantic.BaseModel, typing.Generic[T]): + has_next: bool + items: typing.Optional[typing.List[T]] + + +class SyncPage(BasePage[T], typing.Generic[T]): + get_next: typing.Optional[typing.Callable[[], typing.Optional[Self]]] + + +class AsyncPage(BasePage[T], typing.Generic[T]): + get_next: typing.Optional[typing.Callable[[], typing.Awaitable[typing.Optional[Self]]]] + + +# ---------------------------- + + +class SyncPager(SyncPage[T], typing.Generic[T]): + # Here we type ignore the iterator to avoid a mypy error + # caused by the type conflict with Pydanitc's __iter__ method + # brought in by extending the base model + def __iter__(self) -> typing.Iterator[T]: # type: ignore + for page in self.iter_pages(): + if page.items is not None: + for item in page.items: + yield item + + def iter_pages(self) -> typing.Iterator[SyncPage[T]]: + page: typing.Union[SyncPager[T], None] = self + while True: + if page is not None: + yield page + if page.has_next and page.get_next is not None: + page = page.get_next() + if page is None or page.items is None or len(page.items) == 0: + return + else: + return + else: + return + + def next_page(self) -> typing.Optional[SyncPage[T]]: + return self.get_next() if self.get_next is not None else None + + +class AsyncPager(AsyncPage[T], typing.Generic[T]): + async def __aiter__(self) -> typing.AsyncIterator[T]: # type: ignore + async for page in self.iter_pages(): + if page.items is not None: + for item in page.items: + yield item + + async def iter_pages(self) -> typing.AsyncIterator[AsyncPage[T]]: + page: typing.Union[AsyncPager[T], None] = self + while True: + if page is not None: + yield page + if page is not None and page.has_next and page.get_next is not None: + page = await page.get_next() + if page is None or page.items is None or len(page.items) == 0: + return + else: + return + else: + return + + async def next_page(self) -> typing.Optional[AsyncPage[T]]: + return await self.get_next() if self.get_next is not None else None diff --git a/src/vapi/core/pydantic_utilities.py b/src/vapi/core/pydantic_utilities.py new file mode 100644 index 0000000..a0875ac --- /dev/null +++ b/src/vapi/core/pydantic_utilities.py @@ -0,0 +1,273 @@ +# This file was auto-generated by Fern from our API Definition. + +# nopycln: file +import datetime as dt +import typing +from collections import defaultdict + +import typing_extensions + +import pydantic + +from .datetime_utils import serialize_datetime +from .serialization import convert_and_respect_annotation_metadata + +IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") + +if IS_PYDANTIC_V2: + # isort will try to reformat the comments on these imports, which breaks mypy + # isort: off + from pydantic.v1.datetime_parse import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 + parse_date as parse_date, + ) + from pydantic.v1.datetime_parse import ( # pyright: ignore[reportMissingImports] # Pydantic v2 + parse_datetime as parse_datetime, + ) + from pydantic.v1.json import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 + ENCODERS_BY_TYPE as encoders_by_type, + ) + from pydantic.v1.typing import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 + get_args as get_args, + ) + from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 + get_origin as get_origin, + ) + from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 + is_literal_type as is_literal_type, + ) + from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 + is_union as is_union, + ) + from pydantic.v1.fields import ModelField as ModelField # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 +else: + from pydantic.datetime_parse import parse_date as parse_date # type: ignore # Pydantic v1 + from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore # Pydantic v1 + from pydantic.fields import ModelField as ModelField # type: ignore # Pydantic v1 + from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore # Pydantic v1 + from pydantic.typing import get_args as get_args # type: ignore # Pydantic v1 + from pydantic.typing import get_origin as get_origin # type: ignore # Pydantic v1 + from pydantic.typing import is_literal_type as is_literal_type # type: ignore # Pydantic v1 + from pydantic.typing import is_union as is_union # type: ignore # Pydantic v1 + + # isort: on + + +T = typing.TypeVar("T") +Model = typing.TypeVar("Model", bound=pydantic.BaseModel) + + +def parse_obj_as(type_: typing.Type[T], object_: typing.Any) -> T: + dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read") + if IS_PYDANTIC_V2: + adapter = pydantic.TypeAdapter(type_) # type: ignore # Pydantic v2 + return adapter.validate_python(dealiased_object) + else: + return pydantic.parse_obj_as(type_, dealiased_object) + + +def to_jsonable_with_fallback( + obj: typing.Any, fallback_serializer: typing.Callable[[typing.Any], typing.Any] +) -> typing.Any: + if IS_PYDANTIC_V2: + from pydantic_core import to_jsonable_python + + return to_jsonable_python(obj, fallback=fallback_serializer) + else: + return fallback_serializer(obj) + + +class UniversalBaseModel(pydantic.BaseModel): + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( + # Allow fields begining with `model_` to be used in the model + protected_namespaces=(), + ) # type: ignore # Pydantic v2 + + @pydantic.model_serializer(mode="wrap", when_used="json") # type: ignore # Pydantic v2 + def serialize_model(self, handler: pydantic.SerializerFunctionWrapHandler) -> typing.Any: # type: ignore # Pydantic v2 + serialized = handler(self) + data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()} + return data + + else: + + class Config: + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} + + @classmethod + def model_construct( + cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any + ) -> Model: + dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") + return cls.construct(_fields_set, **dealiased_object) + + @classmethod + def construct( + cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any + ) -> Model: + dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") + if IS_PYDANTIC_V2: + return super().model_construct(_fields_set, **dealiased_object) # type: ignore # Pydantic v2 + else: + return super().construct(_fields_set, **dealiased_object) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + if IS_PYDANTIC_V2: + return super().model_dump_json(**kwargs_with_defaults) # type: ignore # Pydantic v2 + else: + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + """ + Override the default dict method to `exclude_unset` by default. This function patches + `exclude_unset` to work include fields within non-None default values. + """ + # Note: the logic here is multi-plexed given the levers exposed in Pydantic V1 vs V2 + # Pydantic V1's .dict can be extremely slow, so we do not want to call it twice. + # + # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models + # that we have less control over, and this is less intrusive than custom serializers for now. + if IS_PYDANTIC_V2: + kwargs_with_defaults_exclude_unset: typing.Any = { + **kwargs, + "by_alias": True, + "exclude_unset": True, + "exclude_none": False, + } + kwargs_with_defaults_exclude_none: typing.Any = { + **kwargs, + "by_alias": True, + "exclude_none": True, + "exclude_unset": False, + } + dict_dump = deep_union_pydantic_dicts( + super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore # Pydantic v2 + super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore # Pydantic v2 + ) + + else: + _fields_set = self.__fields_set__ + + fields = _get_model_fields(self.__class__) + for name, field in fields.items(): + if name not in _fields_set: + default = _get_field_default(field) + + # If the default values are non-null act like they've been set + # This effectively allows exclude_unset to work like exclude_none where + # the latter passes through intentionally set none values. + if default != None: + _fields_set.add(name) + + kwargs_with_defaults_exclude_unset_include_fields: typing.Any = { + "by_alias": True, + "exclude_unset": True, + "include": _fields_set, + **kwargs, + } + + dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields) + + return convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write") + + +def deep_union_pydantic_dicts( + source: typing.Dict[str, typing.Any], destination: typing.Dict[str, typing.Any] +) -> typing.Dict[str, typing.Any]: + for key, value in source.items(): + if isinstance(value, dict): + node = destination.setdefault(key, {}) + deep_union_pydantic_dicts(value, node) + else: + destination[key] = value + + return destination + + +if IS_PYDANTIC_V2: + + class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore # Pydantic v2 + pass + + UniversalRootModel: typing_extensions.TypeAlias = V2RootModel # type: ignore +else: + UniversalRootModel: typing_extensions.TypeAlias = UniversalBaseModel # type: ignore + + +def encode_by_type(o: typing.Any) -> typing.Any: + encoders_by_class_tuples: typing.Dict[typing.Callable[[typing.Any], typing.Any], typing.Tuple[typing.Any, ...]] = ( + defaultdict(tuple) + ) + for type_, encoder in encoders_by_type.items(): + encoders_by_class_tuples[encoder] += (type_,) + + if type(o) in encoders_by_type: + return encoders_by_type[type(o)](o) + for encoder, classes_tuple in encoders_by_class_tuples.items(): + if isinstance(o, classes_tuple): + return encoder(o) + + +def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None: + if IS_PYDANTIC_V2: + model.model_rebuild(raise_errors=False) # type: ignore # Pydantic v2 + else: + model.update_forward_refs(**localns) + + +# Mirrors Pydantic's internal typing +AnyCallable = typing.Callable[..., typing.Any] + + +def universal_root_validator( + pre: bool = False, +) -> typing.Callable[[AnyCallable], AnyCallable]: + def decorator(func: AnyCallable) -> AnyCallable: + if IS_PYDANTIC_V2: + return pydantic.model_validator(mode="before" if pre else "after")(func) # type: ignore # Pydantic v2 + else: + return pydantic.root_validator(pre=pre)(func) # type: ignore # Pydantic v1 + + return decorator + + +def universal_field_validator(field_name: str, pre: bool = False) -> typing.Callable[[AnyCallable], AnyCallable]: + def decorator(func: AnyCallable) -> AnyCallable: + if IS_PYDANTIC_V2: + return pydantic.field_validator(field_name, mode="before" if pre else "after")(func) # type: ignore # Pydantic v2 + else: + return pydantic.validator(field_name, pre=pre)(func) # type: ignore # Pydantic v1 + + return decorator + + +PydanticField = typing.Union[ModelField, pydantic.fields.FieldInfo] + + +def _get_model_fields( + model: typing.Type["Model"], +) -> typing.Mapping[str, PydanticField]: + if IS_PYDANTIC_V2: + return model.model_fields # type: ignore # Pydantic v2 + else: + return model.__fields__ # type: ignore # Pydantic v1 + + +def _get_field_default(field: PydanticField) -> typing.Any: + try: + value = field.get_default() # type: ignore # Pydantic < v1.10.15 + except: + value = field.default + if IS_PYDANTIC_V2: + from pydantic_core import PydanticUndefined + + if value == PydanticUndefined: + return None + return value + return value diff --git a/src/vapi/core/query_encoder.py b/src/vapi/core/query_encoder.py new file mode 100644 index 0000000..3183001 --- /dev/null +++ b/src/vapi/core/query_encoder.py @@ -0,0 +1,58 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, List, Optional, Tuple + +import pydantic + + +# Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict +def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]: + result = [] + for k, v in dict_flat.items(): + key = f"{key_prefix}[{k}]" if key_prefix is not None else k + if isinstance(v, dict): + result.extend(traverse_query_dict(v, key)) + elif isinstance(v, list): + for arr_v in v: + if isinstance(arr_v, dict): + result.extend(traverse_query_dict(arr_v, key)) + else: + result.append((key, arr_v)) + else: + result.append((key, v)) + return result + + +def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, Any]]: + if isinstance(query_value, pydantic.BaseModel) or isinstance(query_value, dict): + if isinstance(query_value, pydantic.BaseModel): + obj_dict = query_value.dict(by_alias=True) + else: + obj_dict = query_value + return traverse_query_dict(obj_dict, query_key) + elif isinstance(query_value, list): + encoded_values: List[Tuple[str, Any]] = [] + for value in query_value: + if isinstance(value, pydantic.BaseModel) or isinstance(value, dict): + if isinstance(value, pydantic.BaseModel): + obj_dict = value.dict(by_alias=True) + elif isinstance(value, dict): + obj_dict = value + + encoded_values.extend(single_query_encoder(query_key, obj_dict)) + else: + encoded_values.append((query_key, value)) + + return encoded_values + + return [(query_key, query_value)] + + +def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]: + if query is None: + return None + + encoded_query = [] + for k, v in query.items(): + encoded_query.extend(single_query_encoder(k, v)) + return encoded_query diff --git a/src/vapi/core/remove_none_from_dict.py b/src/vapi/core/remove_none_from_dict.py new file mode 100644 index 0000000..c229814 --- /dev/null +++ b/src/vapi/core/remove_none_from_dict.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, Mapping, Optional + + +def remove_none_from_dict(original: Mapping[str, Optional[Any]]) -> Dict[str, Any]: + new: Dict[str, Any] = {} + for key, value in original.items(): + if value is not None: + new[key] = value + return new diff --git a/src/vapi/core/request_options.py b/src/vapi/core/request_options.py new file mode 100644 index 0000000..d0bf0db --- /dev/null +++ b/src/vapi/core/request_options.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +try: + from typing import NotRequired # type: ignore +except ImportError: + from typing_extensions import NotRequired + + +class RequestOptions(typing.TypedDict, total=False): + """ + Additional options for request-specific configuration when calling APIs via the SDK. + This is used primarily as an optional final parameter for service functions. + + Attributes: + - timeout_in_seconds: int. The number of seconds to await an API call before timing out. + + - max_retries: int. The max number of retries to attempt if the API call fails. + + - additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict + + - additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict + + - additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict + """ + + timeout_in_seconds: NotRequired[int] + max_retries: NotRequired[int] + additional_headers: NotRequired[typing.Dict[str, typing.Any]] + additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]] + additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]] diff --git a/src/vapi/core/serialization.py b/src/vapi/core/serialization.py new file mode 100644 index 0000000..5605f1b --- /dev/null +++ b/src/vapi/core/serialization.py @@ -0,0 +1,254 @@ +# This file was auto-generated by Fern from our API Definition. + +import collections +import inspect +import typing + +import typing_extensions + +import pydantic + + +class FieldMetadata: + """ + Metadata class used to annotate fields to provide additional information. + + Example: + class MyDict(TypedDict): + field: typing.Annotated[str, FieldMetadata(alias="field_name")] + + Will serialize: `{"field": "value"}` + To: `{"field_name": "value"}` + """ + + alias: str + + def __init__(self, *, alias: str) -> None: + self.alias = alias + + +def convert_and_respect_annotation_metadata( + *, + object_: typing.Any, + annotation: typing.Any, + inner_type: typing.Optional[typing.Any] = None, + direction: typing.Literal["read", "write"], +) -> typing.Any: + """ + Respect the metadata annotations on a field, such as aliasing. This function effectively + manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for + TypedDicts, which cannot support aliasing out of the box, and can be extended for additional + utilities, such as defaults. + + Parameters + ---------- + object_ : typing.Any + + annotation : type + The type we're looking to apply typing annotations from + + inner_type : typing.Optional[type] + + Returns + ------- + typing.Any + """ + + if object_ is None: + return None + if inner_type is None: + inner_type = annotation + + clean_type = _remove_annotations(inner_type) + # Pydantic models + if ( + inspect.isclass(clean_type) + and issubclass(clean_type, pydantic.BaseModel) + and isinstance(object_, typing.Mapping) + ): + return _convert_mapping(object_, clean_type, direction) + # TypedDicts + if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping): + return _convert_mapping(object_, clean_type, direction) + + # If you're iterating on a string, do not bother to coerce it to a sequence. + if not isinstance(object_, str): + if ( + typing_extensions.get_origin(clean_type) == typing.Set + or typing_extensions.get_origin(clean_type) == set + or clean_type == typing.Set + ) and isinstance(object_, typing.Set): + inner_type = typing_extensions.get_args(clean_type)[0] + return { + convert_and_respect_annotation_metadata( + object_=item, + annotation=annotation, + inner_type=inner_type, + direction=direction, + ) + for item in object_ + } + elif ( + ( + typing_extensions.get_origin(clean_type) == typing.List + or typing_extensions.get_origin(clean_type) == list + or clean_type == typing.List + ) + and isinstance(object_, typing.List) + ) or ( + ( + typing_extensions.get_origin(clean_type) == typing.Sequence + or typing_extensions.get_origin(clean_type) == collections.abc.Sequence + or clean_type == typing.Sequence + ) + and isinstance(object_, typing.Sequence) + ): + inner_type = typing_extensions.get_args(clean_type)[0] + return [ + convert_and_respect_annotation_metadata( + object_=item, + annotation=annotation, + inner_type=inner_type, + direction=direction, + ) + for item in object_ + ] + + if typing_extensions.get_origin(clean_type) == typing.Union: + # We should be able to ~relatively~ safely try to convert keys against all + # member types in the union, the edge case here is if one member aliases a field + # of the same name to a different name from another member + # Or if another member aliases a field of the same name that another member does not. + for member in typing_extensions.get_args(clean_type): + object_ = convert_and_respect_annotation_metadata( + object_=object_, + annotation=annotation, + inner_type=member, + direction=direction, + ) + return object_ + + annotated_type = _get_annotation(annotation) + if annotated_type is None: + return object_ + + # If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.) + # Then we can safely call it on the recursive conversion. + return object_ + + +def _convert_mapping( + object_: typing.Mapping[str, object], + expected_type: typing.Any, + direction: typing.Literal["read", "write"], +) -> typing.Mapping[str, object]: + converted_object: typing.Dict[str, object] = {} + annotations = typing_extensions.get_type_hints(expected_type, include_extras=True) + aliases_to_field_names = _get_alias_to_field_name(annotations) + for key, value in object_.items(): + if direction == "read" and key in aliases_to_field_names: + dealiased_key = aliases_to_field_names.get(key) + if dealiased_key is not None: + type_ = annotations.get(dealiased_key) + else: + type_ = annotations.get(key) + # Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map + # + # So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias + # then we can just pass the value through as is + if type_ is None: + converted_object[key] = value + elif direction == "read" and key not in aliases_to_field_names: + converted_object[key] = convert_and_respect_annotation_metadata( + object_=value, annotation=type_, direction=direction + ) + else: + converted_object[_alias_key(key, type_, direction, aliases_to_field_names)] = ( + convert_and_respect_annotation_metadata(object_=value, annotation=type_, direction=direction) + ) + return converted_object + + +def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]: + maybe_annotated_type = typing_extensions.get_origin(type_) + if maybe_annotated_type is None: + return None + + if maybe_annotated_type == typing_extensions.NotRequired: + type_ = typing_extensions.get_args(type_)[0] + maybe_annotated_type = typing_extensions.get_origin(type_) + + if maybe_annotated_type == typing_extensions.Annotated: + return type_ + + return None + + +def _remove_annotations(type_: typing.Any) -> typing.Any: + maybe_annotated_type = typing_extensions.get_origin(type_) + if maybe_annotated_type is None: + return type_ + + if maybe_annotated_type == typing_extensions.NotRequired: + return _remove_annotations(typing_extensions.get_args(type_)[0]) + + if maybe_annotated_type == typing_extensions.Annotated: + return _remove_annotations(typing_extensions.get_args(type_)[0]) + + return type_ + + +def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]: + annotations = typing_extensions.get_type_hints(type_, include_extras=True) + return _get_alias_to_field_name(annotations) + + +def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]: + annotations = typing_extensions.get_type_hints(type_, include_extras=True) + return _get_field_to_alias_name(annotations) + + +def _get_alias_to_field_name( + field_to_hint: typing.Dict[str, typing.Any], +) -> typing.Dict[str, str]: + aliases = {} + for field, hint in field_to_hint.items(): + maybe_alias = _get_alias_from_type(hint) + if maybe_alias is not None: + aliases[maybe_alias] = field + return aliases + + +def _get_field_to_alias_name( + field_to_hint: typing.Dict[str, typing.Any], +) -> typing.Dict[str, str]: + aliases = {} + for field, hint in field_to_hint.items(): + maybe_alias = _get_alias_from_type(hint) + if maybe_alias is not None: + aliases[field] = maybe_alias + return aliases + + +def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]: + maybe_annotated_type = _get_annotation(type_) + + if maybe_annotated_type is not None: + # The actual annotations are 1 onward, the first is the annotated type + annotations = typing_extensions.get_args(maybe_annotated_type)[1:] + + for annotation in annotations: + if isinstance(annotation, FieldMetadata) and annotation.alias is not None: + return annotation.alias + return None + + +def _alias_key( + key: str, + type_: typing.Any, + direction: typing.Literal["read", "write"], + aliases_to_field_names: typing.Dict[str, str], +) -> str: + if direction == "read": + return aliases_to_field_names.get(key, key) + return _get_alias_from_type(type_=type_) or key diff --git a/src/vapi/environment.py b/src/vapi/environment.py new file mode 100644 index 0000000..28f6472 --- /dev/null +++ b/src/vapi/environment.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum + + +class VapiEnvironment(enum.Enum): + DEFAULT = "https://api.vapi.ai" diff --git a/src/vapi/errors/__init__.py b/src/vapi/errors/__init__.py new file mode 100644 index 0000000..14350df --- /dev/null +++ b/src/vapi/errors/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .bad_request_error import BadRequestError + +__all__ = ["BadRequestError"] diff --git a/src/vapi/errors/bad_request_error.py b/src/vapi/errors/bad_request_error.py new file mode 100644 index 0000000..9c13c61 --- /dev/null +++ b/src/vapi/errors/bad_request_error.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.api_error import ApiError +import typing + + +class BadRequestError(ApiError): + def __init__(self, body: typing.Optional[typing.Any]): + super().__init__(status_code=400, body=body) diff --git a/src/vapi/files/__init__.py b/src/vapi/files/__init__.py new file mode 100644 index 0000000..f3ea265 --- /dev/null +++ b/src/vapi/files/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/vapi/files/client.py b/src/vapi/files/client.py new file mode 100644 index 0000000..12af218 --- /dev/null +++ b/src/vapi/files/client.py @@ -0,0 +1,544 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ..core.client_wrapper import SyncClientWrapper +from ..core.request_options import RequestOptions +from ..types.file import File +from ..core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from .. import core +from ..errors.bad_request_error import BadRequestError +from ..core.jsonable_encoder import jsonable_encoder +from ..core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class FilesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[File]: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[File] + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.files.list() + """ + _response = self._client_wrapper.httpx_client.request( + "file", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[File], + parse_obj_as( + type_=typing.List[File], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def create(self, *, file: core.File, request_options: typing.Optional[RequestOptions] = None) -> File: + """ + Parameters + ---------- + file : core.File + See core.File for more documentation + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + File + File uploaded successfully + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.files.create() + """ + _response = self._client_wrapper.httpx_client.request( + "file", + method="POST", + data={}, + files={ + "file": file, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + File, + parse_obj_as( + type_=File, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestError( + typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> File: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + File + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.files.get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"file/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + File, + parse_obj_as( + type_=File, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> File: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + File + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.files.delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"file/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + File, + parse_obj_as( + type_=File, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def update( + self, id: str, *, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> File: + """ + Parameters + ---------- + id : str + + name : typing.Optional[str] + This is the name of the file. This is just for your own reference. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + File + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.files.update( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"file/{jsonable_encoder(id)}", + method="PATCH", + json={ + "name": name, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + File, + parse_obj_as( + type_=File, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncFilesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[File]: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[File] + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.files.list() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "file", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[File], + parse_obj_as( + type_=typing.List[File], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def create(self, *, file: core.File, request_options: typing.Optional[RequestOptions] = None) -> File: + """ + Parameters + ---------- + file : core.File + See core.File for more documentation + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + File + File uploaded successfully + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.files.create() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "file", + method="POST", + data={}, + files={ + "file": file, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + File, + parse_obj_as( + type_=File, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestError( + typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> File: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + File + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.files.get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"file/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + File, + parse_obj_as( + type_=File, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> File: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + File + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.files.delete( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"file/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + File, + parse_obj_as( + type_=File, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def update( + self, id: str, *, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + ) -> File: + """ + Parameters + ---------- + id : str + + name : typing.Optional[str] + This is the name of the file. This is just for your own reference. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + File + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.files.update( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"file/{jsonable_encoder(id)}", + method="PATCH", + json={ + "name": name, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + File, + parse_obj_as( + type_=File, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/vapi/logs/__init__.py b/src/vapi/logs/__init__.py new file mode 100644 index 0000000..7e2f04b --- /dev/null +++ b/src/vapi/logs/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import LogsGetRequestSortOrder, LogsGetRequestType + +__all__ = ["LogsGetRequestSortOrder", "LogsGetRequestType"] diff --git a/src/vapi/logs/client.py b/src/vapi/logs/client.py new file mode 100644 index 0000000..749b015 --- /dev/null +++ b/src/vapi/logs/client.py @@ -0,0 +1,304 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.client_wrapper import SyncClientWrapper +import typing +from .types.logs_get_request_type import LogsGetRequestType +from .types.logs_get_request_sort_order import LogsGetRequestSortOrder +import datetime as dt +from ..core.request_options import RequestOptions +from ..types.logs_paginated_response import LogsPaginatedResponse +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper + + +class LogsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get( + self, + *, + org_id: typing.Optional[str] = None, + type: typing.Optional[LogsGetRequestType] = None, + assistant_id: typing.Optional[str] = None, + phone_number_id: typing.Optional[str] = None, + customer_id: typing.Optional[str] = None, + squad_id: typing.Optional[str] = None, + call_id: typing.Optional[str] = None, + page: typing.Optional[float] = None, + sort_order: typing.Optional[LogsGetRequestSortOrder] = None, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> LogsPaginatedResponse: + """ + Parameters + ---------- + org_id : typing.Optional[str] + This is the unique identifier for the org that this log belongs to. + + type : typing.Optional[LogsGetRequestType] + This is the type of the log. + + assistant_id : typing.Optional[str] + This is the ID of the assistant. + + phone_number_id : typing.Optional[str] + This is the ID of the phone number. + + customer_id : typing.Optional[str] + This is the ID of the customer. + + squad_id : typing.Optional[str] + This is the ID of the squad. + + call_id : typing.Optional[str] + This is the ID of the call. + + page : typing.Optional[float] + This is the page number to return. Defaults to 1. + + sort_order : typing.Optional[LogsGetRequestSortOrder] + This is the sort order for pagination. Defaults to 'ASC'. + + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + LogsPaginatedResponse + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.logs.get() + """ + _response = self._client_wrapper.httpx_client.request( + "logs", + method="GET", + params={ + "orgId": org_id, + "type": type, + "assistantId": assistant_id, + "phoneNumberId": phone_number_id, + "customerId": customer_id, + "squadId": squad_id, + "callId": call_id, + "page": page, + "sortOrder": sort_order, + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + LogsPaginatedResponse, + parse_obj_as( + type_=LogsPaginatedResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncLogsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get( + self, + *, + org_id: typing.Optional[str] = None, + type: typing.Optional[LogsGetRequestType] = None, + assistant_id: typing.Optional[str] = None, + phone_number_id: typing.Optional[str] = None, + customer_id: typing.Optional[str] = None, + squad_id: typing.Optional[str] = None, + call_id: typing.Optional[str] = None, + page: typing.Optional[float] = None, + sort_order: typing.Optional[LogsGetRequestSortOrder] = None, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> LogsPaginatedResponse: + """ + Parameters + ---------- + org_id : typing.Optional[str] + This is the unique identifier for the org that this log belongs to. + + type : typing.Optional[LogsGetRequestType] + This is the type of the log. + + assistant_id : typing.Optional[str] + This is the ID of the assistant. + + phone_number_id : typing.Optional[str] + This is the ID of the phone number. + + customer_id : typing.Optional[str] + This is the ID of the customer. + + squad_id : typing.Optional[str] + This is the ID of the squad. + + call_id : typing.Optional[str] + This is the ID of the call. + + page : typing.Optional[float] + This is the page number to return. Defaults to 1. + + sort_order : typing.Optional[LogsGetRequestSortOrder] + This is the sort order for pagination. Defaults to 'ASC'. + + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + LogsPaginatedResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.logs.get() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "logs", + method="GET", + params={ + "orgId": org_id, + "type": type, + "assistantId": assistant_id, + "phoneNumberId": phone_number_id, + "customerId": customer_id, + "squadId": squad_id, + "callId": call_id, + "page": page, + "sortOrder": sort_order, + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + LogsPaginatedResponse, + parse_obj_as( + type_=LogsPaginatedResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/vapi/logs/types/__init__.py b/src/vapi/logs/types/__init__.py new file mode 100644 index 0000000..58a9973 --- /dev/null +++ b/src/vapi/logs/types/__init__.py @@ -0,0 +1,6 @@ +# This file was auto-generated by Fern from our API Definition. + +from .logs_get_request_sort_order import LogsGetRequestSortOrder +from .logs_get_request_type import LogsGetRequestType + +__all__ = ["LogsGetRequestSortOrder", "LogsGetRequestType"] diff --git a/src/vapi/logs/types/logs_get_request_sort_order.py b/src/vapi/logs/types/logs_get_request_sort_order.py new file mode 100644 index 0000000..a7531eb --- /dev/null +++ b/src/vapi/logs/types/logs_get_request_sort_order.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +LogsGetRequestSortOrder = typing.Union[typing.Literal["ASC", "DESC"], typing.Any] diff --git a/src/vapi/logs/types/logs_get_request_type.py b/src/vapi/logs/types/logs_get_request_type.py new file mode 100644 index 0000000..94c2502 --- /dev/null +++ b/src/vapi/logs/types/logs_get_request_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +LogsGetRequestType = typing.Union[typing.Literal["API", "Webhook", "Call", "Provider"], typing.Any] diff --git a/src/vapi/phone_numbers/__init__.py b/src/vapi/phone_numbers/__init__.py new file mode 100644 index 0000000..b5ddedb --- /dev/null +++ b/src/vapi/phone_numbers/__init__.py @@ -0,0 +1,73 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import ( + PhoneNumbersCreateRequest, + PhoneNumbersCreateRequest_ByoPhoneNumber, + PhoneNumbersCreateRequest_Twilio, + PhoneNumbersCreateRequest_Vapi, + PhoneNumbersCreateRequest_Vonage, + PhoneNumbersCreateResponse, + PhoneNumbersCreateResponse_ByoPhoneNumber, + PhoneNumbersCreateResponse_Twilio, + PhoneNumbersCreateResponse_Vapi, + PhoneNumbersCreateResponse_Vonage, + PhoneNumbersDeleteResponse, + PhoneNumbersDeleteResponse_ByoPhoneNumber, + PhoneNumbersDeleteResponse_Twilio, + PhoneNumbersDeleteResponse_Vapi, + PhoneNumbersDeleteResponse_Vonage, + PhoneNumbersGetResponse, + PhoneNumbersGetResponse_ByoPhoneNumber, + PhoneNumbersGetResponse_Twilio, + PhoneNumbersGetResponse_Vapi, + PhoneNumbersGetResponse_Vonage, + PhoneNumbersListResponseItem, + PhoneNumbersListResponseItem_ByoPhoneNumber, + PhoneNumbersListResponseItem_Twilio, + PhoneNumbersListResponseItem_Vapi, + PhoneNumbersListResponseItem_Vonage, + PhoneNumbersUpdateResponse, + PhoneNumbersUpdateResponse_ByoPhoneNumber, + PhoneNumbersUpdateResponse_Twilio, + PhoneNumbersUpdateResponse_Vapi, + PhoneNumbersUpdateResponse_Vonage, + UpdatePhoneNumberDtoFallbackDestination, + UpdatePhoneNumberDtoFallbackDestination_Number, + UpdatePhoneNumberDtoFallbackDestination_Sip, +) + +__all__ = [ + "PhoneNumbersCreateRequest", + "PhoneNumbersCreateRequest_ByoPhoneNumber", + "PhoneNumbersCreateRequest_Twilio", + "PhoneNumbersCreateRequest_Vapi", + "PhoneNumbersCreateRequest_Vonage", + "PhoneNumbersCreateResponse", + "PhoneNumbersCreateResponse_ByoPhoneNumber", + "PhoneNumbersCreateResponse_Twilio", + "PhoneNumbersCreateResponse_Vapi", + "PhoneNumbersCreateResponse_Vonage", + "PhoneNumbersDeleteResponse", + "PhoneNumbersDeleteResponse_ByoPhoneNumber", + "PhoneNumbersDeleteResponse_Twilio", + "PhoneNumbersDeleteResponse_Vapi", + "PhoneNumbersDeleteResponse_Vonage", + "PhoneNumbersGetResponse", + "PhoneNumbersGetResponse_ByoPhoneNumber", + "PhoneNumbersGetResponse_Twilio", + "PhoneNumbersGetResponse_Vapi", + "PhoneNumbersGetResponse_Vonage", + "PhoneNumbersListResponseItem", + "PhoneNumbersListResponseItem_ByoPhoneNumber", + "PhoneNumbersListResponseItem_Twilio", + "PhoneNumbersListResponseItem_Vapi", + "PhoneNumbersListResponseItem_Vonage", + "PhoneNumbersUpdateResponse", + "PhoneNumbersUpdateResponse_ByoPhoneNumber", + "PhoneNumbersUpdateResponse_Twilio", + "PhoneNumbersUpdateResponse_Vapi", + "PhoneNumbersUpdateResponse_Vonage", + "UpdatePhoneNumberDtoFallbackDestination", + "UpdatePhoneNumberDtoFallbackDestination_Number", + "UpdatePhoneNumberDtoFallbackDestination_Sip", +] diff --git a/src/vapi/phone_numbers/client.py b/src/vapi/phone_numbers/client.py new file mode 100644 index 0000000..5ac6925 --- /dev/null +++ b/src/vapi/phone_numbers/client.py @@ -0,0 +1,737 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ..core.client_wrapper import SyncClientWrapper +import datetime as dt +from ..core.request_options import RequestOptions +from .types.phone_numbers_list_response_item import PhoneNumbersListResponseItem +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from .types.phone_numbers_create_request import PhoneNumbersCreateRequest +from .types.phone_numbers_create_response import PhoneNumbersCreateResponse +from ..core.serialization import convert_and_respect_annotation_metadata +from .types.phone_numbers_get_response import PhoneNumbersGetResponse +from ..core.jsonable_encoder import jsonable_encoder +from .types.phone_numbers_delete_response import PhoneNumbersDeleteResponse +from .types.update_phone_number_dto_fallback_destination import UpdatePhoneNumberDtoFallbackDestination +from .types.phone_numbers_update_response import PhoneNumbersUpdateResponse +from ..core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class PhoneNumbersClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[PhoneNumbersListResponseItem]: + """ + Parameters + ---------- + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[PhoneNumbersListResponseItem] + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.phone_numbers.list() + """ + _response = self._client_wrapper.httpx_client.request( + "phone-number", + method="GET", + params={ + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[PhoneNumbersListResponseItem], + parse_obj_as( + type_=typing.List[PhoneNumbersListResponseItem], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def create( + self, *, request: PhoneNumbersCreateRequest, request_options: typing.Optional[RequestOptions] = None + ) -> PhoneNumbersCreateResponse: + """ + Parameters + ---------- + request : PhoneNumbersCreateRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PhoneNumbersCreateResponse + + + Examples + -------- + from vapi import Vapi + from vapi.phone_numbers import PhoneNumbersCreateRequest_Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.phone_numbers.create( + request=PhoneNumbersCreateRequest_Vapi( + sip_uri="string", + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "phone-number", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=PhoneNumbersCreateRequest, direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + PhoneNumbersCreateResponse, + parse_obj_as( + type_=PhoneNumbersCreateResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> PhoneNumbersGetResponse: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PhoneNumbersGetResponse + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.phone_numbers.get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"phone-number/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + PhoneNumbersGetResponse, + parse_obj_as( + type_=PhoneNumbersGetResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> PhoneNumbersDeleteResponse: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PhoneNumbersDeleteResponse + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.phone_numbers.delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"phone-number/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + PhoneNumbersDeleteResponse, + parse_obj_as( + type_=PhoneNumbersDeleteResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def update( + self, + id: str, + *, + fallback_destination: typing.Optional[UpdatePhoneNumberDtoFallbackDestination] = OMIT, + name: typing.Optional[str] = OMIT, + assistant_id: typing.Optional[str] = OMIT, + squad_id: typing.Optional[str] = OMIT, + server_url: typing.Optional[str] = OMIT, + server_url_secret: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> PhoneNumbersUpdateResponse: + """ + Parameters + ---------- + id : str + + fallback_destination : typing.Optional[UpdatePhoneNumberDtoFallbackDestination] + This is the fallback destination an inbound call will be transferred to if: + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + + name : typing.Optional[str] + This is the name of the phone number. This is just for your own reference. + + assistant_id : typing.Optional[str] + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + + squad_id : typing.Optional[str] + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + + server_url : typing.Optional[str] + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + + server_url_secret : typing.Optional[str] + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PhoneNumbersUpdateResponse + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.phone_numbers.update( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"phone-number/{jsonable_encoder(id)}", + method="PATCH", + json={ + "fallbackDestination": convert_and_respect_annotation_metadata( + object_=fallback_destination, annotation=UpdatePhoneNumberDtoFallbackDestination, direction="write" + ), + "name": name, + "assistantId": assistant_id, + "squadId": squad_id, + "serverUrl": server_url, + "serverUrlSecret": server_url_secret, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + PhoneNumbersUpdateResponse, + parse_obj_as( + type_=PhoneNumbersUpdateResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncPhoneNumbersClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[PhoneNumbersListResponseItem]: + """ + Parameters + ---------- + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[PhoneNumbersListResponseItem] + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.phone_numbers.list() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "phone-number", + method="GET", + params={ + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[PhoneNumbersListResponseItem], + parse_obj_as( + type_=typing.List[PhoneNumbersListResponseItem], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def create( + self, *, request: PhoneNumbersCreateRequest, request_options: typing.Optional[RequestOptions] = None + ) -> PhoneNumbersCreateResponse: + """ + Parameters + ---------- + request : PhoneNumbersCreateRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PhoneNumbersCreateResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + from vapi.phone_numbers import PhoneNumbersCreateRequest_Vapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.phone_numbers.create( + request=PhoneNumbersCreateRequest_Vapi( + sip_uri="string", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "phone-number", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=PhoneNumbersCreateRequest, direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + PhoneNumbersCreateResponse, + parse_obj_as( + type_=PhoneNumbersCreateResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> PhoneNumbersGetResponse: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PhoneNumbersGetResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.phone_numbers.get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"phone-number/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + PhoneNumbersGetResponse, + parse_obj_as( + type_=PhoneNumbersGetResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def delete( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> PhoneNumbersDeleteResponse: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PhoneNumbersDeleteResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.phone_numbers.delete( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"phone-number/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + PhoneNumbersDeleteResponse, + parse_obj_as( + type_=PhoneNumbersDeleteResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def update( + self, + id: str, + *, + fallback_destination: typing.Optional[UpdatePhoneNumberDtoFallbackDestination] = OMIT, + name: typing.Optional[str] = OMIT, + assistant_id: typing.Optional[str] = OMIT, + squad_id: typing.Optional[str] = OMIT, + server_url: typing.Optional[str] = OMIT, + server_url_secret: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> PhoneNumbersUpdateResponse: + """ + Parameters + ---------- + id : str + + fallback_destination : typing.Optional[UpdatePhoneNumberDtoFallbackDestination] + This is the fallback destination an inbound call will be transferred to if: + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + + name : typing.Optional[str] + This is the name of the phone number. This is just for your own reference. + + assistant_id : typing.Optional[str] + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + + squad_id : typing.Optional[str] + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + + server_url : typing.Optional[str] + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + + server_url_secret : typing.Optional[str] + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PhoneNumbersUpdateResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.phone_numbers.update( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"phone-number/{jsonable_encoder(id)}", + method="PATCH", + json={ + "fallbackDestination": convert_and_respect_annotation_metadata( + object_=fallback_destination, annotation=UpdatePhoneNumberDtoFallbackDestination, direction="write" + ), + "name": name, + "assistantId": assistant_id, + "squadId": squad_id, + "serverUrl": server_url, + "serverUrlSecret": server_url_secret, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + PhoneNumbersUpdateResponse, + parse_obj_as( + type_=PhoneNumbersUpdateResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/vapi/phone_numbers/types/__init__.py b/src/vapi/phone_numbers/types/__init__.py new file mode 100644 index 0000000..0b8f7c1 --- /dev/null +++ b/src/vapi/phone_numbers/types/__init__.py @@ -0,0 +1,85 @@ +# This file was auto-generated by Fern from our API Definition. + +from .phone_numbers_create_request import ( + PhoneNumbersCreateRequest, + PhoneNumbersCreateRequest_ByoPhoneNumber, + PhoneNumbersCreateRequest_Twilio, + PhoneNumbersCreateRequest_Vapi, + PhoneNumbersCreateRequest_Vonage, +) +from .phone_numbers_create_response import ( + PhoneNumbersCreateResponse, + PhoneNumbersCreateResponse_ByoPhoneNumber, + PhoneNumbersCreateResponse_Twilio, + PhoneNumbersCreateResponse_Vapi, + PhoneNumbersCreateResponse_Vonage, +) +from .phone_numbers_delete_response import ( + PhoneNumbersDeleteResponse, + PhoneNumbersDeleteResponse_ByoPhoneNumber, + PhoneNumbersDeleteResponse_Twilio, + PhoneNumbersDeleteResponse_Vapi, + PhoneNumbersDeleteResponse_Vonage, +) +from .phone_numbers_get_response import ( + PhoneNumbersGetResponse, + PhoneNumbersGetResponse_ByoPhoneNumber, + PhoneNumbersGetResponse_Twilio, + PhoneNumbersGetResponse_Vapi, + PhoneNumbersGetResponse_Vonage, +) +from .phone_numbers_list_response_item import ( + PhoneNumbersListResponseItem, + PhoneNumbersListResponseItem_ByoPhoneNumber, + PhoneNumbersListResponseItem_Twilio, + PhoneNumbersListResponseItem_Vapi, + PhoneNumbersListResponseItem_Vonage, +) +from .phone_numbers_update_response import ( + PhoneNumbersUpdateResponse, + PhoneNumbersUpdateResponse_ByoPhoneNumber, + PhoneNumbersUpdateResponse_Twilio, + PhoneNumbersUpdateResponse_Vapi, + PhoneNumbersUpdateResponse_Vonage, +) +from .update_phone_number_dto_fallback_destination import ( + UpdatePhoneNumberDtoFallbackDestination, + UpdatePhoneNumberDtoFallbackDestination_Number, + UpdatePhoneNumberDtoFallbackDestination_Sip, +) + +__all__ = [ + "PhoneNumbersCreateRequest", + "PhoneNumbersCreateRequest_ByoPhoneNumber", + "PhoneNumbersCreateRequest_Twilio", + "PhoneNumbersCreateRequest_Vapi", + "PhoneNumbersCreateRequest_Vonage", + "PhoneNumbersCreateResponse", + "PhoneNumbersCreateResponse_ByoPhoneNumber", + "PhoneNumbersCreateResponse_Twilio", + "PhoneNumbersCreateResponse_Vapi", + "PhoneNumbersCreateResponse_Vonage", + "PhoneNumbersDeleteResponse", + "PhoneNumbersDeleteResponse_ByoPhoneNumber", + "PhoneNumbersDeleteResponse_Twilio", + "PhoneNumbersDeleteResponse_Vapi", + "PhoneNumbersDeleteResponse_Vonage", + "PhoneNumbersGetResponse", + "PhoneNumbersGetResponse_ByoPhoneNumber", + "PhoneNumbersGetResponse_Twilio", + "PhoneNumbersGetResponse_Vapi", + "PhoneNumbersGetResponse_Vonage", + "PhoneNumbersListResponseItem", + "PhoneNumbersListResponseItem_ByoPhoneNumber", + "PhoneNumbersListResponseItem_Twilio", + "PhoneNumbersListResponseItem_Vapi", + "PhoneNumbersListResponseItem_Vonage", + "PhoneNumbersUpdateResponse", + "PhoneNumbersUpdateResponse_ByoPhoneNumber", + "PhoneNumbersUpdateResponse_Twilio", + "PhoneNumbersUpdateResponse_Vapi", + "PhoneNumbersUpdateResponse_Vonage", + "UpdatePhoneNumberDtoFallbackDestination", + "UpdatePhoneNumberDtoFallbackDestination_Number", + "UpdatePhoneNumberDtoFallbackDestination_Sip", +] diff --git a/src/vapi/phone_numbers/types/phone_numbers_create_request.py b/src/vapi/phone_numbers/types/phone_numbers_create_request.py new file mode 100644 index 0000000..bef3653 --- /dev/null +++ b/src/vapi/phone_numbers/types/phone_numbers_create_request.py @@ -0,0 +1,116 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...types.create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ...core.serialization import FieldMetadata +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from ...types.create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from ...types.create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class PhoneNumbersCreateRequest_ByoPhoneNumber(UniversalBaseModel): + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersCreateRequest_Twilio(UniversalBaseModel): + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersCreateRequest_Vonage(UniversalBaseModel): + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersCreateRequest_Vapi(UniversalBaseModel): + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +PhoneNumbersCreateRequest = typing.Union[ + PhoneNumbersCreateRequest_ByoPhoneNumber, + PhoneNumbersCreateRequest_Twilio, + PhoneNumbersCreateRequest_Vonage, + PhoneNumbersCreateRequest_Vapi, +] diff --git a/src/vapi/phone_numbers/types/phone_numbers_create_response.py b/src/vapi/phone_numbers/types/phone_numbers_create_response.py new file mode 100644 index 0000000..d3ec883 --- /dev/null +++ b/src/vapi/phone_numbers/types/phone_numbers_create_response.py @@ -0,0 +1,133 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...types.byo_phone_number_fallback_destination import ByoPhoneNumberFallbackDestination +from ...core.serialization import FieldMetadata +import datetime as dt +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.twilio_phone_number_fallback_destination import TwilioPhoneNumberFallbackDestination +from ...types.vonage_phone_number_fallback_destination import VonagePhoneNumberFallbackDestination +from ...types.vapi_phone_number_fallback_destination import VapiPhoneNumberFallbackDestination + + +class PhoneNumbersCreateResponse_ByoPhoneNumber(UniversalBaseModel): + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[ByoPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersCreateResponse_Twilio(UniversalBaseModel): + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[TwilioPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersCreateResponse_Vonage(UniversalBaseModel): + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[VonagePhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersCreateResponse_Vapi(UniversalBaseModel): + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[VapiPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +PhoneNumbersCreateResponse = typing.Union[ + PhoneNumbersCreateResponse_ByoPhoneNumber, + PhoneNumbersCreateResponse_Twilio, + PhoneNumbersCreateResponse_Vonage, + PhoneNumbersCreateResponse_Vapi, +] diff --git a/src/vapi/phone_numbers/types/phone_numbers_delete_response.py b/src/vapi/phone_numbers/types/phone_numbers_delete_response.py new file mode 100644 index 0000000..103e40b --- /dev/null +++ b/src/vapi/phone_numbers/types/phone_numbers_delete_response.py @@ -0,0 +1,133 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...types.byo_phone_number_fallback_destination import ByoPhoneNumberFallbackDestination +from ...core.serialization import FieldMetadata +import datetime as dt +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.twilio_phone_number_fallback_destination import TwilioPhoneNumberFallbackDestination +from ...types.vonage_phone_number_fallback_destination import VonagePhoneNumberFallbackDestination +from ...types.vapi_phone_number_fallback_destination import VapiPhoneNumberFallbackDestination + + +class PhoneNumbersDeleteResponse_ByoPhoneNumber(UniversalBaseModel): + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[ByoPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersDeleteResponse_Twilio(UniversalBaseModel): + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[TwilioPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersDeleteResponse_Vonage(UniversalBaseModel): + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[VonagePhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersDeleteResponse_Vapi(UniversalBaseModel): + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[VapiPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +PhoneNumbersDeleteResponse = typing.Union[ + PhoneNumbersDeleteResponse_ByoPhoneNumber, + PhoneNumbersDeleteResponse_Twilio, + PhoneNumbersDeleteResponse_Vonage, + PhoneNumbersDeleteResponse_Vapi, +] diff --git a/src/vapi/phone_numbers/types/phone_numbers_get_response.py b/src/vapi/phone_numbers/types/phone_numbers_get_response.py new file mode 100644 index 0000000..3ea4360 --- /dev/null +++ b/src/vapi/phone_numbers/types/phone_numbers_get_response.py @@ -0,0 +1,133 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...types.byo_phone_number_fallback_destination import ByoPhoneNumberFallbackDestination +from ...core.serialization import FieldMetadata +import datetime as dt +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.twilio_phone_number_fallback_destination import TwilioPhoneNumberFallbackDestination +from ...types.vonage_phone_number_fallback_destination import VonagePhoneNumberFallbackDestination +from ...types.vapi_phone_number_fallback_destination import VapiPhoneNumberFallbackDestination + + +class PhoneNumbersGetResponse_ByoPhoneNumber(UniversalBaseModel): + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[ByoPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersGetResponse_Twilio(UniversalBaseModel): + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[TwilioPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersGetResponse_Vonage(UniversalBaseModel): + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[VonagePhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersGetResponse_Vapi(UniversalBaseModel): + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[VapiPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +PhoneNumbersGetResponse = typing.Union[ + PhoneNumbersGetResponse_ByoPhoneNumber, + PhoneNumbersGetResponse_Twilio, + PhoneNumbersGetResponse_Vonage, + PhoneNumbersGetResponse_Vapi, +] diff --git a/src/vapi/phone_numbers/types/phone_numbers_list_response_item.py b/src/vapi/phone_numbers/types/phone_numbers_list_response_item.py new file mode 100644 index 0000000..5c3138e --- /dev/null +++ b/src/vapi/phone_numbers/types/phone_numbers_list_response_item.py @@ -0,0 +1,133 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...types.byo_phone_number_fallback_destination import ByoPhoneNumberFallbackDestination +from ...core.serialization import FieldMetadata +import datetime as dt +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.twilio_phone_number_fallback_destination import TwilioPhoneNumberFallbackDestination +from ...types.vonage_phone_number_fallback_destination import VonagePhoneNumberFallbackDestination +from ...types.vapi_phone_number_fallback_destination import VapiPhoneNumberFallbackDestination + + +class PhoneNumbersListResponseItem_ByoPhoneNumber(UniversalBaseModel): + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[ByoPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersListResponseItem_Twilio(UniversalBaseModel): + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[TwilioPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersListResponseItem_Vonage(UniversalBaseModel): + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[VonagePhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersListResponseItem_Vapi(UniversalBaseModel): + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[VapiPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +PhoneNumbersListResponseItem = typing.Union[ + PhoneNumbersListResponseItem_ByoPhoneNumber, + PhoneNumbersListResponseItem_Twilio, + PhoneNumbersListResponseItem_Vonage, + PhoneNumbersListResponseItem_Vapi, +] diff --git a/src/vapi/phone_numbers/types/phone_numbers_update_response.py b/src/vapi/phone_numbers/types/phone_numbers_update_response.py new file mode 100644 index 0000000..24bcf2a --- /dev/null +++ b/src/vapi/phone_numbers/types/phone_numbers_update_response.py @@ -0,0 +1,133 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...types.byo_phone_number_fallback_destination import ByoPhoneNumberFallbackDestination +from ...core.serialization import FieldMetadata +import datetime as dt +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.twilio_phone_number_fallback_destination import TwilioPhoneNumberFallbackDestination +from ...types.vonage_phone_number_fallback_destination import VonagePhoneNumberFallbackDestination +from ...types.vapi_phone_number_fallback_destination import VapiPhoneNumberFallbackDestination + + +class PhoneNumbersUpdateResponse_ByoPhoneNumber(UniversalBaseModel): + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[ByoPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersUpdateResponse_Twilio(UniversalBaseModel): + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[TwilioPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersUpdateResponse_Vonage(UniversalBaseModel): + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[VonagePhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PhoneNumbersUpdateResponse_Vapi(UniversalBaseModel): + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[VapiPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +PhoneNumbersUpdateResponse = typing.Union[ + PhoneNumbersUpdateResponse_ByoPhoneNumber, + PhoneNumbersUpdateResponse_Twilio, + PhoneNumbersUpdateResponse_Vonage, + PhoneNumbersUpdateResponse_Vapi, +] diff --git a/src/vapi/phone_numbers/types/update_phone_number_dto_fallback_destination.py b/src/vapi/phone_numbers/types/update_phone_number_dto_fallback_destination.py new file mode 100644 index 0000000..368eaac --- /dev/null +++ b/src/vapi/phone_numbers/types/update_phone_number_dto_fallback_destination.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...core.serialization import FieldMetadata +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class UpdatePhoneNumberDtoFallbackDestination_Number(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdatePhoneNumberDtoFallbackDestination_Sip(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +UpdatePhoneNumberDtoFallbackDestination = typing.Union[ + UpdatePhoneNumberDtoFallbackDestination_Number, UpdatePhoneNumberDtoFallbackDestination_Sip +] diff --git a/src/vapi/py.typed b/src/vapi/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/src/vapi/squads/__init__.py b/src/vapi/squads/__init__.py new file mode 100644 index 0000000..f3ea265 --- /dev/null +++ b/src/vapi/squads/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/vapi/squads/client.py b/src/vapi/squads/client.py new file mode 100644 index 0000000..6908413 --- /dev/null +++ b/src/vapi/squads/client.py @@ -0,0 +1,723 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ..core.client_wrapper import SyncClientWrapper +import datetime as dt +from ..core.request_options import RequestOptions +from ..types.squad import Squad +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..types.squad_member_dto import SquadMemberDto +from ..types.assistant_overrides import AssistantOverrides +from ..core.serialization import convert_and_respect_annotation_metadata +from ..core.jsonable_encoder import jsonable_encoder +from ..core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class SquadsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[Squad]: + """ + Parameters + ---------- + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[Squad] + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.squads.list() + """ + _response = self._client_wrapper.httpx_client.request( + "squad", + method="GET", + params={ + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[Squad], + parse_obj_as( + type_=typing.List[Squad], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def create( + self, + *, + members: typing.Sequence[SquadMemberDto], + name: typing.Optional[str] = OMIT, + members_overrides: typing.Optional[AssistantOverrides] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> Squad: + """ + Parameters + ---------- + members : typing.Sequence[SquadMemberDto] + This is the list of assistants that make up the squad. + + The call will start with the first assistant in the list. + + name : typing.Optional[str] + This is the name of the squad. + + members_overrides : typing.Optional[AssistantOverrides] + This can be used to override all the assistants' settings and provide values for their template variables. + + Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Squad + + + Examples + -------- + from vapi import SquadMemberDto, Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.squads.create( + members=[SquadMemberDto()], + ) + """ + _response = self._client_wrapper.httpx_client.request( + "squad", + method="POST", + json={ + "name": name, + "members": convert_and_respect_annotation_metadata( + object_=members, annotation=typing.Sequence[SquadMemberDto], direction="write" + ), + "membersOverrides": convert_and_respect_annotation_metadata( + object_=members_overrides, annotation=AssistantOverrides, direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Squad, + parse_obj_as( + type_=Squad, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Squad: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Squad + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.squads.get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"squad/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Squad, + parse_obj_as( + type_=Squad, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Squad: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Squad + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.squads.delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"squad/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Squad, + parse_obj_as( + type_=Squad, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def update( + self, + id: str, + *, + members: typing.Sequence[SquadMemberDto], + name: typing.Optional[str] = OMIT, + members_overrides: typing.Optional[AssistantOverrides] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> Squad: + """ + Parameters + ---------- + id : str + + members : typing.Sequence[SquadMemberDto] + This is the list of assistants that make up the squad. + + The call will start with the first assistant in the list. + + name : typing.Optional[str] + This is the name of the squad. + + members_overrides : typing.Optional[AssistantOverrides] + This can be used to override all the assistants' settings and provide values for their template variables. + + Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Squad + + + Examples + -------- + from vapi import SquadMemberDto, Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.squads.update( + id="id", + members=[SquadMemberDto()], + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"squad/{jsonable_encoder(id)}", + method="PATCH", + json={ + "name": name, + "members": convert_and_respect_annotation_metadata( + object_=members, annotation=typing.Sequence[SquadMemberDto], direction="write" + ), + "membersOverrides": convert_and_respect_annotation_metadata( + object_=members_overrides, annotation=AssistantOverrides, direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Squad, + parse_obj_as( + type_=Squad, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncSquadsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[Squad]: + """ + Parameters + ---------- + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[Squad] + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.squads.list() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "squad", + method="GET", + params={ + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[Squad], + parse_obj_as( + type_=typing.List[Squad], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def create( + self, + *, + members: typing.Sequence[SquadMemberDto], + name: typing.Optional[str] = OMIT, + members_overrides: typing.Optional[AssistantOverrides] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> Squad: + """ + Parameters + ---------- + members : typing.Sequence[SquadMemberDto] + This is the list of assistants that make up the squad. + + The call will start with the first assistant in the list. + + name : typing.Optional[str] + This is the name of the squad. + + members_overrides : typing.Optional[AssistantOverrides] + This can be used to override all the assistants' settings and provide values for their template variables. + + Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Squad + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi, SquadMemberDto + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.squads.create( + members=[SquadMemberDto()], + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "squad", + method="POST", + json={ + "name": name, + "members": convert_and_respect_annotation_metadata( + object_=members, annotation=typing.Sequence[SquadMemberDto], direction="write" + ), + "membersOverrides": convert_and_respect_annotation_metadata( + object_=members_overrides, annotation=AssistantOverrides, direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Squad, + parse_obj_as( + type_=Squad, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Squad: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Squad + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.squads.get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"squad/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Squad, + parse_obj_as( + type_=Squad, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Squad: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Squad + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.squads.delete( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"squad/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Squad, + parse_obj_as( + type_=Squad, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def update( + self, + id: str, + *, + members: typing.Sequence[SquadMemberDto], + name: typing.Optional[str] = OMIT, + members_overrides: typing.Optional[AssistantOverrides] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> Squad: + """ + Parameters + ---------- + id : str + + members : typing.Sequence[SquadMemberDto] + This is the list of assistants that make up the squad. + + The call will start with the first assistant in the list. + + name : typing.Optional[str] + This is the name of the squad. + + members_overrides : typing.Optional[AssistantOverrides] + This can be used to override all the assistants' settings and provide values for their template variables. + + Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Squad + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi, SquadMemberDto + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.squads.update( + id="id", + members=[SquadMemberDto()], + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"squad/{jsonable_encoder(id)}", + method="PATCH", + json={ + "name": name, + "members": convert_and_respect_annotation_metadata( + object_=members, annotation=typing.Sequence[SquadMemberDto], direction="write" + ), + "membersOverrides": convert_and_respect_annotation_metadata( + object_=members_overrides, annotation=AssistantOverrides, direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Squad, + parse_obj_as( + type_=Squad, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/vapi/tools/__init__.py b/src/vapi/tools/__init__.py new file mode 100644 index 0000000..6640a2f --- /dev/null +++ b/src/vapi/tools/__init__.py @@ -0,0 +1,113 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import ( + ToolsCreateRequest, + ToolsCreateRequest_Dtmf, + ToolsCreateRequest_EndCall, + ToolsCreateRequest_Function, + ToolsCreateRequest_Ghl, + ToolsCreateRequest_Make, + ToolsCreateRequest_Output, + ToolsCreateRequest_TransferCall, + ToolsCreateResponse, + ToolsCreateResponse_Dtmf, + ToolsCreateResponse_EndCall, + ToolsCreateResponse_Function, + ToolsCreateResponse_Ghl, + ToolsCreateResponse_Make, + ToolsCreateResponse_Output, + ToolsCreateResponse_TransferCall, + ToolsDeleteResponse, + ToolsDeleteResponse_Dtmf, + ToolsDeleteResponse_EndCall, + ToolsDeleteResponse_Function, + ToolsDeleteResponse_Ghl, + ToolsDeleteResponse_Make, + ToolsDeleteResponse_Output, + ToolsDeleteResponse_TransferCall, + ToolsGetResponse, + ToolsGetResponse_Dtmf, + ToolsGetResponse_EndCall, + ToolsGetResponse_Function, + ToolsGetResponse_Ghl, + ToolsGetResponse_Make, + ToolsGetResponse_Output, + ToolsGetResponse_TransferCall, + ToolsListResponseItem, + ToolsListResponseItem_Dtmf, + ToolsListResponseItem_EndCall, + ToolsListResponseItem_Function, + ToolsListResponseItem_Ghl, + ToolsListResponseItem_Make, + ToolsListResponseItem_Output, + ToolsListResponseItem_TransferCall, + ToolsUpdateResponse, + ToolsUpdateResponse_Dtmf, + ToolsUpdateResponse_EndCall, + ToolsUpdateResponse_Function, + ToolsUpdateResponse_Ghl, + ToolsUpdateResponse_Make, + ToolsUpdateResponse_Output, + ToolsUpdateResponse_TransferCall, + UpdateToolDtoMessagesItem, + UpdateToolDtoMessagesItem_RequestComplete, + UpdateToolDtoMessagesItem_RequestFailed, + UpdateToolDtoMessagesItem_RequestResponseDelayed, + UpdateToolDtoMessagesItem_RequestStart, +) + +__all__ = [ + "ToolsCreateRequest", + "ToolsCreateRequest_Dtmf", + "ToolsCreateRequest_EndCall", + "ToolsCreateRequest_Function", + "ToolsCreateRequest_Ghl", + "ToolsCreateRequest_Make", + "ToolsCreateRequest_Output", + "ToolsCreateRequest_TransferCall", + "ToolsCreateResponse", + "ToolsCreateResponse_Dtmf", + "ToolsCreateResponse_EndCall", + "ToolsCreateResponse_Function", + "ToolsCreateResponse_Ghl", + "ToolsCreateResponse_Make", + "ToolsCreateResponse_Output", + "ToolsCreateResponse_TransferCall", + "ToolsDeleteResponse", + "ToolsDeleteResponse_Dtmf", + "ToolsDeleteResponse_EndCall", + "ToolsDeleteResponse_Function", + "ToolsDeleteResponse_Ghl", + "ToolsDeleteResponse_Make", + "ToolsDeleteResponse_Output", + "ToolsDeleteResponse_TransferCall", + "ToolsGetResponse", + "ToolsGetResponse_Dtmf", + "ToolsGetResponse_EndCall", + "ToolsGetResponse_Function", + "ToolsGetResponse_Ghl", + "ToolsGetResponse_Make", + "ToolsGetResponse_Output", + "ToolsGetResponse_TransferCall", + "ToolsListResponseItem", + "ToolsListResponseItem_Dtmf", + "ToolsListResponseItem_EndCall", + "ToolsListResponseItem_Function", + "ToolsListResponseItem_Ghl", + "ToolsListResponseItem_Make", + "ToolsListResponseItem_Output", + "ToolsListResponseItem_TransferCall", + "ToolsUpdateResponse", + "ToolsUpdateResponse_Dtmf", + "ToolsUpdateResponse_EndCall", + "ToolsUpdateResponse_Function", + "ToolsUpdateResponse_Ghl", + "ToolsUpdateResponse_Make", + "ToolsUpdateResponse_Output", + "ToolsUpdateResponse_TransferCall", + "UpdateToolDtoMessagesItem", + "UpdateToolDtoMessagesItem_RequestComplete", + "UpdateToolDtoMessagesItem_RequestFailed", + "UpdateToolDtoMessagesItem_RequestResponseDelayed", + "UpdateToolDtoMessagesItem_RequestStart", +] diff --git a/src/vapi/tools/client.py b/src/vapi/tools/client.py new file mode 100644 index 0000000..bca634f --- /dev/null +++ b/src/vapi/tools/client.py @@ -0,0 +1,723 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ..core.client_wrapper import SyncClientWrapper +import datetime as dt +from ..core.request_options import RequestOptions +from .types.tools_list_response_item import ToolsListResponseItem +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from .types.tools_create_request import ToolsCreateRequest +from .types.tools_create_response import ToolsCreateResponse +from ..core.serialization import convert_and_respect_annotation_metadata +from .types.tools_get_response import ToolsGetResponse +from ..core.jsonable_encoder import jsonable_encoder +from .types.tools_delete_response import ToolsDeleteResponse +from .types.update_tool_dto_messages_item import UpdateToolDtoMessagesItem +from ..types.open_ai_function import OpenAiFunction +from ..types.server import Server +from .types.tools_update_response import ToolsUpdateResponse +from ..core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ToolsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[ToolsListResponseItem]: + """ + Parameters + ---------- + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[ToolsListResponseItem] + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.tools.list() + """ + _response = self._client_wrapper.httpx_client.request( + "tool", + method="GET", + params={ + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[ToolsListResponseItem], + parse_obj_as( + type_=typing.List[ToolsListResponseItem], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def create( + self, *, request: ToolsCreateRequest, request_options: typing.Optional[RequestOptions] = None + ) -> ToolsCreateResponse: + """ + Parameters + ---------- + request : ToolsCreateRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolsCreateResponse + + + Examples + -------- + from vapi import Vapi + from vapi.tools import ToolsCreateRequest_Output + + client = Vapi( + token="YOUR_TOKEN", + ) + client.tools.create( + request=ToolsCreateRequest_Output( + async_=False, + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "tool", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=ToolsCreateRequest, direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ToolsCreateResponse, + parse_obj_as( + type_=ToolsCreateResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ToolsGetResponse: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolsGetResponse + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.tools.get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"tool/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ToolsGetResponse, + parse_obj_as( + type_=ToolsGetResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ToolsDeleteResponse: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolsDeleteResponse + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.tools.delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"tool/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ToolsDeleteResponse, + parse_obj_as( + type_=ToolsDeleteResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def update( + self, + id: str, + *, + async_: typing.Optional[bool] = OMIT, + messages: typing.Optional[typing.Sequence[UpdateToolDtoMessagesItem]] = OMIT, + function: typing.Optional[OpenAiFunction] = OMIT, + server: typing.Optional[Server] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> ToolsUpdateResponse: + """ + Parameters + ---------- + id : str + + async_ : typing.Optional[bool] + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + + messages : typing.Optional[typing.Sequence[UpdateToolDtoMessagesItem]] + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + + function : typing.Optional[OpenAiFunction] + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + + server : typing.Optional[Server] + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolsUpdateResponse + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.tools.update( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"tool/{jsonable_encoder(id)}", + method="PATCH", + json={ + "async": async_, + "messages": convert_and_respect_annotation_metadata( + object_=messages, annotation=typing.Sequence[UpdateToolDtoMessagesItem], direction="write" + ), + "function": convert_and_respect_annotation_metadata( + object_=function, annotation=OpenAiFunction, direction="write" + ), + "server": convert_and_respect_annotation_metadata(object_=server, annotation=Server, direction="write"), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ToolsUpdateResponse, + parse_obj_as( + type_=ToolsUpdateResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncToolsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[ToolsListResponseItem]: + """ + Parameters + ---------- + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[ToolsListResponseItem] + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.tools.list() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "tool", + method="GET", + params={ + "limit": limit, + "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, + "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, + "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, + "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, + "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, + "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, + "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, + "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[ToolsListResponseItem], + parse_obj_as( + type_=typing.List[ToolsListResponseItem], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def create( + self, *, request: ToolsCreateRequest, request_options: typing.Optional[RequestOptions] = None + ) -> ToolsCreateResponse: + """ + Parameters + ---------- + request : ToolsCreateRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolsCreateResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + from vapi.tools import ToolsCreateRequest_Output + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.tools.create( + request=ToolsCreateRequest_Output( + async_=False, + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "tool", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=ToolsCreateRequest, direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ToolsCreateResponse, + parse_obj_as( + type_=ToolsCreateResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ToolsGetResponse: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolsGetResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.tools.get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"tool/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ToolsGetResponse, + parse_obj_as( + type_=ToolsGetResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ToolsDeleteResponse: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolsDeleteResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.tools.delete( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"tool/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ToolsDeleteResponse, + parse_obj_as( + type_=ToolsDeleteResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def update( + self, + id: str, + *, + async_: typing.Optional[bool] = OMIT, + messages: typing.Optional[typing.Sequence[UpdateToolDtoMessagesItem]] = OMIT, + function: typing.Optional[OpenAiFunction] = OMIT, + server: typing.Optional[Server] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> ToolsUpdateResponse: + """ + Parameters + ---------- + id : str + + async_ : typing.Optional[bool] + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + + messages : typing.Optional[typing.Sequence[UpdateToolDtoMessagesItem]] + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + + function : typing.Optional[OpenAiFunction] + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + + server : typing.Optional[Server] + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolsUpdateResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.tools.update( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"tool/{jsonable_encoder(id)}", + method="PATCH", + json={ + "async": async_, + "messages": convert_and_respect_annotation_metadata( + object_=messages, annotation=typing.Sequence[UpdateToolDtoMessagesItem], direction="write" + ), + "function": convert_and_respect_annotation_metadata( + object_=function, annotation=OpenAiFunction, direction="write" + ), + "server": convert_and_respect_annotation_metadata(object_=server, annotation=Server, direction="write"), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ToolsUpdateResponse, + parse_obj_as( + type_=ToolsUpdateResponse, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/vapi/tools/types/__init__.py b/src/vapi/tools/types/__init__.py new file mode 100644 index 0000000..1f98551 --- /dev/null +++ b/src/vapi/tools/types/__init__.py @@ -0,0 +1,125 @@ +# This file was auto-generated by Fern from our API Definition. + +from .tools_create_request import ( + ToolsCreateRequest, + ToolsCreateRequest_Dtmf, + ToolsCreateRequest_EndCall, + ToolsCreateRequest_Function, + ToolsCreateRequest_Ghl, + ToolsCreateRequest_Make, + ToolsCreateRequest_Output, + ToolsCreateRequest_TransferCall, +) +from .tools_create_response import ( + ToolsCreateResponse, + ToolsCreateResponse_Dtmf, + ToolsCreateResponse_EndCall, + ToolsCreateResponse_Function, + ToolsCreateResponse_Ghl, + ToolsCreateResponse_Make, + ToolsCreateResponse_Output, + ToolsCreateResponse_TransferCall, +) +from .tools_delete_response import ( + ToolsDeleteResponse, + ToolsDeleteResponse_Dtmf, + ToolsDeleteResponse_EndCall, + ToolsDeleteResponse_Function, + ToolsDeleteResponse_Ghl, + ToolsDeleteResponse_Make, + ToolsDeleteResponse_Output, + ToolsDeleteResponse_TransferCall, +) +from .tools_get_response import ( + ToolsGetResponse, + ToolsGetResponse_Dtmf, + ToolsGetResponse_EndCall, + ToolsGetResponse_Function, + ToolsGetResponse_Ghl, + ToolsGetResponse_Make, + ToolsGetResponse_Output, + ToolsGetResponse_TransferCall, +) +from .tools_list_response_item import ( + ToolsListResponseItem, + ToolsListResponseItem_Dtmf, + ToolsListResponseItem_EndCall, + ToolsListResponseItem_Function, + ToolsListResponseItem_Ghl, + ToolsListResponseItem_Make, + ToolsListResponseItem_Output, + ToolsListResponseItem_TransferCall, +) +from .tools_update_response import ( + ToolsUpdateResponse, + ToolsUpdateResponse_Dtmf, + ToolsUpdateResponse_EndCall, + ToolsUpdateResponse_Function, + ToolsUpdateResponse_Ghl, + ToolsUpdateResponse_Make, + ToolsUpdateResponse_Output, + ToolsUpdateResponse_TransferCall, +) +from .update_tool_dto_messages_item import ( + UpdateToolDtoMessagesItem, + UpdateToolDtoMessagesItem_RequestComplete, + UpdateToolDtoMessagesItem_RequestFailed, + UpdateToolDtoMessagesItem_RequestResponseDelayed, + UpdateToolDtoMessagesItem_RequestStart, +) + +__all__ = [ + "ToolsCreateRequest", + "ToolsCreateRequest_Dtmf", + "ToolsCreateRequest_EndCall", + "ToolsCreateRequest_Function", + "ToolsCreateRequest_Ghl", + "ToolsCreateRequest_Make", + "ToolsCreateRequest_Output", + "ToolsCreateRequest_TransferCall", + "ToolsCreateResponse", + "ToolsCreateResponse_Dtmf", + "ToolsCreateResponse_EndCall", + "ToolsCreateResponse_Function", + "ToolsCreateResponse_Ghl", + "ToolsCreateResponse_Make", + "ToolsCreateResponse_Output", + "ToolsCreateResponse_TransferCall", + "ToolsDeleteResponse", + "ToolsDeleteResponse_Dtmf", + "ToolsDeleteResponse_EndCall", + "ToolsDeleteResponse_Function", + "ToolsDeleteResponse_Ghl", + "ToolsDeleteResponse_Make", + "ToolsDeleteResponse_Output", + "ToolsDeleteResponse_TransferCall", + "ToolsGetResponse", + "ToolsGetResponse_Dtmf", + "ToolsGetResponse_EndCall", + "ToolsGetResponse_Function", + "ToolsGetResponse_Ghl", + "ToolsGetResponse_Make", + "ToolsGetResponse_Output", + "ToolsGetResponse_TransferCall", + "ToolsListResponseItem", + "ToolsListResponseItem_Dtmf", + "ToolsListResponseItem_EndCall", + "ToolsListResponseItem_Function", + "ToolsListResponseItem_Ghl", + "ToolsListResponseItem_Make", + "ToolsListResponseItem_Output", + "ToolsListResponseItem_TransferCall", + "ToolsUpdateResponse", + "ToolsUpdateResponse_Dtmf", + "ToolsUpdateResponse_EndCall", + "ToolsUpdateResponse_Function", + "ToolsUpdateResponse_Ghl", + "ToolsUpdateResponse_Make", + "ToolsUpdateResponse_Output", + "ToolsUpdateResponse_TransferCall", + "UpdateToolDtoMessagesItem", + "UpdateToolDtoMessagesItem_RequestComplete", + "UpdateToolDtoMessagesItem_RequestFailed", + "UpdateToolDtoMessagesItem_RequestResponseDelayed", + "UpdateToolDtoMessagesItem_RequestStart", +] diff --git a/src/vapi/tools/types/tools_create_request.py b/src/vapi/tools/types/tools_create_request.py new file mode 100644 index 0000000..450e762 --- /dev/null +++ b/src/vapi/tools/types/tools_create_request.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...core.serialization import FieldMetadata +from ...types.create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from ...types.open_ai_function import OpenAiFunction +from ...types.server import Server +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from ...types.create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from ...types.create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from ...types.ghl_tool_metadata import GhlToolMetadata +from ...types.create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from ...types.make_tool_metadata import MakeToolMetadata +from ...types.create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from ...types.create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem +from ...types.create_output_tool_dto_messages_item import CreateOutputToolDtoMessagesItem + + +class ToolsCreateRequest_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsCreateRequest_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsCreateRequest_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsCreateRequest_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsCreateRequest_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsCreateRequest_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsCreateRequest_Output(UniversalBaseModel): + type: typing.Literal["output"] = "output" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateOutputToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ToolsCreateRequest = typing.Union[ + ToolsCreateRequest_Dtmf, + ToolsCreateRequest_EndCall, + ToolsCreateRequest_Function, + ToolsCreateRequest_Ghl, + ToolsCreateRequest_Make, + ToolsCreateRequest_TransferCall, + ToolsCreateRequest_Output, +] diff --git a/src/vapi/tools/types/tools_create_response.py b/src/vapi/tools/types/tools_create_response.py new file mode 100644 index 0000000..e9d5276 --- /dev/null +++ b/src/vapi/tools/types/tools_create_response.py @@ -0,0 +1,183 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...core.serialization import FieldMetadata +from ...types.dtmf_tool_messages_item import DtmfToolMessagesItem +import datetime as dt +from ...types.open_ai_function import OpenAiFunction +from ...types.server import Server +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.end_call_tool_messages_item import EndCallToolMessagesItem +from ...types.function_tool_messages_item import FunctionToolMessagesItem +from ...types.ghl_tool_messages_item import GhlToolMessagesItem +from ...types.ghl_tool_metadata import GhlToolMetadata +from ...types.make_tool_messages_item import MakeToolMessagesItem +from ...types.make_tool_metadata import MakeToolMetadata +from ...types.transfer_call_tool_messages_item import TransferCallToolMessagesItem +from ...types.transfer_call_tool_destinations_item import TransferCallToolDestinationsItem +from ...types.output_tool_messages_item import OutputToolMessagesItem + + +class ToolsCreateResponse_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[DtmfToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsCreateResponse_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[EndCallToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsCreateResponse_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[FunctionToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsCreateResponse_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[GhlToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + metadata: GhlToolMetadata + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsCreateResponse_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[MakeToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + metadata: MakeToolMetadata + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsCreateResponse_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[TransferCallToolMessagesItem]] = None + destinations: typing.Optional[typing.List[TransferCallToolDestinationsItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsCreateResponse_Output(UniversalBaseModel): + type: typing.Literal["output"] = "output" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[OutputToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ToolsCreateResponse = typing.Union[ + ToolsCreateResponse_Dtmf, + ToolsCreateResponse_EndCall, + ToolsCreateResponse_Function, + ToolsCreateResponse_Ghl, + ToolsCreateResponse_Make, + ToolsCreateResponse_TransferCall, + ToolsCreateResponse_Output, +] diff --git a/src/vapi/tools/types/tools_delete_response.py b/src/vapi/tools/types/tools_delete_response.py new file mode 100644 index 0000000..7ed29db --- /dev/null +++ b/src/vapi/tools/types/tools_delete_response.py @@ -0,0 +1,183 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...core.serialization import FieldMetadata +from ...types.dtmf_tool_messages_item import DtmfToolMessagesItem +import datetime as dt +from ...types.open_ai_function import OpenAiFunction +from ...types.server import Server +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.end_call_tool_messages_item import EndCallToolMessagesItem +from ...types.function_tool_messages_item import FunctionToolMessagesItem +from ...types.ghl_tool_messages_item import GhlToolMessagesItem +from ...types.ghl_tool_metadata import GhlToolMetadata +from ...types.make_tool_messages_item import MakeToolMessagesItem +from ...types.make_tool_metadata import MakeToolMetadata +from ...types.transfer_call_tool_messages_item import TransferCallToolMessagesItem +from ...types.transfer_call_tool_destinations_item import TransferCallToolDestinationsItem +from ...types.output_tool_messages_item import OutputToolMessagesItem + + +class ToolsDeleteResponse_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[DtmfToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsDeleteResponse_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[EndCallToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsDeleteResponse_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[FunctionToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsDeleteResponse_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[GhlToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + metadata: GhlToolMetadata + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsDeleteResponse_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[MakeToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + metadata: MakeToolMetadata + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsDeleteResponse_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[TransferCallToolMessagesItem]] = None + destinations: typing.Optional[typing.List[TransferCallToolDestinationsItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsDeleteResponse_Output(UniversalBaseModel): + type: typing.Literal["output"] = "output" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[OutputToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ToolsDeleteResponse = typing.Union[ + ToolsDeleteResponse_Dtmf, + ToolsDeleteResponse_EndCall, + ToolsDeleteResponse_Function, + ToolsDeleteResponse_Ghl, + ToolsDeleteResponse_Make, + ToolsDeleteResponse_TransferCall, + ToolsDeleteResponse_Output, +] diff --git a/src/vapi/tools/types/tools_get_response.py b/src/vapi/tools/types/tools_get_response.py new file mode 100644 index 0000000..6b690a5 --- /dev/null +++ b/src/vapi/tools/types/tools_get_response.py @@ -0,0 +1,183 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...core.serialization import FieldMetadata +from ...types.dtmf_tool_messages_item import DtmfToolMessagesItem +import datetime as dt +from ...types.open_ai_function import OpenAiFunction +from ...types.server import Server +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.end_call_tool_messages_item import EndCallToolMessagesItem +from ...types.function_tool_messages_item import FunctionToolMessagesItem +from ...types.ghl_tool_messages_item import GhlToolMessagesItem +from ...types.ghl_tool_metadata import GhlToolMetadata +from ...types.make_tool_messages_item import MakeToolMessagesItem +from ...types.make_tool_metadata import MakeToolMetadata +from ...types.transfer_call_tool_messages_item import TransferCallToolMessagesItem +from ...types.transfer_call_tool_destinations_item import TransferCallToolDestinationsItem +from ...types.output_tool_messages_item import OutputToolMessagesItem + + +class ToolsGetResponse_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[DtmfToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsGetResponse_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[EndCallToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsGetResponse_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[FunctionToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsGetResponse_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[GhlToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + metadata: GhlToolMetadata + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsGetResponse_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[MakeToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + metadata: MakeToolMetadata + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsGetResponse_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[TransferCallToolMessagesItem]] = None + destinations: typing.Optional[typing.List[TransferCallToolDestinationsItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsGetResponse_Output(UniversalBaseModel): + type: typing.Literal["output"] = "output" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[OutputToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ToolsGetResponse = typing.Union[ + ToolsGetResponse_Dtmf, + ToolsGetResponse_EndCall, + ToolsGetResponse_Function, + ToolsGetResponse_Ghl, + ToolsGetResponse_Make, + ToolsGetResponse_TransferCall, + ToolsGetResponse_Output, +] diff --git a/src/vapi/tools/types/tools_list_response_item.py b/src/vapi/tools/types/tools_list_response_item.py new file mode 100644 index 0000000..ecebb2a --- /dev/null +++ b/src/vapi/tools/types/tools_list_response_item.py @@ -0,0 +1,183 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...core.serialization import FieldMetadata +from ...types.dtmf_tool_messages_item import DtmfToolMessagesItem +import datetime as dt +from ...types.open_ai_function import OpenAiFunction +from ...types.server import Server +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.end_call_tool_messages_item import EndCallToolMessagesItem +from ...types.function_tool_messages_item import FunctionToolMessagesItem +from ...types.ghl_tool_messages_item import GhlToolMessagesItem +from ...types.ghl_tool_metadata import GhlToolMetadata +from ...types.make_tool_messages_item import MakeToolMessagesItem +from ...types.make_tool_metadata import MakeToolMetadata +from ...types.transfer_call_tool_messages_item import TransferCallToolMessagesItem +from ...types.transfer_call_tool_destinations_item import TransferCallToolDestinationsItem +from ...types.output_tool_messages_item import OutputToolMessagesItem + + +class ToolsListResponseItem_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[DtmfToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsListResponseItem_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[EndCallToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsListResponseItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[FunctionToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsListResponseItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[GhlToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + metadata: GhlToolMetadata + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsListResponseItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[MakeToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + metadata: MakeToolMetadata + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsListResponseItem_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[TransferCallToolMessagesItem]] = None + destinations: typing.Optional[typing.List[TransferCallToolDestinationsItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsListResponseItem_Output(UniversalBaseModel): + type: typing.Literal["output"] = "output" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[OutputToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ToolsListResponseItem = typing.Union[ + ToolsListResponseItem_Dtmf, + ToolsListResponseItem_EndCall, + ToolsListResponseItem_Function, + ToolsListResponseItem_Ghl, + ToolsListResponseItem_Make, + ToolsListResponseItem_TransferCall, + ToolsListResponseItem_Output, +] diff --git a/src/vapi/tools/types/tools_update_response.py b/src/vapi/tools/types/tools_update_response.py new file mode 100644 index 0000000..0fef27b --- /dev/null +++ b/src/vapi/tools/types/tools_update_response.py @@ -0,0 +1,183 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ...core.serialization import FieldMetadata +from ...types.dtmf_tool_messages_item import DtmfToolMessagesItem +import datetime as dt +from ...types.open_ai_function import OpenAiFunction +from ...types.server import Server +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.end_call_tool_messages_item import EndCallToolMessagesItem +from ...types.function_tool_messages_item import FunctionToolMessagesItem +from ...types.ghl_tool_messages_item import GhlToolMessagesItem +from ...types.ghl_tool_metadata import GhlToolMetadata +from ...types.make_tool_messages_item import MakeToolMessagesItem +from ...types.make_tool_metadata import MakeToolMetadata +from ...types.transfer_call_tool_messages_item import TransferCallToolMessagesItem +from ...types.transfer_call_tool_destinations_item import TransferCallToolDestinationsItem +from ...types.output_tool_messages_item import OutputToolMessagesItem + + +class ToolsUpdateResponse_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[DtmfToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsUpdateResponse_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[EndCallToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsUpdateResponse_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[FunctionToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsUpdateResponse_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[GhlToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + metadata: GhlToolMetadata + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsUpdateResponse_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[MakeToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + metadata: MakeToolMetadata + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsUpdateResponse_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[TransferCallToolMessagesItem]] = None + destinations: typing.Optional[typing.List[TransferCallToolDestinationsItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolsUpdateResponse_Output(UniversalBaseModel): + type: typing.Literal["output"] = "output" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[OutputToolMessagesItem]] = None + id: str + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ToolsUpdateResponse = typing.Union[ + ToolsUpdateResponse_Dtmf, + ToolsUpdateResponse_EndCall, + ToolsUpdateResponse_Function, + ToolsUpdateResponse_Ghl, + ToolsUpdateResponse_Make, + ToolsUpdateResponse_TransferCall, + ToolsUpdateResponse_Output, +] diff --git a/src/vapi/tools/types/update_tool_dto_messages_item.py b/src/vapi/tools/types/update_tool_dto_messages_item.py new file mode 100644 index 0000000..fe25c79 --- /dev/null +++ b/src/vapi/tools/types/update_tool_dto_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.pydantic_utilities import UniversalBaseModel +import typing +from ...types.condition import Condition +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ...core.serialization import FieldMetadata + + +class UpdateToolDtoMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateToolDtoMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateToolDtoMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateToolDtoMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +UpdateToolDtoMessagesItem = typing.Union[ + UpdateToolDtoMessagesItem_RequestStart, + UpdateToolDtoMessagesItem_RequestComplete, + UpdateToolDtoMessagesItem_RequestFailed, + UpdateToolDtoMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/__init__.py b/src/vapi/types/__init__.py new file mode 100644 index 0000000..4300ad3 --- /dev/null +++ b/src/vapi/types/__init__.py @@ -0,0 +1,2069 @@ +# This file was auto-generated by Fern from our API Definition. + +from .add_voice_to_provider_dto import AddVoiceToProviderDto +from .analysis import Analysis +from .analysis_cost import AnalysisCost +from .analysis_cost_analysis_type import AnalysisCostAnalysisType +from .analysis_cost_breakdown import AnalysisCostBreakdown +from .analysis_plan import AnalysisPlan +from .analytics_operation import AnalyticsOperation +from .analytics_operation_column import AnalyticsOperationColumn +from .analytics_operation_operation import AnalyticsOperationOperation +from .analytics_query import AnalyticsQuery +from .analytics_query_group_by_item import AnalyticsQueryGroupByItem +from .analytics_query_result import AnalyticsQueryResult +from .anthropic_credential import AnthropicCredential +from .anthropic_model import AnthropicModel +from .anthropic_model_model import AnthropicModelModel +from .anthropic_model_tools_item import ( + AnthropicModelToolsItem, + AnthropicModelToolsItem_Dtmf, + AnthropicModelToolsItem_EndCall, + AnthropicModelToolsItem_Function, + AnthropicModelToolsItem_Ghl, + AnthropicModelToolsItem_Make, + AnthropicModelToolsItem_TransferCall, + AnthropicModelToolsItem_Voicemail, +) +from .anyscale_credential import AnyscaleCredential +from .anyscale_model import AnyscaleModel +from .anyscale_model_tools_item import ( + AnyscaleModelToolsItem, + AnyscaleModelToolsItem_Dtmf, + AnyscaleModelToolsItem_EndCall, + AnyscaleModelToolsItem_Function, + AnyscaleModelToolsItem_Ghl, + AnyscaleModelToolsItem_Make, + AnyscaleModelToolsItem_TransferCall, + AnyscaleModelToolsItem_Voicemail, +) +from .artifact import Artifact +from .artifact_messages_item import ArtifactMessagesItem +from .artifact_plan import ArtifactPlan +from .assignment_mutation import AssignmentMutation +from .assignment_mutation_conditions_item import ( + AssignmentMutationConditionsItem, + AssignmentMutationConditionsItem_ModelBased, + AssignmentMutationConditionsItem_RuleBased, +) +from .assistant import Assistant +from .assistant_background_sound import AssistantBackgroundSound +from .assistant_client_messages_item import AssistantClientMessagesItem +from .assistant_first_message_mode import AssistantFirstMessageMode +from .assistant_model import ( + AssistantModel, + AssistantModel_Anthropic, + AssistantModel_Anyscale, + AssistantModel_CustomLlm, + AssistantModel_Deepinfra, + AssistantModel_Groq, + AssistantModel_Openai, + AssistantModel_Openrouter, + AssistantModel_PerplexityAi, + AssistantModel_TogetherAi, + AssistantModel_Vapi, +) +from .assistant_overrides import AssistantOverrides +from .assistant_overrides_background_sound import AssistantOverridesBackgroundSound +from .assistant_overrides_client_messages_item import AssistantOverridesClientMessagesItem +from .assistant_overrides_first_message_mode import AssistantOverridesFirstMessageMode +from .assistant_overrides_model import ( + AssistantOverridesModel, + AssistantOverridesModel_Anthropic, + AssistantOverridesModel_Anyscale, + AssistantOverridesModel_CustomLlm, + AssistantOverridesModel_Deepinfra, + AssistantOverridesModel_Groq, + AssistantOverridesModel_Openai, + AssistantOverridesModel_Openrouter, + AssistantOverridesModel_PerplexityAi, + AssistantOverridesModel_TogetherAi, + AssistantOverridesModel_Vapi, +) +from .assistant_overrides_server_messages_item import AssistantOverridesServerMessagesItem +from .assistant_overrides_transcriber import ( + AssistantOverridesTranscriber, + AssistantOverridesTranscriber_Deepgram, + AssistantOverridesTranscriber_Gladia, + AssistantOverridesTranscriber_Talkscriber, +) +from .assistant_overrides_voice import ( + AssistantOverridesVoice, + AssistantOverridesVoice_11Labs, + AssistantOverridesVoice_Azure, + AssistantOverridesVoice_Cartesia, + AssistantOverridesVoice_Deepgram, + AssistantOverridesVoice_Lmnt, + AssistantOverridesVoice_Neets, + AssistantOverridesVoice_Openai, + AssistantOverridesVoice_Playht, + AssistantOverridesVoice_RimeAi, +) +from .assistant_server_messages_item import AssistantServerMessagesItem +from .assistant_transcriber import ( + AssistantTranscriber, + AssistantTranscriber_Deepgram, + AssistantTranscriber_Gladia, + AssistantTranscriber_Talkscriber, +) +from .assistant_voice import ( + AssistantVoice, + AssistantVoice_11Labs, + AssistantVoice_Azure, + AssistantVoice_Cartesia, + AssistantVoice_Deepgram, + AssistantVoice_Lmnt, + AssistantVoice_Neets, + AssistantVoice_Openai, + AssistantVoice_Playht, + AssistantVoice_RimeAi, +) +from .azure_open_ai_credential import AzureOpenAiCredential +from .azure_open_ai_credential_models_item import AzureOpenAiCredentialModelsItem +from .azure_open_ai_credential_region import AzureOpenAiCredentialRegion +from .azure_voice import AzureVoice +from .azure_voice_voice_id import AzureVoiceVoiceId +from .block_complete_message import BlockCompleteMessage +from .block_complete_message_conditions_item import ( + BlockCompleteMessageConditionsItem, + BlockCompleteMessageConditionsItem_ModelBased, + BlockCompleteMessageConditionsItem_RuleBased, +) +from .block_start_message import BlockStartMessage +from .block_start_message_conditions_item import ( + BlockStartMessageConditionsItem, + BlockStartMessageConditionsItem_ModelBased, + BlockStartMessageConditionsItem_RuleBased, +) +from .bot_message import BotMessage +from .bucket_plan import BucketPlan +from .buy_phone_number_dto import BuyPhoneNumberDto +from .buy_phone_number_dto_fallback_destination import ( + BuyPhoneNumberDtoFallbackDestination, + BuyPhoneNumberDtoFallbackDestination_Number, + BuyPhoneNumberDtoFallbackDestination_Sip, +) +from .byo_phone_number import ByoPhoneNumber +from .byo_phone_number_fallback_destination import ( + ByoPhoneNumberFallbackDestination, + ByoPhoneNumberFallbackDestination_Number, + ByoPhoneNumberFallbackDestination_Sip, +) +from .byo_sip_trunk_credential import ByoSipTrunkCredential +from .call import Call +from .call_costs_item import ( + CallCostsItem, + CallCostsItem_Analysis, + CallCostsItem_Model, + CallCostsItem_Transcriber, + CallCostsItem_Transport, + CallCostsItem_Vapi, + CallCostsItem_Voice, +) +from .call_destination import CallDestination, CallDestination_Number, CallDestination_Sip +from .call_ended_reason import CallEndedReason +from .call_messages_item import CallMessagesItem +from .call_paginated_response import CallPaginatedResponse +from .call_phone_call_provider import CallPhoneCallProvider +from .call_phone_call_transport import CallPhoneCallTransport +from .call_status import CallStatus +from .call_type import CallType +from .callback_step import CallbackStep +from .callback_step_block import ( + CallbackStepBlock, + CallbackStepBlock_Conversation, + CallbackStepBlock_ToolCall, + CallbackStepBlock_Workflow, +) +from .cartesia_credential import CartesiaCredential +from .cartesia_voice import CartesiaVoice +from .cartesia_voice_language import CartesiaVoiceLanguage +from .cartesia_voice_model import CartesiaVoiceModel +from .chunk_plan import ChunkPlan +from .chunk_plan_punctuation_boundaries_item import ChunkPlanPunctuationBoundariesItem +from .client_inbound_message import ClientInboundMessage +from .client_inbound_message_add_message import ClientInboundMessageAddMessage +from .client_inbound_message_control import ClientInboundMessageControl +from .client_inbound_message_control_control import ClientInboundMessageControlControl +from .client_inbound_message_message import ( + ClientInboundMessageMessage, + ClientInboundMessageMessage_AddMessage, + ClientInboundMessageMessage_Control, + ClientInboundMessageMessage_Say, +) +from .client_inbound_message_say import ClientInboundMessageSay +from .client_message import ClientMessage +from .client_message_conversation_update import ClientMessageConversationUpdate +from .client_message_conversation_update_messages_item import ClientMessageConversationUpdateMessagesItem +from .client_message_hang import ClientMessageHang +from .client_message_language_changed import ClientMessageLanguageChanged +from .client_message_message import ( + ClientMessageMessage, + ClientMessageMessage_ConversationUpdate, + ClientMessageMessage_Hang, + ClientMessageMessage_LanguageChanged, + ClientMessageMessage_Metadata, + ClientMessageMessage_ModelOutput, + ClientMessageMessage_SpeechUpdate, + ClientMessageMessage_ToolCalls, + ClientMessageMessage_ToolCallsResult, + ClientMessageMessage_Transcript, + ClientMessageMessage_UserInterrupted, + ClientMessageMessage_VoiceInput, +) +from .client_message_metadata import ClientMessageMetadata +from .client_message_model_output import ClientMessageModelOutput +from .client_message_speech_update import ClientMessageSpeechUpdate +from .client_message_speech_update_role import ClientMessageSpeechUpdateRole +from .client_message_speech_update_status import ClientMessageSpeechUpdateStatus +from .client_message_tool_calls import ClientMessageToolCalls +from .client_message_tool_calls_result import ClientMessageToolCallsResult +from .client_message_tool_calls_tool_with_tool_call_list_item import ( + ClientMessageToolCallsToolWithToolCallListItem, + ClientMessageToolCallsToolWithToolCallListItem_Function, + ClientMessageToolCallsToolWithToolCallListItem_Ghl, + ClientMessageToolCallsToolWithToolCallListItem_Make, +) +from .client_message_transcript import ClientMessageTranscript +from .client_message_transcript_role import ClientMessageTranscriptRole +from .client_message_transcript_transcript_type import ClientMessageTranscriptTranscriptType +from .client_message_user_interrupted import ClientMessageUserInterrupted +from .client_message_voice_input import ClientMessageVoiceInput +from .clone_voice_dto import CloneVoiceDto +from .condition import Condition +from .condition_operator import ConditionOperator +from .conversation_block import ConversationBlock +from .conversation_block_messages_item import ( + ConversationBlockMessagesItem, + ConversationBlockMessagesItem_BlockComplete, + ConversationBlockMessagesItem_BlockStart, +) +from .cost_breakdown import CostBreakdown +from .create_anthropic_credential_dto import CreateAnthropicCredentialDto +from .create_anyscale_credential_dto import CreateAnyscaleCredentialDto +from .create_assistant_dto import CreateAssistantDto +from .create_assistant_dto_background_sound import CreateAssistantDtoBackgroundSound +from .create_assistant_dto_client_messages_item import CreateAssistantDtoClientMessagesItem +from .create_assistant_dto_first_message_mode import CreateAssistantDtoFirstMessageMode +from .create_assistant_dto_model import ( + CreateAssistantDtoModel, + CreateAssistantDtoModel_Anthropic, + CreateAssistantDtoModel_Anyscale, + CreateAssistantDtoModel_CustomLlm, + CreateAssistantDtoModel_Deepinfra, + CreateAssistantDtoModel_Groq, + CreateAssistantDtoModel_Openai, + CreateAssistantDtoModel_Openrouter, + CreateAssistantDtoModel_PerplexityAi, + CreateAssistantDtoModel_TogetherAi, + CreateAssistantDtoModel_Vapi, +) +from .create_assistant_dto_server_messages_item import CreateAssistantDtoServerMessagesItem +from .create_assistant_dto_transcriber import ( + CreateAssistantDtoTranscriber, + CreateAssistantDtoTranscriber_Deepgram, + CreateAssistantDtoTranscriber_Gladia, + CreateAssistantDtoTranscriber_Talkscriber, +) +from .create_assistant_dto_voice import ( + CreateAssistantDtoVoice, + CreateAssistantDtoVoice_11Labs, + CreateAssistantDtoVoice_Azure, + CreateAssistantDtoVoice_Cartesia, + CreateAssistantDtoVoice_Deepgram, + CreateAssistantDtoVoice_Lmnt, + CreateAssistantDtoVoice_Neets, + CreateAssistantDtoVoice_Openai, + CreateAssistantDtoVoice_Playht, + CreateAssistantDtoVoice_RimeAi, +) +from .create_azure_open_ai_credential_dto import CreateAzureOpenAiCredentialDto +from .create_azure_open_ai_credential_dto_models_item import CreateAzureOpenAiCredentialDtoModelsItem +from .create_azure_open_ai_credential_dto_region import CreateAzureOpenAiCredentialDtoRegion +from .create_byo_phone_number_dto import CreateByoPhoneNumberDto +from .create_byo_phone_number_dto_fallback_destination import ( + CreateByoPhoneNumberDtoFallbackDestination, + CreateByoPhoneNumberDtoFallbackDestination_Number, + CreateByoPhoneNumberDtoFallbackDestination_Sip, +) +from .create_byo_sip_trunk_credential_dto import CreateByoSipTrunkCredentialDto +from .create_cartesia_credential_dto import CreateCartesiaCredentialDto +from .create_conversation_block_dto import CreateConversationBlockDto +from .create_conversation_block_dto_messages_item import ( + CreateConversationBlockDtoMessagesItem, + CreateConversationBlockDtoMessagesItem_BlockComplete, + CreateConversationBlockDtoMessagesItem_BlockStart, +) +from .create_custom_llm_credential_dto import CreateCustomLlmCredentialDto +from .create_customer_dto import CreateCustomerDto +from .create_deep_infra_credential_dto import CreateDeepInfraCredentialDto +from .create_deepgram_credential_dto import CreateDeepgramCredentialDto +from .create_dtmf_tool_dto import CreateDtmfToolDto +from .create_dtmf_tool_dto_messages_item import ( + CreateDtmfToolDtoMessagesItem, + CreateDtmfToolDtoMessagesItem_RequestComplete, + CreateDtmfToolDtoMessagesItem_RequestFailed, + CreateDtmfToolDtoMessagesItem_RequestResponseDelayed, + CreateDtmfToolDtoMessagesItem_RequestStart, +) +from .create_eleven_labs_credential_dto import CreateElevenLabsCredentialDto +from .create_end_call_tool_dto import CreateEndCallToolDto +from .create_end_call_tool_dto_messages_item import ( + CreateEndCallToolDtoMessagesItem, + CreateEndCallToolDtoMessagesItem_RequestComplete, + CreateEndCallToolDtoMessagesItem_RequestFailed, + CreateEndCallToolDtoMessagesItem_RequestResponseDelayed, + CreateEndCallToolDtoMessagesItem_RequestStart, +) +from .create_function_tool_dto import CreateFunctionToolDto +from .create_function_tool_dto_messages_item import ( + CreateFunctionToolDtoMessagesItem, + CreateFunctionToolDtoMessagesItem_RequestComplete, + CreateFunctionToolDtoMessagesItem_RequestFailed, + CreateFunctionToolDtoMessagesItem_RequestResponseDelayed, + CreateFunctionToolDtoMessagesItem_RequestStart, +) +from .create_gcp_credential_dto import CreateGcpCredentialDto +from .create_ghl_tool_dto import CreateGhlToolDto +from .create_ghl_tool_dto_messages_item import ( + CreateGhlToolDtoMessagesItem, + CreateGhlToolDtoMessagesItem_RequestComplete, + CreateGhlToolDtoMessagesItem_RequestFailed, + CreateGhlToolDtoMessagesItem_RequestResponseDelayed, + CreateGhlToolDtoMessagesItem_RequestStart, +) +from .create_gladia_credential_dto import CreateGladiaCredentialDto +from .create_go_high_level_credential_dto import CreateGoHighLevelCredentialDto +from .create_groq_credential_dto import CreateGroqCredentialDto +from .create_lmnt_credential_dto import CreateLmntCredentialDto +from .create_make_credential_dto import CreateMakeCredentialDto +from .create_make_tool_dto import CreateMakeToolDto +from .create_make_tool_dto_messages_item import ( + CreateMakeToolDtoMessagesItem, + CreateMakeToolDtoMessagesItem_RequestComplete, + CreateMakeToolDtoMessagesItem_RequestFailed, + CreateMakeToolDtoMessagesItem_RequestResponseDelayed, + CreateMakeToolDtoMessagesItem_RequestStart, +) +from .create_open_ai_credential_dto import CreateOpenAiCredentialDto +from .create_open_router_credential_dto import CreateOpenRouterCredentialDto +from .create_org_dto import CreateOrgDto +from .create_outbound_call_dto import CreateOutboundCallDto +from .create_output_tool_dto import CreateOutputToolDto +from .create_output_tool_dto_messages_item import ( + CreateOutputToolDtoMessagesItem, + CreateOutputToolDtoMessagesItem_RequestComplete, + CreateOutputToolDtoMessagesItem_RequestFailed, + CreateOutputToolDtoMessagesItem_RequestResponseDelayed, + CreateOutputToolDtoMessagesItem_RequestStart, +) +from .create_perplexity_ai_credential_dto import CreatePerplexityAiCredentialDto +from .create_play_ht_credential_dto import CreatePlayHtCredentialDto +from .create_rime_ai_credential_dto import CreateRimeAiCredentialDto +from .create_runpod_credential_dto import CreateRunpodCredentialDto +from .create_s_3_credential_dto import CreateS3CredentialDto +from .create_squad_dto import CreateSquadDto +from .create_together_ai_credential_dto import CreateTogetherAiCredentialDto +from .create_token_dto import CreateTokenDto +from .create_token_dto_tag import CreateTokenDtoTag +from .create_tool_call_block_dto import CreateToolCallBlockDto +from .create_tool_call_block_dto_messages_item import ( + CreateToolCallBlockDtoMessagesItem, + CreateToolCallBlockDtoMessagesItem_BlockComplete, + CreateToolCallBlockDtoMessagesItem_BlockStart, +) +from .create_tool_call_block_dto_tool import ( + CreateToolCallBlockDtoTool, + CreateToolCallBlockDtoTool_Dtmf, + CreateToolCallBlockDtoTool_EndCall, + CreateToolCallBlockDtoTool_Function, + CreateToolCallBlockDtoTool_Ghl, + CreateToolCallBlockDtoTool_Make, + CreateToolCallBlockDtoTool_TransferCall, + CreateToolCallBlockDtoTool_Voicemail, +) +from .create_tool_template_dto import CreateToolTemplateDto +from .create_tool_template_dto_details import ( + CreateToolTemplateDtoDetails, + CreateToolTemplateDtoDetails_Dtmf, + CreateToolTemplateDtoDetails_EndCall, + CreateToolTemplateDtoDetails_Function, + CreateToolTemplateDtoDetails_Ghl, + CreateToolTemplateDtoDetails_Make, + CreateToolTemplateDtoDetails_TransferCall, + CreateToolTemplateDtoDetails_Voicemail, +) +from .create_tool_template_dto_provider import CreateToolTemplateDtoProvider +from .create_tool_template_dto_provider_details import ( + CreateToolTemplateDtoProviderDetails, + CreateToolTemplateDtoProviderDetails_Function, + CreateToolTemplateDtoProviderDetails_Ghl, + CreateToolTemplateDtoProviderDetails_Make, +) +from .create_tool_template_dto_visibility import CreateToolTemplateDtoVisibility +from .create_transfer_call_tool_dto import CreateTransferCallToolDto +from .create_transfer_call_tool_dto_destinations_item import ( + CreateTransferCallToolDtoDestinationsItem, + CreateTransferCallToolDtoDestinationsItem_Assistant, + CreateTransferCallToolDtoDestinationsItem_Number, + CreateTransferCallToolDtoDestinationsItem_Sip, + CreateTransferCallToolDtoDestinationsItem_Step, +) +from .create_transfer_call_tool_dto_messages_item import ( + CreateTransferCallToolDtoMessagesItem, + CreateTransferCallToolDtoMessagesItem_RequestComplete, + CreateTransferCallToolDtoMessagesItem_RequestFailed, + CreateTransferCallToolDtoMessagesItem_RequestResponseDelayed, + CreateTransferCallToolDtoMessagesItem_RequestStart, +) +from .create_twilio_credential_dto import CreateTwilioCredentialDto +from .create_twilio_phone_number_dto import CreateTwilioPhoneNumberDto +from .create_twilio_phone_number_dto_fallback_destination import ( + CreateTwilioPhoneNumberDtoFallbackDestination, + CreateTwilioPhoneNumberDtoFallbackDestination_Number, + CreateTwilioPhoneNumberDtoFallbackDestination_Sip, +) +from .create_vapi_phone_number_dto import CreateVapiPhoneNumberDto +from .create_vapi_phone_number_dto_fallback_destination import ( + CreateVapiPhoneNumberDtoFallbackDestination, + CreateVapiPhoneNumberDtoFallbackDestination_Number, + CreateVapiPhoneNumberDtoFallbackDestination_Sip, +) +from .create_voicemail_tool_dto import CreateVoicemailToolDto +from .create_voicemail_tool_dto_messages_item import ( + CreateVoicemailToolDtoMessagesItem, + CreateVoicemailToolDtoMessagesItem_RequestComplete, + CreateVoicemailToolDtoMessagesItem_RequestFailed, + CreateVoicemailToolDtoMessagesItem_RequestResponseDelayed, + CreateVoicemailToolDtoMessagesItem_RequestStart, +) +from .create_vonage_credential_dto import CreateVonageCredentialDto +from .create_vonage_phone_number_dto import CreateVonagePhoneNumberDto +from .create_vonage_phone_number_dto_fallback_destination import ( + CreateVonagePhoneNumberDtoFallbackDestination, + CreateVonagePhoneNumberDtoFallbackDestination_Number, + CreateVonagePhoneNumberDtoFallbackDestination_Sip, +) +from .create_web_call_dto import CreateWebCallDto +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .create_workflow_block_dto_messages_item import ( + CreateWorkflowBlockDtoMessagesItem, + CreateWorkflowBlockDtoMessagesItem_BlockComplete, + CreateWorkflowBlockDtoMessagesItem_BlockStart, +) +from .create_workflow_block_dto_steps_item import ( + CreateWorkflowBlockDtoStepsItem, + CreateWorkflowBlockDtoStepsItem_Callback, + CreateWorkflowBlockDtoStepsItem_Handoff, +) +from .custom_llm_credential import CustomLlmCredential +from .custom_llm_model import CustomLlmModel +from .custom_llm_model_metadata_send_mode import CustomLlmModelMetadataSendMode +from .custom_llm_model_tools_item import ( + CustomLlmModelToolsItem, + CustomLlmModelToolsItem_Dtmf, + CustomLlmModelToolsItem_EndCall, + CustomLlmModelToolsItem_Function, + CustomLlmModelToolsItem_Ghl, + CustomLlmModelToolsItem_Make, + CustomLlmModelToolsItem_TransferCall, + CustomLlmModelToolsItem_Voicemail, +) +from .deep_infra_credential import DeepInfraCredential +from .deep_infra_model import DeepInfraModel +from .deep_infra_model_tools_item import ( + DeepInfraModelToolsItem, + DeepInfraModelToolsItem_Dtmf, + DeepInfraModelToolsItem_EndCall, + DeepInfraModelToolsItem_Function, + DeepInfraModelToolsItem_Ghl, + DeepInfraModelToolsItem_Make, + DeepInfraModelToolsItem_TransferCall, + DeepInfraModelToolsItem_Voicemail, +) +from .deepgram_credential import DeepgramCredential +from .deepgram_transcriber import DeepgramTranscriber +from .deepgram_transcriber_language import DeepgramTranscriberLanguage +from .deepgram_transcriber_model import DeepgramTranscriberModel +from .deepgram_voice import DeepgramVoice +from .deepgram_voice_voice_id import DeepgramVoiceVoiceId +from .dtmf_tool import DtmfTool +from .dtmf_tool_messages_item import ( + DtmfToolMessagesItem, + DtmfToolMessagesItem_RequestComplete, + DtmfToolMessagesItem_RequestFailed, + DtmfToolMessagesItem_RequestResponseDelayed, + DtmfToolMessagesItem_RequestStart, +) +from .eleven_labs_credential import ElevenLabsCredential +from .eleven_labs_voice import ElevenLabsVoice +from .eleven_labs_voice_model import ElevenLabsVoiceModel +from .eleven_labs_voice_voice_id import ElevenLabsVoiceVoiceId +from .end_call_tool import EndCallTool +from .end_call_tool_messages_item import ( + EndCallToolMessagesItem, + EndCallToolMessagesItem_RequestComplete, + EndCallToolMessagesItem_RequestFailed, + EndCallToolMessagesItem_RequestResponseDelayed, + EndCallToolMessagesItem_RequestStart, +) +from .error import Error +from .exact_replacement import ExactReplacement +from .file import File +from .file_status import FileStatus +from .format_plan import FormatPlan +from .format_plan_replacements_item import ( + FormatPlanReplacementsItem, + FormatPlanReplacementsItem_Exact, + FormatPlanReplacementsItem_Regex, +) +from .function_tool import FunctionTool +from .function_tool_messages_item import ( + FunctionToolMessagesItem, + FunctionToolMessagesItem_RequestComplete, + FunctionToolMessagesItem_RequestFailed, + FunctionToolMessagesItem_RequestResponseDelayed, + FunctionToolMessagesItem_RequestStart, +) +from .function_tool_provider_details import FunctionToolProviderDetails +from .function_tool_with_tool_call import FunctionToolWithToolCall +from .function_tool_with_tool_call_messages_item import ( + FunctionToolWithToolCallMessagesItem, + FunctionToolWithToolCallMessagesItem_RequestComplete, + FunctionToolWithToolCallMessagesItem_RequestFailed, + FunctionToolWithToolCallMessagesItem_RequestResponseDelayed, + FunctionToolWithToolCallMessagesItem_RequestStart, +) +from .gcp_credential import GcpCredential +from .gcp_key import GcpKey +from .ghl_tool import GhlTool +from .ghl_tool_messages_item import ( + GhlToolMessagesItem, + GhlToolMessagesItem_RequestComplete, + GhlToolMessagesItem_RequestFailed, + GhlToolMessagesItem_RequestResponseDelayed, + GhlToolMessagesItem_RequestStart, +) +from .ghl_tool_metadata import GhlToolMetadata +from .ghl_tool_provider_details import GhlToolProviderDetails +from .ghl_tool_with_tool_call import GhlToolWithToolCall +from .ghl_tool_with_tool_call_messages_item import ( + GhlToolWithToolCallMessagesItem, + GhlToolWithToolCallMessagesItem_RequestComplete, + GhlToolWithToolCallMessagesItem_RequestFailed, + GhlToolWithToolCallMessagesItem_RequestResponseDelayed, + GhlToolWithToolCallMessagesItem_RequestStart, +) +from .gladia_credential import GladiaCredential +from .gladia_transcriber import GladiaTranscriber +from .gladia_transcriber_language import GladiaTranscriberLanguage +from .gladia_transcriber_language_behaviour import GladiaTranscriberLanguageBehaviour +from .gladia_transcriber_model import GladiaTranscriberModel +from .go_high_level_credential import GoHighLevelCredential +from .groq_credential import GroqCredential +from .groq_model import GroqModel +from .groq_model_model import GroqModelModel +from .groq_model_tools_item import ( + GroqModelToolsItem, + GroqModelToolsItem_Dtmf, + GroqModelToolsItem_EndCall, + GroqModelToolsItem_Function, + GroqModelToolsItem_Ghl, + GroqModelToolsItem_Make, + GroqModelToolsItem_TransferCall, + GroqModelToolsItem_Voicemail, +) +from .handoff_step import HandoffStep +from .handoff_step_block import ( + HandoffStepBlock, + HandoffStepBlock_Conversation, + HandoffStepBlock_ToolCall, + HandoffStepBlock_Workflow, +) +from .import_twilio_phone_number_dto import ImportTwilioPhoneNumberDto +from .import_twilio_phone_number_dto_fallback_destination import ( + ImportTwilioPhoneNumberDtoFallbackDestination, + ImportTwilioPhoneNumberDtoFallbackDestination_Number, + ImportTwilioPhoneNumberDtoFallbackDestination_Sip, +) +from .import_vonage_phone_number_dto import ImportVonagePhoneNumberDto +from .import_vonage_phone_number_dto_fallback_destination import ( + ImportVonagePhoneNumberDtoFallbackDestination, + ImportVonagePhoneNumberDtoFallbackDestination_Number, + ImportVonagePhoneNumberDtoFallbackDestination_Sip, +) +from .invite_user_dto import InviteUserDto +from .invite_user_dto_role import InviteUserDtoRole +from .json_schema import JsonSchema +from .json_schema_type import JsonSchemaType +from .knowledge_base import KnowledgeBase +from .lmnt_credential import LmntCredential +from .lmnt_voice import LmntVoice +from .lmnt_voice_voice_id import LmntVoiceVoiceId +from .log import Log +from .log_request_http_method import LogRequestHttpMethod +from .log_resource import LogResource +from .log_type import LogType +from .logs_paginated_response import LogsPaginatedResponse +from .make_credential import MakeCredential +from .make_tool import MakeTool +from .make_tool_messages_item import ( + MakeToolMessagesItem, + MakeToolMessagesItem_RequestComplete, + MakeToolMessagesItem_RequestFailed, + MakeToolMessagesItem_RequestResponseDelayed, + MakeToolMessagesItem_RequestStart, +) +from .make_tool_metadata import MakeToolMetadata +from .make_tool_provider_details import MakeToolProviderDetails +from .make_tool_with_tool_call import MakeToolWithToolCall +from .make_tool_with_tool_call_messages_item import ( + MakeToolWithToolCallMessagesItem, + MakeToolWithToolCallMessagesItem_RequestComplete, + MakeToolWithToolCallMessagesItem_RequestFailed, + MakeToolWithToolCallMessagesItem_RequestResponseDelayed, + MakeToolWithToolCallMessagesItem_RequestStart, +) +from .message_plan import MessagePlan +from .metrics import Metrics +from .model_based_condition import ModelBasedCondition +from .model_cost import ModelCost +from .monitor import Monitor +from .monitor_plan import MonitorPlan +from .neets_voice import NeetsVoice +from .neets_voice_voice_id import NeetsVoiceVoiceId +from .open_ai_credential import OpenAiCredential +from .open_ai_function import OpenAiFunction +from .open_ai_function_parameters import OpenAiFunctionParameters +from .open_ai_message import OpenAiMessage +from .open_ai_message_role import OpenAiMessageRole +from .open_ai_model import OpenAiModel +from .open_ai_model_fallback_models_item import OpenAiModelFallbackModelsItem +from .open_ai_model_model import OpenAiModelModel +from .open_ai_model_tools_item import ( + OpenAiModelToolsItem, + OpenAiModelToolsItem_Dtmf, + OpenAiModelToolsItem_EndCall, + OpenAiModelToolsItem_Function, + OpenAiModelToolsItem_Ghl, + OpenAiModelToolsItem_Make, + OpenAiModelToolsItem_TransferCall, + OpenAiModelToolsItem_Voicemail, +) +from .open_ai_voice import OpenAiVoice +from .open_ai_voice_voice_id import OpenAiVoiceVoiceId +from .open_router_credential import OpenRouterCredential +from .open_router_model import OpenRouterModel +from .open_router_model_tools_item import ( + OpenRouterModelToolsItem, + OpenRouterModelToolsItem_Dtmf, + OpenRouterModelToolsItem_EndCall, + OpenRouterModelToolsItem_Function, + OpenRouterModelToolsItem_Ghl, + OpenRouterModelToolsItem_Make, + OpenRouterModelToolsItem_TransferCall, + OpenRouterModelToolsItem_Voicemail, +) +from .org import Org +from .org_plan import OrgPlan +from .output_tool import OutputTool +from .output_tool_messages_item import ( + OutputToolMessagesItem, + OutputToolMessagesItem_RequestComplete, + OutputToolMessagesItem_RequestFailed, + OutputToolMessagesItem_RequestResponseDelayed, + OutputToolMessagesItem_RequestStart, +) +from .pagination_meta import PaginationMeta +from .perplexity_ai_credential import PerplexityAiCredential +from .perplexity_ai_model import PerplexityAiModel +from .perplexity_ai_model_tools_item import ( + PerplexityAiModelToolsItem, + PerplexityAiModelToolsItem_Dtmf, + PerplexityAiModelToolsItem_EndCall, + PerplexityAiModelToolsItem_Function, + PerplexityAiModelToolsItem_Ghl, + PerplexityAiModelToolsItem_Make, + PerplexityAiModelToolsItem_TransferCall, + PerplexityAiModelToolsItem_Voicemail, +) +from .play_ht_credential import PlayHtCredential +from .play_ht_voice import PlayHtVoice +from .play_ht_voice_emotion import PlayHtVoiceEmotion +from .play_ht_voice_voice_id import PlayHtVoiceVoiceId +from .regex_option import RegexOption +from .regex_option_type import RegexOptionType +from .regex_replacement import RegexReplacement +from .rime_ai_credential import RimeAiCredential +from .rime_ai_voice import RimeAiVoice +from .rime_ai_voice_model import RimeAiVoiceModel +from .rime_ai_voice_voice_id import RimeAiVoiceVoiceId +from .rule_based_condition import RuleBasedCondition +from .rule_based_condition_operator import RuleBasedConditionOperator +from .runpod_credential import RunpodCredential +from .s_3_credential import S3Credential +from .sbc_configuration import SbcConfiguration +from .server import Server +from .server_message import ServerMessage +from .server_message_assistant_request import ServerMessageAssistantRequest +from .server_message_assistant_request_phone_number import ( + ServerMessageAssistantRequestPhoneNumber, + ServerMessageAssistantRequestPhoneNumber_ByoPhoneNumber, + ServerMessageAssistantRequestPhoneNumber_Twilio, + ServerMessageAssistantRequestPhoneNumber_Vapi, + ServerMessageAssistantRequestPhoneNumber_Vonage, +) +from .server_message_conversation_update import ServerMessageConversationUpdate +from .server_message_conversation_update_messages_item import ServerMessageConversationUpdateMessagesItem +from .server_message_conversation_update_phone_number import ( + ServerMessageConversationUpdatePhoneNumber, + ServerMessageConversationUpdatePhoneNumber_ByoPhoneNumber, + ServerMessageConversationUpdatePhoneNumber_Twilio, + ServerMessageConversationUpdatePhoneNumber_Vapi, + ServerMessageConversationUpdatePhoneNumber_Vonage, +) +from .server_message_end_of_call_report import ServerMessageEndOfCallReport +from .server_message_end_of_call_report_costs_item import ( + ServerMessageEndOfCallReportCostsItem, + ServerMessageEndOfCallReportCostsItem_Analysis, + ServerMessageEndOfCallReportCostsItem_Model, + ServerMessageEndOfCallReportCostsItem_Transcriber, + ServerMessageEndOfCallReportCostsItem_Transport, + ServerMessageEndOfCallReportCostsItem_Vapi, + ServerMessageEndOfCallReportCostsItem_Voice, +) +from .server_message_end_of_call_report_ended_reason import ServerMessageEndOfCallReportEndedReason +from .server_message_end_of_call_report_phone_number import ( + ServerMessageEndOfCallReportPhoneNumber, + ServerMessageEndOfCallReportPhoneNumber_ByoPhoneNumber, + ServerMessageEndOfCallReportPhoneNumber_Twilio, + ServerMessageEndOfCallReportPhoneNumber_Vapi, + ServerMessageEndOfCallReportPhoneNumber_Vonage, +) +from .server_message_hang import ServerMessageHang +from .server_message_hang_phone_number import ( + ServerMessageHangPhoneNumber, + ServerMessageHangPhoneNumber_ByoPhoneNumber, + ServerMessageHangPhoneNumber_Twilio, + ServerMessageHangPhoneNumber_Vapi, + ServerMessageHangPhoneNumber_Vonage, +) +from .server_message_language_changed import ServerMessageLanguageChanged +from .server_message_language_changed_phone_number import ( + ServerMessageLanguageChangedPhoneNumber, + ServerMessageLanguageChangedPhoneNumber_ByoPhoneNumber, + ServerMessageLanguageChangedPhoneNumber_Twilio, + ServerMessageLanguageChangedPhoneNumber_Vapi, + ServerMessageLanguageChangedPhoneNumber_Vonage, +) +from .server_message_message import ( + ServerMessageMessage, + ServerMessageMessage_AssistantRequest, + ServerMessageMessage_ConversationUpdate, + ServerMessageMessage_EndOfCallReport, + ServerMessageMessage_Hang, + ServerMessageMessage_LanguageChanged, + ServerMessageMessage_ModelOutput, + ServerMessageMessage_PhoneCallControl, + ServerMessageMessage_SpeechUpdate, + ServerMessageMessage_StatusUpdate, + ServerMessageMessage_ToolCalls, + ServerMessageMessage_Transcript, + ServerMessageMessage_TransferDestinationRequest, + ServerMessageMessage_TransferUpdate, + ServerMessageMessage_UserInterrupted, + ServerMessageMessage_VoiceInput, + ServerMessageMessage_VoiceRequest, +) +from .server_message_model_output import ServerMessageModelOutput +from .server_message_model_output_phone_number import ( + ServerMessageModelOutputPhoneNumber, + ServerMessageModelOutputPhoneNumber_ByoPhoneNumber, + ServerMessageModelOutputPhoneNumber_Twilio, + ServerMessageModelOutputPhoneNumber_Vapi, + ServerMessageModelOutputPhoneNumber_Vonage, +) +from .server_message_phone_call_control import ServerMessagePhoneCallControl +from .server_message_phone_call_control_destination import ( + ServerMessagePhoneCallControlDestination, + ServerMessagePhoneCallControlDestination_Number, + ServerMessagePhoneCallControlDestination_Sip, +) +from .server_message_phone_call_control_phone_number import ( + ServerMessagePhoneCallControlPhoneNumber, + ServerMessagePhoneCallControlPhoneNumber_ByoPhoneNumber, + ServerMessagePhoneCallControlPhoneNumber_Twilio, + ServerMessagePhoneCallControlPhoneNumber_Vapi, + ServerMessagePhoneCallControlPhoneNumber_Vonage, +) +from .server_message_phone_call_control_request import ServerMessagePhoneCallControlRequest +from .server_message_response import ServerMessageResponse +from .server_message_response_assistant_request import ServerMessageResponseAssistantRequest +from .server_message_response_assistant_request_destination import ( + ServerMessageResponseAssistantRequestDestination, + ServerMessageResponseAssistantRequestDestination_Number, + ServerMessageResponseAssistantRequestDestination_Sip, +) +from .server_message_response_message_response import ServerMessageResponseMessageResponse +from .server_message_response_tool_calls import ServerMessageResponseToolCalls +from .server_message_response_transfer_destination_request import ServerMessageResponseTransferDestinationRequest +from .server_message_response_transfer_destination_request_destination import ( + ServerMessageResponseTransferDestinationRequestDestination, + ServerMessageResponseTransferDestinationRequestDestination_Assistant, + ServerMessageResponseTransferDestinationRequestDestination_Number, + ServerMessageResponseTransferDestinationRequestDestination_Sip, + ServerMessageResponseTransferDestinationRequestDestination_Step, +) +from .server_message_response_voice_request import ServerMessageResponseVoiceRequest +from .server_message_speech_update import ServerMessageSpeechUpdate +from .server_message_speech_update_phone_number import ( + ServerMessageSpeechUpdatePhoneNumber, + ServerMessageSpeechUpdatePhoneNumber_ByoPhoneNumber, + ServerMessageSpeechUpdatePhoneNumber_Twilio, + ServerMessageSpeechUpdatePhoneNumber_Vapi, + ServerMessageSpeechUpdatePhoneNumber_Vonage, +) +from .server_message_speech_update_role import ServerMessageSpeechUpdateRole +from .server_message_speech_update_status import ServerMessageSpeechUpdateStatus +from .server_message_status_update import ServerMessageStatusUpdate +from .server_message_status_update_destination import ( + ServerMessageStatusUpdateDestination, + ServerMessageStatusUpdateDestination_Number, + ServerMessageStatusUpdateDestination_Sip, +) +from .server_message_status_update_ended_reason import ServerMessageStatusUpdateEndedReason +from .server_message_status_update_messages_item import ServerMessageStatusUpdateMessagesItem +from .server_message_status_update_phone_number import ( + ServerMessageStatusUpdatePhoneNumber, + ServerMessageStatusUpdatePhoneNumber_ByoPhoneNumber, + ServerMessageStatusUpdatePhoneNumber_Twilio, + ServerMessageStatusUpdatePhoneNumber_Vapi, + ServerMessageStatusUpdatePhoneNumber_Vonage, +) +from .server_message_status_update_status import ServerMessageStatusUpdateStatus +from .server_message_tool_calls import ServerMessageToolCalls +from .server_message_tool_calls_phone_number import ( + ServerMessageToolCallsPhoneNumber, + ServerMessageToolCallsPhoneNumber_ByoPhoneNumber, + ServerMessageToolCallsPhoneNumber_Twilio, + ServerMessageToolCallsPhoneNumber_Vapi, + ServerMessageToolCallsPhoneNumber_Vonage, +) +from .server_message_tool_calls_tool_with_tool_call_list_item import ( + ServerMessageToolCallsToolWithToolCallListItem, + ServerMessageToolCallsToolWithToolCallListItem_Function, + ServerMessageToolCallsToolWithToolCallListItem_Ghl, + ServerMessageToolCallsToolWithToolCallListItem_Make, +) +from .server_message_transcript import ServerMessageTranscript +from .server_message_transcript_phone_number import ( + ServerMessageTranscriptPhoneNumber, + ServerMessageTranscriptPhoneNumber_ByoPhoneNumber, + ServerMessageTranscriptPhoneNumber_Twilio, + ServerMessageTranscriptPhoneNumber_Vapi, + ServerMessageTranscriptPhoneNumber_Vonage, +) +from .server_message_transcript_role import ServerMessageTranscriptRole +from .server_message_transcript_transcript_type import ServerMessageTranscriptTranscriptType +from .server_message_transfer_destination_request import ServerMessageTransferDestinationRequest +from .server_message_transfer_destination_request_phone_number import ( + ServerMessageTransferDestinationRequestPhoneNumber, + ServerMessageTransferDestinationRequestPhoneNumber_ByoPhoneNumber, + ServerMessageTransferDestinationRequestPhoneNumber_Twilio, + ServerMessageTransferDestinationRequestPhoneNumber_Vapi, + ServerMessageTransferDestinationRequestPhoneNumber_Vonage, +) +from .server_message_transfer_update import ServerMessageTransferUpdate +from .server_message_transfer_update_destination import ( + ServerMessageTransferUpdateDestination, + ServerMessageTransferUpdateDestination_Assistant, + ServerMessageTransferUpdateDestination_Number, + ServerMessageTransferUpdateDestination_Sip, + ServerMessageTransferUpdateDestination_Step, +) +from .server_message_transfer_update_phone_number import ( + ServerMessageTransferUpdatePhoneNumber, + ServerMessageTransferUpdatePhoneNumber_ByoPhoneNumber, + ServerMessageTransferUpdatePhoneNumber_Twilio, + ServerMessageTransferUpdatePhoneNumber_Vapi, + ServerMessageTransferUpdatePhoneNumber_Vonage, +) +from .server_message_user_interrupted import ServerMessageUserInterrupted +from .server_message_user_interrupted_phone_number import ( + ServerMessageUserInterruptedPhoneNumber, + ServerMessageUserInterruptedPhoneNumber_ByoPhoneNumber, + ServerMessageUserInterruptedPhoneNumber_Twilio, + ServerMessageUserInterruptedPhoneNumber_Vapi, + ServerMessageUserInterruptedPhoneNumber_Vonage, +) +from .server_message_voice_input import ServerMessageVoiceInput +from .server_message_voice_input_phone_number import ( + ServerMessageVoiceInputPhoneNumber, + ServerMessageVoiceInputPhoneNumber_ByoPhoneNumber, + ServerMessageVoiceInputPhoneNumber_Twilio, + ServerMessageVoiceInputPhoneNumber_Vapi, + ServerMessageVoiceInputPhoneNumber_Vonage, +) +from .server_message_voice_request import ServerMessageVoiceRequest +from .server_message_voice_request_phone_number import ( + ServerMessageVoiceRequestPhoneNumber, + ServerMessageVoiceRequestPhoneNumber_ByoPhoneNumber, + ServerMessageVoiceRequestPhoneNumber_Twilio, + ServerMessageVoiceRequestPhoneNumber_Vapi, + ServerMessageVoiceRequestPhoneNumber_Vonage, +) +from .sip_trunk_gateway import SipTrunkGateway +from .sip_trunk_gateway_outbound_protocol import SipTrunkGatewayOutboundProtocol +from .sip_trunk_outbound_authentication_plan import SipTrunkOutboundAuthenticationPlan +from .sip_trunk_outbound_sip_register_plan import SipTrunkOutboundSipRegisterPlan +from .squad import Squad +from .squad_member_dto import SquadMemberDto +from .start_speaking_plan import StartSpeakingPlan +from .step_destination import StepDestination +from .step_destination_conditions_item import ( + StepDestinationConditionsItem, + StepDestinationConditionsItem_ModelBased, + StepDestinationConditionsItem_RuleBased, +) +from .stop_speaking_plan import StopSpeakingPlan +from .structured_data_plan import StructuredDataPlan +from .success_evaluation_plan import SuccessEvaluationPlan +from .success_evaluation_plan_rubric import SuccessEvaluationPlanRubric +from .summary_plan import SummaryPlan +from .sync_voice_library_dto import SyncVoiceLibraryDto +from .sync_voice_library_dto_providers_item import SyncVoiceLibraryDtoProvidersItem +from .system_message import SystemMessage +from .talkscriber_transcriber import TalkscriberTranscriber +from .talkscriber_transcriber_language import TalkscriberTranscriberLanguage +from .template import Template +from .template_details import ( + TemplateDetails, + TemplateDetails_Dtmf, + TemplateDetails_EndCall, + TemplateDetails_Function, + TemplateDetails_Ghl, + TemplateDetails_Make, + TemplateDetails_TransferCall, + TemplateDetails_Voicemail, +) +from .template_provider import TemplateProvider +from .template_provider_details import ( + TemplateProviderDetails, + TemplateProviderDetails_Function, + TemplateProviderDetails_Ghl, + TemplateProviderDetails_Make, +) +from .template_visibility import TemplateVisibility +from .time_range import TimeRange +from .time_range_step import TimeRangeStep +from .together_ai_credential import TogetherAiCredential +from .together_ai_model import TogetherAiModel +from .together_ai_model_tools_item import ( + TogetherAiModelToolsItem, + TogetherAiModelToolsItem_Dtmf, + TogetherAiModelToolsItem_EndCall, + TogetherAiModelToolsItem_Function, + TogetherAiModelToolsItem_Ghl, + TogetherAiModelToolsItem_Make, + TogetherAiModelToolsItem_TransferCall, + TogetherAiModelToolsItem_Voicemail, +) +from .token import Token +from .token_restrictions import TokenRestrictions +from .token_tag import TokenTag +from .tool_call import ToolCall +from .tool_call_block import ToolCallBlock +from .tool_call_block_messages_item import ( + ToolCallBlockMessagesItem, + ToolCallBlockMessagesItem_BlockComplete, + ToolCallBlockMessagesItem_BlockStart, +) +from .tool_call_block_tool import ( + ToolCallBlockTool, + ToolCallBlockTool_Dtmf, + ToolCallBlockTool_EndCall, + ToolCallBlockTool_Function, + ToolCallBlockTool_Ghl, + ToolCallBlockTool_Make, + ToolCallBlockTool_TransferCall, + ToolCallBlockTool_Voicemail, +) +from .tool_call_function import ToolCallFunction +from .tool_call_message import ToolCallMessage +from .tool_call_result import ToolCallResult +from .tool_call_result_message import ToolCallResultMessage +from .tool_call_result_message_item import ( + ToolCallResultMessageItem, + ToolCallResultMessageItem_RequestComplete, + ToolCallResultMessageItem_RequestFailed, +) +from .tool_message_complete import ToolMessageComplete +from .tool_message_complete_role import ToolMessageCompleteRole +from .tool_message_delayed import ToolMessageDelayed +from .tool_message_failed import ToolMessageFailed +from .tool_message_start import ToolMessageStart +from .tool_template_metadata import ToolTemplateMetadata +from .tool_template_setup import ToolTemplateSetup +from .transcriber_cost import TranscriberCost +from .transcript_plan import TranscriptPlan +from .transcription_endpointing_plan import TranscriptionEndpointingPlan +from .transfer_call_tool import TransferCallTool +from .transfer_call_tool_destinations_item import ( + TransferCallToolDestinationsItem, + TransferCallToolDestinationsItem_Assistant, + TransferCallToolDestinationsItem_Number, + TransferCallToolDestinationsItem_Sip, + TransferCallToolDestinationsItem_Step, +) +from .transfer_call_tool_messages_item import ( + TransferCallToolMessagesItem, + TransferCallToolMessagesItem_RequestComplete, + TransferCallToolMessagesItem_RequestFailed, + TransferCallToolMessagesItem_RequestResponseDelayed, + TransferCallToolMessagesItem_RequestStart, +) +from .transfer_destination_assistant import TransferDestinationAssistant +from .transfer_destination_assistant_transfer_mode import TransferDestinationAssistantTransferMode +from .transfer_destination_number import TransferDestinationNumber +from .transfer_destination_sip import TransferDestinationSip +from .transfer_destination_step import TransferDestinationStep +from .transport_configuration_twilio import TransportConfigurationTwilio +from .transport_configuration_twilio_recording_channels import TransportConfigurationTwilioRecordingChannels +from .transport_cost import TransportCost +from .twilio_credential import TwilioCredential +from .twilio_phone_number import TwilioPhoneNumber +from .twilio_phone_number_fallback_destination import ( + TwilioPhoneNumberFallbackDestination, + TwilioPhoneNumberFallbackDestination_Number, + TwilioPhoneNumberFallbackDestination_Sip, +) +from .twilio_voicemail_detection import TwilioVoicemailDetection +from .twilio_voicemail_detection_voicemail_detection_types_item import ( + TwilioVoicemailDetectionVoicemailDetectionTypesItem, +) +from .update_anthropic_credential_dto import UpdateAnthropicCredentialDto +from .update_anyscale_credential_dto import UpdateAnyscaleCredentialDto +from .update_azure_open_ai_credential_dto import UpdateAzureOpenAiCredentialDto +from .update_azure_open_ai_credential_dto_models_item import UpdateAzureOpenAiCredentialDtoModelsItem +from .update_azure_open_ai_credential_dto_region import UpdateAzureOpenAiCredentialDtoRegion +from .update_byo_sip_trunk_credential_dto import UpdateByoSipTrunkCredentialDto +from .update_cartesia_credential_dto import UpdateCartesiaCredentialDto +from .update_custom_llm_credential_dto import UpdateCustomLlmCredentialDto +from .update_deep_infra_credential_dto import UpdateDeepInfraCredentialDto +from .update_deepgram_credential_dto import UpdateDeepgramCredentialDto +from .update_eleven_labs_credential_dto import UpdateElevenLabsCredentialDto +from .update_gcp_credential_dto import UpdateGcpCredentialDto +from .update_gladia_credential_dto import UpdateGladiaCredentialDto +from .update_go_high_level_credential_dto import UpdateGoHighLevelCredentialDto +from .update_groq_credential_dto import UpdateGroqCredentialDto +from .update_lmnt_credential_dto import UpdateLmntCredentialDto +from .update_make_credential_dto import UpdateMakeCredentialDto +from .update_open_ai_credential_dto import UpdateOpenAiCredentialDto +from .update_open_router_credential_dto import UpdateOpenRouterCredentialDto +from .update_org_dto import UpdateOrgDto +from .update_perplexity_ai_credential_dto import UpdatePerplexityAiCredentialDto +from .update_play_ht_credential_dto import UpdatePlayHtCredentialDto +from .update_rime_ai_credential_dto import UpdateRimeAiCredentialDto +from .update_runpod_credential_dto import UpdateRunpodCredentialDto +from .update_s_3_credential_dto import UpdateS3CredentialDto +from .update_together_ai_credential_dto import UpdateTogetherAiCredentialDto +from .update_tool_template_dto import UpdateToolTemplateDto +from .update_tool_template_dto_details import ( + UpdateToolTemplateDtoDetails, + UpdateToolTemplateDtoDetails_Dtmf, + UpdateToolTemplateDtoDetails_EndCall, + UpdateToolTemplateDtoDetails_Function, + UpdateToolTemplateDtoDetails_Ghl, + UpdateToolTemplateDtoDetails_Make, + UpdateToolTemplateDtoDetails_TransferCall, + UpdateToolTemplateDtoDetails_Voicemail, +) +from .update_tool_template_dto_provider import UpdateToolTemplateDtoProvider +from .update_tool_template_dto_provider_details import ( + UpdateToolTemplateDtoProviderDetails, + UpdateToolTemplateDtoProviderDetails_Function, + UpdateToolTemplateDtoProviderDetails_Ghl, + UpdateToolTemplateDtoProviderDetails_Make, +) +from .update_tool_template_dto_visibility import UpdateToolTemplateDtoVisibility +from .update_twilio_credential_dto import UpdateTwilioCredentialDto +from .update_user_role_dto import UpdateUserRoleDto +from .update_user_role_dto_role import UpdateUserRoleDtoRole +from .update_vonage_credential_dto import UpdateVonageCredentialDto +from .user import User +from .user_message import UserMessage +from .vapi_cost import VapiCost +from .vapi_model import VapiModel +from .vapi_model_steps_item import VapiModelStepsItem, VapiModelStepsItem_Callback, VapiModelStepsItem_Handoff +from .vapi_model_tools_item import ( + VapiModelToolsItem, + VapiModelToolsItem_Dtmf, + VapiModelToolsItem_EndCall, + VapiModelToolsItem_Function, + VapiModelToolsItem_Ghl, + VapiModelToolsItem_Make, + VapiModelToolsItem_TransferCall, + VapiModelToolsItem_Voicemail, +) +from .vapi_phone_number import VapiPhoneNumber +from .vapi_phone_number_fallback_destination import ( + VapiPhoneNumberFallbackDestination, + VapiPhoneNumberFallbackDestination_Number, + VapiPhoneNumberFallbackDestination_Sip, +) +from .voice_cost import VoiceCost +from .voice_library import VoiceLibrary +from .voice_library_gender import VoiceLibraryGender +from .voice_library_voice_response import VoiceLibraryVoiceResponse +from .vonage_credential import VonageCredential +from .vonage_phone_number import VonagePhoneNumber +from .vonage_phone_number_fallback_destination import ( + VonagePhoneNumberFallbackDestination, + VonagePhoneNumberFallbackDestination_Number, + VonagePhoneNumberFallbackDestination_Sip, +) +from .workflow_block import WorkflowBlock +from .workflow_block_messages_item import ( + WorkflowBlockMessagesItem, + WorkflowBlockMessagesItem_BlockComplete, + WorkflowBlockMessagesItem_BlockStart, +) +from .workflow_block_steps_item import ( + WorkflowBlockStepsItem, + WorkflowBlockStepsItem_Callback, + WorkflowBlockStepsItem_Handoff, +) + +__all__ = [ + "AddVoiceToProviderDto", + "Analysis", + "AnalysisCost", + "AnalysisCostAnalysisType", + "AnalysisCostBreakdown", + "AnalysisPlan", + "AnalyticsOperation", + "AnalyticsOperationColumn", + "AnalyticsOperationOperation", + "AnalyticsQuery", + "AnalyticsQueryGroupByItem", + "AnalyticsQueryResult", + "AnthropicCredential", + "AnthropicModel", + "AnthropicModelModel", + "AnthropicModelToolsItem", + "AnthropicModelToolsItem_Dtmf", + "AnthropicModelToolsItem_EndCall", + "AnthropicModelToolsItem_Function", + "AnthropicModelToolsItem_Ghl", + "AnthropicModelToolsItem_Make", + "AnthropicModelToolsItem_TransferCall", + "AnthropicModelToolsItem_Voicemail", + "AnyscaleCredential", + "AnyscaleModel", + "AnyscaleModelToolsItem", + "AnyscaleModelToolsItem_Dtmf", + "AnyscaleModelToolsItem_EndCall", + "AnyscaleModelToolsItem_Function", + "AnyscaleModelToolsItem_Ghl", + "AnyscaleModelToolsItem_Make", + "AnyscaleModelToolsItem_TransferCall", + "AnyscaleModelToolsItem_Voicemail", + "Artifact", + "ArtifactMessagesItem", + "ArtifactPlan", + "AssignmentMutation", + "AssignmentMutationConditionsItem", + "AssignmentMutationConditionsItem_ModelBased", + "AssignmentMutationConditionsItem_RuleBased", + "Assistant", + "AssistantBackgroundSound", + "AssistantClientMessagesItem", + "AssistantFirstMessageMode", + "AssistantModel", + "AssistantModel_Anthropic", + "AssistantModel_Anyscale", + "AssistantModel_CustomLlm", + "AssistantModel_Deepinfra", + "AssistantModel_Groq", + "AssistantModel_Openai", + "AssistantModel_Openrouter", + "AssistantModel_PerplexityAi", + "AssistantModel_TogetherAi", + "AssistantModel_Vapi", + "AssistantOverrides", + "AssistantOverridesBackgroundSound", + "AssistantOverridesClientMessagesItem", + "AssistantOverridesFirstMessageMode", + "AssistantOverridesModel", + "AssistantOverridesModel_Anthropic", + "AssistantOverridesModel_Anyscale", + "AssistantOverridesModel_CustomLlm", + "AssistantOverridesModel_Deepinfra", + "AssistantOverridesModel_Groq", + "AssistantOverridesModel_Openai", + "AssistantOverridesModel_Openrouter", + "AssistantOverridesModel_PerplexityAi", + "AssistantOverridesModel_TogetherAi", + "AssistantOverridesModel_Vapi", + "AssistantOverridesServerMessagesItem", + "AssistantOverridesTranscriber", + "AssistantOverridesTranscriber_Deepgram", + "AssistantOverridesTranscriber_Gladia", + "AssistantOverridesTranscriber_Talkscriber", + "AssistantOverridesVoice", + "AssistantOverridesVoice_11Labs", + "AssistantOverridesVoice_Azure", + "AssistantOverridesVoice_Cartesia", + "AssistantOverridesVoice_Deepgram", + "AssistantOverridesVoice_Lmnt", + "AssistantOverridesVoice_Neets", + "AssistantOverridesVoice_Openai", + "AssistantOverridesVoice_Playht", + "AssistantOverridesVoice_RimeAi", + "AssistantServerMessagesItem", + "AssistantTranscriber", + "AssistantTranscriber_Deepgram", + "AssistantTranscriber_Gladia", + "AssistantTranscriber_Talkscriber", + "AssistantVoice", + "AssistantVoice_11Labs", + "AssistantVoice_Azure", + "AssistantVoice_Cartesia", + "AssistantVoice_Deepgram", + "AssistantVoice_Lmnt", + "AssistantVoice_Neets", + "AssistantVoice_Openai", + "AssistantVoice_Playht", + "AssistantVoice_RimeAi", + "AzureOpenAiCredential", + "AzureOpenAiCredentialModelsItem", + "AzureOpenAiCredentialRegion", + "AzureVoice", + "AzureVoiceVoiceId", + "BlockCompleteMessage", + "BlockCompleteMessageConditionsItem", + "BlockCompleteMessageConditionsItem_ModelBased", + "BlockCompleteMessageConditionsItem_RuleBased", + "BlockStartMessage", + "BlockStartMessageConditionsItem", + "BlockStartMessageConditionsItem_ModelBased", + "BlockStartMessageConditionsItem_RuleBased", + "BotMessage", + "BucketPlan", + "BuyPhoneNumberDto", + "BuyPhoneNumberDtoFallbackDestination", + "BuyPhoneNumberDtoFallbackDestination_Number", + "BuyPhoneNumberDtoFallbackDestination_Sip", + "ByoPhoneNumber", + "ByoPhoneNumberFallbackDestination", + "ByoPhoneNumberFallbackDestination_Number", + "ByoPhoneNumberFallbackDestination_Sip", + "ByoSipTrunkCredential", + "Call", + "CallCostsItem", + "CallCostsItem_Analysis", + "CallCostsItem_Model", + "CallCostsItem_Transcriber", + "CallCostsItem_Transport", + "CallCostsItem_Vapi", + "CallCostsItem_Voice", + "CallDestination", + "CallDestination_Number", + "CallDestination_Sip", + "CallEndedReason", + "CallMessagesItem", + "CallPaginatedResponse", + "CallPhoneCallProvider", + "CallPhoneCallTransport", + "CallStatus", + "CallType", + "CallbackStep", + "CallbackStepBlock", + "CallbackStepBlock_Conversation", + "CallbackStepBlock_ToolCall", + "CallbackStepBlock_Workflow", + "CartesiaCredential", + "CartesiaVoice", + "CartesiaVoiceLanguage", + "CartesiaVoiceModel", + "ChunkPlan", + "ChunkPlanPunctuationBoundariesItem", + "ClientInboundMessage", + "ClientInboundMessageAddMessage", + "ClientInboundMessageControl", + "ClientInboundMessageControlControl", + "ClientInboundMessageMessage", + "ClientInboundMessageMessage_AddMessage", + "ClientInboundMessageMessage_Control", + "ClientInboundMessageMessage_Say", + "ClientInboundMessageSay", + "ClientMessage", + "ClientMessageConversationUpdate", + "ClientMessageConversationUpdateMessagesItem", + "ClientMessageHang", + "ClientMessageLanguageChanged", + "ClientMessageMessage", + "ClientMessageMessage_ConversationUpdate", + "ClientMessageMessage_Hang", + "ClientMessageMessage_LanguageChanged", + "ClientMessageMessage_Metadata", + "ClientMessageMessage_ModelOutput", + "ClientMessageMessage_SpeechUpdate", + "ClientMessageMessage_ToolCalls", + "ClientMessageMessage_ToolCallsResult", + "ClientMessageMessage_Transcript", + "ClientMessageMessage_UserInterrupted", + "ClientMessageMessage_VoiceInput", + "ClientMessageMetadata", + "ClientMessageModelOutput", + "ClientMessageSpeechUpdate", + "ClientMessageSpeechUpdateRole", + "ClientMessageSpeechUpdateStatus", + "ClientMessageToolCalls", + "ClientMessageToolCallsResult", + "ClientMessageToolCallsToolWithToolCallListItem", + "ClientMessageToolCallsToolWithToolCallListItem_Function", + "ClientMessageToolCallsToolWithToolCallListItem_Ghl", + "ClientMessageToolCallsToolWithToolCallListItem_Make", + "ClientMessageTranscript", + "ClientMessageTranscriptRole", + "ClientMessageTranscriptTranscriptType", + "ClientMessageUserInterrupted", + "ClientMessageVoiceInput", + "CloneVoiceDto", + "Condition", + "ConditionOperator", + "ConversationBlock", + "ConversationBlockMessagesItem", + "ConversationBlockMessagesItem_BlockComplete", + "ConversationBlockMessagesItem_BlockStart", + "CostBreakdown", + "CreateAnthropicCredentialDto", + "CreateAnyscaleCredentialDto", + "CreateAssistantDto", + "CreateAssistantDtoBackgroundSound", + "CreateAssistantDtoClientMessagesItem", + "CreateAssistantDtoFirstMessageMode", + "CreateAssistantDtoModel", + "CreateAssistantDtoModel_Anthropic", + "CreateAssistantDtoModel_Anyscale", + "CreateAssistantDtoModel_CustomLlm", + "CreateAssistantDtoModel_Deepinfra", + "CreateAssistantDtoModel_Groq", + "CreateAssistantDtoModel_Openai", + "CreateAssistantDtoModel_Openrouter", + "CreateAssistantDtoModel_PerplexityAi", + "CreateAssistantDtoModel_TogetherAi", + "CreateAssistantDtoModel_Vapi", + "CreateAssistantDtoServerMessagesItem", + "CreateAssistantDtoTranscriber", + "CreateAssistantDtoTranscriber_Deepgram", + "CreateAssistantDtoTranscriber_Gladia", + "CreateAssistantDtoTranscriber_Talkscriber", + "CreateAssistantDtoVoice", + "CreateAssistantDtoVoice_11Labs", + "CreateAssistantDtoVoice_Azure", + "CreateAssistantDtoVoice_Cartesia", + "CreateAssistantDtoVoice_Deepgram", + "CreateAssistantDtoVoice_Lmnt", + "CreateAssistantDtoVoice_Neets", + "CreateAssistantDtoVoice_Openai", + "CreateAssistantDtoVoice_Playht", + "CreateAssistantDtoVoice_RimeAi", + "CreateAzureOpenAiCredentialDto", + "CreateAzureOpenAiCredentialDtoModelsItem", + "CreateAzureOpenAiCredentialDtoRegion", + "CreateByoPhoneNumberDto", + "CreateByoPhoneNumberDtoFallbackDestination", + "CreateByoPhoneNumberDtoFallbackDestination_Number", + "CreateByoPhoneNumberDtoFallbackDestination_Sip", + "CreateByoSipTrunkCredentialDto", + "CreateCartesiaCredentialDto", + "CreateConversationBlockDto", + "CreateConversationBlockDtoMessagesItem", + "CreateConversationBlockDtoMessagesItem_BlockComplete", + "CreateConversationBlockDtoMessagesItem_BlockStart", + "CreateCustomLlmCredentialDto", + "CreateCustomerDto", + "CreateDeepInfraCredentialDto", + "CreateDeepgramCredentialDto", + "CreateDtmfToolDto", + "CreateDtmfToolDtoMessagesItem", + "CreateDtmfToolDtoMessagesItem_RequestComplete", + "CreateDtmfToolDtoMessagesItem_RequestFailed", + "CreateDtmfToolDtoMessagesItem_RequestResponseDelayed", + "CreateDtmfToolDtoMessagesItem_RequestStart", + "CreateElevenLabsCredentialDto", + "CreateEndCallToolDto", + "CreateEndCallToolDtoMessagesItem", + "CreateEndCallToolDtoMessagesItem_RequestComplete", + "CreateEndCallToolDtoMessagesItem_RequestFailed", + "CreateEndCallToolDtoMessagesItem_RequestResponseDelayed", + "CreateEndCallToolDtoMessagesItem_RequestStart", + "CreateFunctionToolDto", + "CreateFunctionToolDtoMessagesItem", + "CreateFunctionToolDtoMessagesItem_RequestComplete", + "CreateFunctionToolDtoMessagesItem_RequestFailed", + "CreateFunctionToolDtoMessagesItem_RequestResponseDelayed", + "CreateFunctionToolDtoMessagesItem_RequestStart", + "CreateGcpCredentialDto", + "CreateGhlToolDto", + "CreateGhlToolDtoMessagesItem", + "CreateGhlToolDtoMessagesItem_RequestComplete", + "CreateGhlToolDtoMessagesItem_RequestFailed", + "CreateGhlToolDtoMessagesItem_RequestResponseDelayed", + "CreateGhlToolDtoMessagesItem_RequestStart", + "CreateGladiaCredentialDto", + "CreateGoHighLevelCredentialDto", + "CreateGroqCredentialDto", + "CreateLmntCredentialDto", + "CreateMakeCredentialDto", + "CreateMakeToolDto", + "CreateMakeToolDtoMessagesItem", + "CreateMakeToolDtoMessagesItem_RequestComplete", + "CreateMakeToolDtoMessagesItem_RequestFailed", + "CreateMakeToolDtoMessagesItem_RequestResponseDelayed", + "CreateMakeToolDtoMessagesItem_RequestStart", + "CreateOpenAiCredentialDto", + "CreateOpenRouterCredentialDto", + "CreateOrgDto", + "CreateOutboundCallDto", + "CreateOutputToolDto", + "CreateOutputToolDtoMessagesItem", + "CreateOutputToolDtoMessagesItem_RequestComplete", + "CreateOutputToolDtoMessagesItem_RequestFailed", + "CreateOutputToolDtoMessagesItem_RequestResponseDelayed", + "CreateOutputToolDtoMessagesItem_RequestStart", + "CreatePerplexityAiCredentialDto", + "CreatePlayHtCredentialDto", + "CreateRimeAiCredentialDto", + "CreateRunpodCredentialDto", + "CreateS3CredentialDto", + "CreateSquadDto", + "CreateTogetherAiCredentialDto", + "CreateTokenDto", + "CreateTokenDtoTag", + "CreateToolCallBlockDto", + "CreateToolCallBlockDtoMessagesItem", + "CreateToolCallBlockDtoMessagesItem_BlockComplete", + "CreateToolCallBlockDtoMessagesItem_BlockStart", + "CreateToolCallBlockDtoTool", + "CreateToolCallBlockDtoTool_Dtmf", + "CreateToolCallBlockDtoTool_EndCall", + "CreateToolCallBlockDtoTool_Function", + "CreateToolCallBlockDtoTool_Ghl", + "CreateToolCallBlockDtoTool_Make", + "CreateToolCallBlockDtoTool_TransferCall", + "CreateToolCallBlockDtoTool_Voicemail", + "CreateToolTemplateDto", + "CreateToolTemplateDtoDetails", + "CreateToolTemplateDtoDetails_Dtmf", + "CreateToolTemplateDtoDetails_EndCall", + "CreateToolTemplateDtoDetails_Function", + "CreateToolTemplateDtoDetails_Ghl", + "CreateToolTemplateDtoDetails_Make", + "CreateToolTemplateDtoDetails_TransferCall", + "CreateToolTemplateDtoDetails_Voicemail", + "CreateToolTemplateDtoProvider", + "CreateToolTemplateDtoProviderDetails", + "CreateToolTemplateDtoProviderDetails_Function", + "CreateToolTemplateDtoProviderDetails_Ghl", + "CreateToolTemplateDtoProviderDetails_Make", + "CreateToolTemplateDtoVisibility", + "CreateTransferCallToolDto", + "CreateTransferCallToolDtoDestinationsItem", + "CreateTransferCallToolDtoDestinationsItem_Assistant", + "CreateTransferCallToolDtoDestinationsItem_Number", + "CreateTransferCallToolDtoDestinationsItem_Sip", + "CreateTransferCallToolDtoDestinationsItem_Step", + "CreateTransferCallToolDtoMessagesItem", + "CreateTransferCallToolDtoMessagesItem_RequestComplete", + "CreateTransferCallToolDtoMessagesItem_RequestFailed", + "CreateTransferCallToolDtoMessagesItem_RequestResponseDelayed", + "CreateTransferCallToolDtoMessagesItem_RequestStart", + "CreateTwilioCredentialDto", + "CreateTwilioPhoneNumberDto", + "CreateTwilioPhoneNumberDtoFallbackDestination", + "CreateTwilioPhoneNumberDtoFallbackDestination_Number", + "CreateTwilioPhoneNumberDtoFallbackDestination_Sip", + "CreateVapiPhoneNumberDto", + "CreateVapiPhoneNumberDtoFallbackDestination", + "CreateVapiPhoneNumberDtoFallbackDestination_Number", + "CreateVapiPhoneNumberDtoFallbackDestination_Sip", + "CreateVoicemailToolDto", + "CreateVoicemailToolDtoMessagesItem", + "CreateVoicemailToolDtoMessagesItem_RequestComplete", + "CreateVoicemailToolDtoMessagesItem_RequestFailed", + "CreateVoicemailToolDtoMessagesItem_RequestResponseDelayed", + "CreateVoicemailToolDtoMessagesItem_RequestStart", + "CreateVonageCredentialDto", + "CreateVonagePhoneNumberDto", + "CreateVonagePhoneNumberDtoFallbackDestination", + "CreateVonagePhoneNumberDtoFallbackDestination_Number", + "CreateVonagePhoneNumberDtoFallbackDestination_Sip", + "CreateWebCallDto", + "CreateWorkflowBlockDto", + "CreateWorkflowBlockDtoMessagesItem", + "CreateWorkflowBlockDtoMessagesItem_BlockComplete", + "CreateWorkflowBlockDtoMessagesItem_BlockStart", + "CreateWorkflowBlockDtoStepsItem", + "CreateWorkflowBlockDtoStepsItem_Callback", + "CreateWorkflowBlockDtoStepsItem_Handoff", + "CustomLlmCredential", + "CustomLlmModel", + "CustomLlmModelMetadataSendMode", + "CustomLlmModelToolsItem", + "CustomLlmModelToolsItem_Dtmf", + "CustomLlmModelToolsItem_EndCall", + "CustomLlmModelToolsItem_Function", + "CustomLlmModelToolsItem_Ghl", + "CustomLlmModelToolsItem_Make", + "CustomLlmModelToolsItem_TransferCall", + "CustomLlmModelToolsItem_Voicemail", + "DeepInfraCredential", + "DeepInfraModel", + "DeepInfraModelToolsItem", + "DeepInfraModelToolsItem_Dtmf", + "DeepInfraModelToolsItem_EndCall", + "DeepInfraModelToolsItem_Function", + "DeepInfraModelToolsItem_Ghl", + "DeepInfraModelToolsItem_Make", + "DeepInfraModelToolsItem_TransferCall", + "DeepInfraModelToolsItem_Voicemail", + "DeepgramCredential", + "DeepgramTranscriber", + "DeepgramTranscriberLanguage", + "DeepgramTranscriberModel", + "DeepgramVoice", + "DeepgramVoiceVoiceId", + "DtmfTool", + "DtmfToolMessagesItem", + "DtmfToolMessagesItem_RequestComplete", + "DtmfToolMessagesItem_RequestFailed", + "DtmfToolMessagesItem_RequestResponseDelayed", + "DtmfToolMessagesItem_RequestStart", + "ElevenLabsCredential", + "ElevenLabsVoice", + "ElevenLabsVoiceModel", + "ElevenLabsVoiceVoiceId", + "EndCallTool", + "EndCallToolMessagesItem", + "EndCallToolMessagesItem_RequestComplete", + "EndCallToolMessagesItem_RequestFailed", + "EndCallToolMessagesItem_RequestResponseDelayed", + "EndCallToolMessagesItem_RequestStart", + "Error", + "ExactReplacement", + "File", + "FileStatus", + "FormatPlan", + "FormatPlanReplacementsItem", + "FormatPlanReplacementsItem_Exact", + "FormatPlanReplacementsItem_Regex", + "FunctionTool", + "FunctionToolMessagesItem", + "FunctionToolMessagesItem_RequestComplete", + "FunctionToolMessagesItem_RequestFailed", + "FunctionToolMessagesItem_RequestResponseDelayed", + "FunctionToolMessagesItem_RequestStart", + "FunctionToolProviderDetails", + "FunctionToolWithToolCall", + "FunctionToolWithToolCallMessagesItem", + "FunctionToolWithToolCallMessagesItem_RequestComplete", + "FunctionToolWithToolCallMessagesItem_RequestFailed", + "FunctionToolWithToolCallMessagesItem_RequestResponseDelayed", + "FunctionToolWithToolCallMessagesItem_RequestStart", + "GcpCredential", + "GcpKey", + "GhlTool", + "GhlToolMessagesItem", + "GhlToolMessagesItem_RequestComplete", + "GhlToolMessagesItem_RequestFailed", + "GhlToolMessagesItem_RequestResponseDelayed", + "GhlToolMessagesItem_RequestStart", + "GhlToolMetadata", + "GhlToolProviderDetails", + "GhlToolWithToolCall", + "GhlToolWithToolCallMessagesItem", + "GhlToolWithToolCallMessagesItem_RequestComplete", + "GhlToolWithToolCallMessagesItem_RequestFailed", + "GhlToolWithToolCallMessagesItem_RequestResponseDelayed", + "GhlToolWithToolCallMessagesItem_RequestStart", + "GladiaCredential", + "GladiaTranscriber", + "GladiaTranscriberLanguage", + "GladiaTranscriberLanguageBehaviour", + "GladiaTranscriberModel", + "GoHighLevelCredential", + "GroqCredential", + "GroqModel", + "GroqModelModel", + "GroqModelToolsItem", + "GroqModelToolsItem_Dtmf", + "GroqModelToolsItem_EndCall", + "GroqModelToolsItem_Function", + "GroqModelToolsItem_Ghl", + "GroqModelToolsItem_Make", + "GroqModelToolsItem_TransferCall", + "GroqModelToolsItem_Voicemail", + "HandoffStep", + "HandoffStepBlock", + "HandoffStepBlock_Conversation", + "HandoffStepBlock_ToolCall", + "HandoffStepBlock_Workflow", + "ImportTwilioPhoneNumberDto", + "ImportTwilioPhoneNumberDtoFallbackDestination", + "ImportTwilioPhoneNumberDtoFallbackDestination_Number", + "ImportTwilioPhoneNumberDtoFallbackDestination_Sip", + "ImportVonagePhoneNumberDto", + "ImportVonagePhoneNumberDtoFallbackDestination", + "ImportVonagePhoneNumberDtoFallbackDestination_Number", + "ImportVonagePhoneNumberDtoFallbackDestination_Sip", + "InviteUserDto", + "InviteUserDtoRole", + "JsonSchema", + "JsonSchemaType", + "KnowledgeBase", + "LmntCredential", + "LmntVoice", + "LmntVoiceVoiceId", + "Log", + "LogRequestHttpMethod", + "LogResource", + "LogType", + "LogsPaginatedResponse", + "MakeCredential", + "MakeTool", + "MakeToolMessagesItem", + "MakeToolMessagesItem_RequestComplete", + "MakeToolMessagesItem_RequestFailed", + "MakeToolMessagesItem_RequestResponseDelayed", + "MakeToolMessagesItem_RequestStart", + "MakeToolMetadata", + "MakeToolProviderDetails", + "MakeToolWithToolCall", + "MakeToolWithToolCallMessagesItem", + "MakeToolWithToolCallMessagesItem_RequestComplete", + "MakeToolWithToolCallMessagesItem_RequestFailed", + "MakeToolWithToolCallMessagesItem_RequestResponseDelayed", + "MakeToolWithToolCallMessagesItem_RequestStart", + "MessagePlan", + "Metrics", + "ModelBasedCondition", + "ModelCost", + "Monitor", + "MonitorPlan", + "NeetsVoice", + "NeetsVoiceVoiceId", + "OpenAiCredential", + "OpenAiFunction", + "OpenAiFunctionParameters", + "OpenAiMessage", + "OpenAiMessageRole", + "OpenAiModel", + "OpenAiModelFallbackModelsItem", + "OpenAiModelModel", + "OpenAiModelToolsItem", + "OpenAiModelToolsItem_Dtmf", + "OpenAiModelToolsItem_EndCall", + "OpenAiModelToolsItem_Function", + "OpenAiModelToolsItem_Ghl", + "OpenAiModelToolsItem_Make", + "OpenAiModelToolsItem_TransferCall", + "OpenAiModelToolsItem_Voicemail", + "OpenAiVoice", + "OpenAiVoiceVoiceId", + "OpenRouterCredential", + "OpenRouterModel", + "OpenRouterModelToolsItem", + "OpenRouterModelToolsItem_Dtmf", + "OpenRouterModelToolsItem_EndCall", + "OpenRouterModelToolsItem_Function", + "OpenRouterModelToolsItem_Ghl", + "OpenRouterModelToolsItem_Make", + "OpenRouterModelToolsItem_TransferCall", + "OpenRouterModelToolsItem_Voicemail", + "Org", + "OrgPlan", + "OutputTool", + "OutputToolMessagesItem", + "OutputToolMessagesItem_RequestComplete", + "OutputToolMessagesItem_RequestFailed", + "OutputToolMessagesItem_RequestResponseDelayed", + "OutputToolMessagesItem_RequestStart", + "PaginationMeta", + "PerplexityAiCredential", + "PerplexityAiModel", + "PerplexityAiModelToolsItem", + "PerplexityAiModelToolsItem_Dtmf", + "PerplexityAiModelToolsItem_EndCall", + "PerplexityAiModelToolsItem_Function", + "PerplexityAiModelToolsItem_Ghl", + "PerplexityAiModelToolsItem_Make", + "PerplexityAiModelToolsItem_TransferCall", + "PerplexityAiModelToolsItem_Voicemail", + "PlayHtCredential", + "PlayHtVoice", + "PlayHtVoiceEmotion", + "PlayHtVoiceVoiceId", + "RegexOption", + "RegexOptionType", + "RegexReplacement", + "RimeAiCredential", + "RimeAiVoice", + "RimeAiVoiceModel", + "RimeAiVoiceVoiceId", + "RuleBasedCondition", + "RuleBasedConditionOperator", + "RunpodCredential", + "S3Credential", + "SbcConfiguration", + "Server", + "ServerMessage", + "ServerMessageAssistantRequest", + "ServerMessageAssistantRequestPhoneNumber", + "ServerMessageAssistantRequestPhoneNumber_ByoPhoneNumber", + "ServerMessageAssistantRequestPhoneNumber_Twilio", + "ServerMessageAssistantRequestPhoneNumber_Vapi", + "ServerMessageAssistantRequestPhoneNumber_Vonage", + "ServerMessageConversationUpdate", + "ServerMessageConversationUpdateMessagesItem", + "ServerMessageConversationUpdatePhoneNumber", + "ServerMessageConversationUpdatePhoneNumber_ByoPhoneNumber", + "ServerMessageConversationUpdatePhoneNumber_Twilio", + "ServerMessageConversationUpdatePhoneNumber_Vapi", + "ServerMessageConversationUpdatePhoneNumber_Vonage", + "ServerMessageEndOfCallReport", + "ServerMessageEndOfCallReportCostsItem", + "ServerMessageEndOfCallReportCostsItem_Analysis", + "ServerMessageEndOfCallReportCostsItem_Model", + "ServerMessageEndOfCallReportCostsItem_Transcriber", + "ServerMessageEndOfCallReportCostsItem_Transport", + "ServerMessageEndOfCallReportCostsItem_Vapi", + "ServerMessageEndOfCallReportCostsItem_Voice", + "ServerMessageEndOfCallReportEndedReason", + "ServerMessageEndOfCallReportPhoneNumber", + "ServerMessageEndOfCallReportPhoneNumber_ByoPhoneNumber", + "ServerMessageEndOfCallReportPhoneNumber_Twilio", + "ServerMessageEndOfCallReportPhoneNumber_Vapi", + "ServerMessageEndOfCallReportPhoneNumber_Vonage", + "ServerMessageHang", + "ServerMessageHangPhoneNumber", + "ServerMessageHangPhoneNumber_ByoPhoneNumber", + "ServerMessageHangPhoneNumber_Twilio", + "ServerMessageHangPhoneNumber_Vapi", + "ServerMessageHangPhoneNumber_Vonage", + "ServerMessageLanguageChanged", + "ServerMessageLanguageChangedPhoneNumber", + "ServerMessageLanguageChangedPhoneNumber_ByoPhoneNumber", + "ServerMessageLanguageChangedPhoneNumber_Twilio", + "ServerMessageLanguageChangedPhoneNumber_Vapi", + "ServerMessageLanguageChangedPhoneNumber_Vonage", + "ServerMessageMessage", + "ServerMessageMessage_AssistantRequest", + "ServerMessageMessage_ConversationUpdate", + "ServerMessageMessage_EndOfCallReport", + "ServerMessageMessage_Hang", + "ServerMessageMessage_LanguageChanged", + "ServerMessageMessage_ModelOutput", + "ServerMessageMessage_PhoneCallControl", + "ServerMessageMessage_SpeechUpdate", + "ServerMessageMessage_StatusUpdate", + "ServerMessageMessage_ToolCalls", + "ServerMessageMessage_Transcript", + "ServerMessageMessage_TransferDestinationRequest", + "ServerMessageMessage_TransferUpdate", + "ServerMessageMessage_UserInterrupted", + "ServerMessageMessage_VoiceInput", + "ServerMessageMessage_VoiceRequest", + "ServerMessageModelOutput", + "ServerMessageModelOutputPhoneNumber", + "ServerMessageModelOutputPhoneNumber_ByoPhoneNumber", + "ServerMessageModelOutputPhoneNumber_Twilio", + "ServerMessageModelOutputPhoneNumber_Vapi", + "ServerMessageModelOutputPhoneNumber_Vonage", + "ServerMessagePhoneCallControl", + "ServerMessagePhoneCallControlDestination", + "ServerMessagePhoneCallControlDestination_Number", + "ServerMessagePhoneCallControlDestination_Sip", + "ServerMessagePhoneCallControlPhoneNumber", + "ServerMessagePhoneCallControlPhoneNumber_ByoPhoneNumber", + "ServerMessagePhoneCallControlPhoneNumber_Twilio", + "ServerMessagePhoneCallControlPhoneNumber_Vapi", + "ServerMessagePhoneCallControlPhoneNumber_Vonage", + "ServerMessagePhoneCallControlRequest", + "ServerMessageResponse", + "ServerMessageResponseAssistantRequest", + "ServerMessageResponseAssistantRequestDestination", + "ServerMessageResponseAssistantRequestDestination_Number", + "ServerMessageResponseAssistantRequestDestination_Sip", + "ServerMessageResponseMessageResponse", + "ServerMessageResponseToolCalls", + "ServerMessageResponseTransferDestinationRequest", + "ServerMessageResponseTransferDestinationRequestDestination", + "ServerMessageResponseTransferDestinationRequestDestination_Assistant", + "ServerMessageResponseTransferDestinationRequestDestination_Number", + "ServerMessageResponseTransferDestinationRequestDestination_Sip", + "ServerMessageResponseTransferDestinationRequestDestination_Step", + "ServerMessageResponseVoiceRequest", + "ServerMessageSpeechUpdate", + "ServerMessageSpeechUpdatePhoneNumber", + "ServerMessageSpeechUpdatePhoneNumber_ByoPhoneNumber", + "ServerMessageSpeechUpdatePhoneNumber_Twilio", + "ServerMessageSpeechUpdatePhoneNumber_Vapi", + "ServerMessageSpeechUpdatePhoneNumber_Vonage", + "ServerMessageSpeechUpdateRole", + "ServerMessageSpeechUpdateStatus", + "ServerMessageStatusUpdate", + "ServerMessageStatusUpdateDestination", + "ServerMessageStatusUpdateDestination_Number", + "ServerMessageStatusUpdateDestination_Sip", + "ServerMessageStatusUpdateEndedReason", + "ServerMessageStatusUpdateMessagesItem", + "ServerMessageStatusUpdatePhoneNumber", + "ServerMessageStatusUpdatePhoneNumber_ByoPhoneNumber", + "ServerMessageStatusUpdatePhoneNumber_Twilio", + "ServerMessageStatusUpdatePhoneNumber_Vapi", + "ServerMessageStatusUpdatePhoneNumber_Vonage", + "ServerMessageStatusUpdateStatus", + "ServerMessageToolCalls", + "ServerMessageToolCallsPhoneNumber", + "ServerMessageToolCallsPhoneNumber_ByoPhoneNumber", + "ServerMessageToolCallsPhoneNumber_Twilio", + "ServerMessageToolCallsPhoneNumber_Vapi", + "ServerMessageToolCallsPhoneNumber_Vonage", + "ServerMessageToolCallsToolWithToolCallListItem", + "ServerMessageToolCallsToolWithToolCallListItem_Function", + "ServerMessageToolCallsToolWithToolCallListItem_Ghl", + "ServerMessageToolCallsToolWithToolCallListItem_Make", + "ServerMessageTranscript", + "ServerMessageTranscriptPhoneNumber", + "ServerMessageTranscriptPhoneNumber_ByoPhoneNumber", + "ServerMessageTranscriptPhoneNumber_Twilio", + "ServerMessageTranscriptPhoneNumber_Vapi", + "ServerMessageTranscriptPhoneNumber_Vonage", + "ServerMessageTranscriptRole", + "ServerMessageTranscriptTranscriptType", + "ServerMessageTransferDestinationRequest", + "ServerMessageTransferDestinationRequestPhoneNumber", + "ServerMessageTransferDestinationRequestPhoneNumber_ByoPhoneNumber", + "ServerMessageTransferDestinationRequestPhoneNumber_Twilio", + "ServerMessageTransferDestinationRequestPhoneNumber_Vapi", + "ServerMessageTransferDestinationRequestPhoneNumber_Vonage", + "ServerMessageTransferUpdate", + "ServerMessageTransferUpdateDestination", + "ServerMessageTransferUpdateDestination_Assistant", + "ServerMessageTransferUpdateDestination_Number", + "ServerMessageTransferUpdateDestination_Sip", + "ServerMessageTransferUpdateDestination_Step", + "ServerMessageTransferUpdatePhoneNumber", + "ServerMessageTransferUpdatePhoneNumber_ByoPhoneNumber", + "ServerMessageTransferUpdatePhoneNumber_Twilio", + "ServerMessageTransferUpdatePhoneNumber_Vapi", + "ServerMessageTransferUpdatePhoneNumber_Vonage", + "ServerMessageUserInterrupted", + "ServerMessageUserInterruptedPhoneNumber", + "ServerMessageUserInterruptedPhoneNumber_ByoPhoneNumber", + "ServerMessageUserInterruptedPhoneNumber_Twilio", + "ServerMessageUserInterruptedPhoneNumber_Vapi", + "ServerMessageUserInterruptedPhoneNumber_Vonage", + "ServerMessageVoiceInput", + "ServerMessageVoiceInputPhoneNumber", + "ServerMessageVoiceInputPhoneNumber_ByoPhoneNumber", + "ServerMessageVoiceInputPhoneNumber_Twilio", + "ServerMessageVoiceInputPhoneNumber_Vapi", + "ServerMessageVoiceInputPhoneNumber_Vonage", + "ServerMessageVoiceRequest", + "ServerMessageVoiceRequestPhoneNumber", + "ServerMessageVoiceRequestPhoneNumber_ByoPhoneNumber", + "ServerMessageVoiceRequestPhoneNumber_Twilio", + "ServerMessageVoiceRequestPhoneNumber_Vapi", + "ServerMessageVoiceRequestPhoneNumber_Vonage", + "SipTrunkGateway", + "SipTrunkGatewayOutboundProtocol", + "SipTrunkOutboundAuthenticationPlan", + "SipTrunkOutboundSipRegisterPlan", + "Squad", + "SquadMemberDto", + "StartSpeakingPlan", + "StepDestination", + "StepDestinationConditionsItem", + "StepDestinationConditionsItem_ModelBased", + "StepDestinationConditionsItem_RuleBased", + "StopSpeakingPlan", + "StructuredDataPlan", + "SuccessEvaluationPlan", + "SuccessEvaluationPlanRubric", + "SummaryPlan", + "SyncVoiceLibraryDto", + "SyncVoiceLibraryDtoProvidersItem", + "SystemMessage", + "TalkscriberTranscriber", + "TalkscriberTranscriberLanguage", + "Template", + "TemplateDetails", + "TemplateDetails_Dtmf", + "TemplateDetails_EndCall", + "TemplateDetails_Function", + "TemplateDetails_Ghl", + "TemplateDetails_Make", + "TemplateDetails_TransferCall", + "TemplateDetails_Voicemail", + "TemplateProvider", + "TemplateProviderDetails", + "TemplateProviderDetails_Function", + "TemplateProviderDetails_Ghl", + "TemplateProviderDetails_Make", + "TemplateVisibility", + "TimeRange", + "TimeRangeStep", + "TogetherAiCredential", + "TogetherAiModel", + "TogetherAiModelToolsItem", + "TogetherAiModelToolsItem_Dtmf", + "TogetherAiModelToolsItem_EndCall", + "TogetherAiModelToolsItem_Function", + "TogetherAiModelToolsItem_Ghl", + "TogetherAiModelToolsItem_Make", + "TogetherAiModelToolsItem_TransferCall", + "TogetherAiModelToolsItem_Voicemail", + "Token", + "TokenRestrictions", + "TokenTag", + "ToolCall", + "ToolCallBlock", + "ToolCallBlockMessagesItem", + "ToolCallBlockMessagesItem_BlockComplete", + "ToolCallBlockMessagesItem_BlockStart", + "ToolCallBlockTool", + "ToolCallBlockTool_Dtmf", + "ToolCallBlockTool_EndCall", + "ToolCallBlockTool_Function", + "ToolCallBlockTool_Ghl", + "ToolCallBlockTool_Make", + "ToolCallBlockTool_TransferCall", + "ToolCallBlockTool_Voicemail", + "ToolCallFunction", + "ToolCallMessage", + "ToolCallResult", + "ToolCallResultMessage", + "ToolCallResultMessageItem", + "ToolCallResultMessageItem_RequestComplete", + "ToolCallResultMessageItem_RequestFailed", + "ToolMessageComplete", + "ToolMessageCompleteRole", + "ToolMessageDelayed", + "ToolMessageFailed", + "ToolMessageStart", + "ToolTemplateMetadata", + "ToolTemplateSetup", + "TranscriberCost", + "TranscriptPlan", + "TranscriptionEndpointingPlan", + "TransferCallTool", + "TransferCallToolDestinationsItem", + "TransferCallToolDestinationsItem_Assistant", + "TransferCallToolDestinationsItem_Number", + "TransferCallToolDestinationsItem_Sip", + "TransferCallToolDestinationsItem_Step", + "TransferCallToolMessagesItem", + "TransferCallToolMessagesItem_RequestComplete", + "TransferCallToolMessagesItem_RequestFailed", + "TransferCallToolMessagesItem_RequestResponseDelayed", + "TransferCallToolMessagesItem_RequestStart", + "TransferDestinationAssistant", + "TransferDestinationAssistantTransferMode", + "TransferDestinationNumber", + "TransferDestinationSip", + "TransferDestinationStep", + "TransportConfigurationTwilio", + "TransportConfigurationTwilioRecordingChannels", + "TransportCost", + "TwilioCredential", + "TwilioPhoneNumber", + "TwilioPhoneNumberFallbackDestination", + "TwilioPhoneNumberFallbackDestination_Number", + "TwilioPhoneNumberFallbackDestination_Sip", + "TwilioVoicemailDetection", + "TwilioVoicemailDetectionVoicemailDetectionTypesItem", + "UpdateAnthropicCredentialDto", + "UpdateAnyscaleCredentialDto", + "UpdateAzureOpenAiCredentialDto", + "UpdateAzureOpenAiCredentialDtoModelsItem", + "UpdateAzureOpenAiCredentialDtoRegion", + "UpdateByoSipTrunkCredentialDto", + "UpdateCartesiaCredentialDto", + "UpdateCustomLlmCredentialDto", + "UpdateDeepInfraCredentialDto", + "UpdateDeepgramCredentialDto", + "UpdateElevenLabsCredentialDto", + "UpdateGcpCredentialDto", + "UpdateGladiaCredentialDto", + "UpdateGoHighLevelCredentialDto", + "UpdateGroqCredentialDto", + "UpdateLmntCredentialDto", + "UpdateMakeCredentialDto", + "UpdateOpenAiCredentialDto", + "UpdateOpenRouterCredentialDto", + "UpdateOrgDto", + "UpdatePerplexityAiCredentialDto", + "UpdatePlayHtCredentialDto", + "UpdateRimeAiCredentialDto", + "UpdateRunpodCredentialDto", + "UpdateS3CredentialDto", + "UpdateTogetherAiCredentialDto", + "UpdateToolTemplateDto", + "UpdateToolTemplateDtoDetails", + "UpdateToolTemplateDtoDetails_Dtmf", + "UpdateToolTemplateDtoDetails_EndCall", + "UpdateToolTemplateDtoDetails_Function", + "UpdateToolTemplateDtoDetails_Ghl", + "UpdateToolTemplateDtoDetails_Make", + "UpdateToolTemplateDtoDetails_TransferCall", + "UpdateToolTemplateDtoDetails_Voicemail", + "UpdateToolTemplateDtoProvider", + "UpdateToolTemplateDtoProviderDetails", + "UpdateToolTemplateDtoProviderDetails_Function", + "UpdateToolTemplateDtoProviderDetails_Ghl", + "UpdateToolTemplateDtoProviderDetails_Make", + "UpdateToolTemplateDtoVisibility", + "UpdateTwilioCredentialDto", + "UpdateUserRoleDto", + "UpdateUserRoleDtoRole", + "UpdateVonageCredentialDto", + "User", + "UserMessage", + "VapiCost", + "VapiModel", + "VapiModelStepsItem", + "VapiModelStepsItem_Callback", + "VapiModelStepsItem_Handoff", + "VapiModelToolsItem", + "VapiModelToolsItem_Dtmf", + "VapiModelToolsItem_EndCall", + "VapiModelToolsItem_Function", + "VapiModelToolsItem_Ghl", + "VapiModelToolsItem_Make", + "VapiModelToolsItem_TransferCall", + "VapiModelToolsItem_Voicemail", + "VapiPhoneNumber", + "VapiPhoneNumberFallbackDestination", + "VapiPhoneNumberFallbackDestination_Number", + "VapiPhoneNumberFallbackDestination_Sip", + "VoiceCost", + "VoiceLibrary", + "VoiceLibraryGender", + "VoiceLibraryVoiceResponse", + "VonageCredential", + "VonagePhoneNumber", + "VonagePhoneNumberFallbackDestination", + "VonagePhoneNumberFallbackDestination_Number", + "VonagePhoneNumberFallbackDestination_Sip", + "WorkflowBlock", + "WorkflowBlockMessagesItem", + "WorkflowBlockMessagesItem_BlockComplete", + "WorkflowBlockMessagesItem_BlockStart", + "WorkflowBlockStepsItem", + "WorkflowBlockStepsItem_Callback", + "WorkflowBlockStepsItem_Handoff", +] diff --git a/src/vapi/types/add_voice_to_provider_dto.py b/src/vapi/types/add_voice_to_provider_dto.py new file mode 100644 index 0000000..74f7a8a --- /dev/null +++ b/src/vapi/types/add_voice_to_provider_dto.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class AddVoiceToProviderDto(UniversalBaseModel): + owner_id: typing_extensions.Annotated[str, FieldMetadata(alias="ownerId")] = pydantic.Field() + """ + This is the owner_id of your shared voice which you want to add to your provider Account from Provider Voice Library + """ + + voice_id: typing_extensions.Annotated[str, FieldMetadata(alias="voiceId")] = pydantic.Field() + """ + This is the voice_id of the shared voice which you want to add to your provider Account from Provider Voice Library + """ + + name: str = pydantic.Field() + """ + This is the new name of the voice which you want to have once you have added voice to your provider Account from Provider Voice Library + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/analysis.py b/src/vapi/types/analysis.py new file mode 100644 index 0000000..ec1d521 --- /dev/null +++ b/src/vapi/types/analysis.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class Analysis(UniversalBaseModel): + summary: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the summary of the call. Customize by setting `assistant.analysisPlan.summaryPrompt`. + """ + + structured_data: typing_extensions.Annotated[ + typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="structuredData") + ] = pydantic.Field(default=None) + """ + This is the structured data extracted from the call. Customize by setting `assistant.analysisPlan.structuredDataPrompt` and/or `assistant.analysisPlan.structuredDataSchema`. + """ + + success_evaluation: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="successEvaluation")] = ( + pydantic.Field(default=None) + ) + """ + This is the evaluation of the call. Customize by setting `assistant.analysisPlan.successEvaluationPrompt` and/or `assistant.analysisPlan.successEvaluationRubric`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/analysis_cost.py b/src/vapi/types/analysis_cost.py new file mode 100644 index 0000000..22197c2 --- /dev/null +++ b/src/vapi/types/analysis_cost.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +from .analysis_cost_analysis_type import AnalysisCostAnalysisType +from ..core.serialization import FieldMetadata +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AnalysisCost(UniversalBaseModel): + analysis_type: typing_extensions.Annotated[AnalysisCostAnalysisType, FieldMetadata(alias="analysisType")] = ( + pydantic.Field() + ) + """ + This is the type of analysis performed. + """ + + model: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() + """ + This is the model that was used to perform the analysis. + """ + + prompt_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="promptTokens")] = pydantic.Field() + """ + This is the number of prompt tokens used in the analysis. + """ + + completion_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="completionTokens")] = pydantic.Field() + """ + This is the number of completion tokens generated in the analysis. + """ + + cost: float = pydantic.Field() + """ + This is the cost of the component in USD. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/analysis_cost_analysis_type.py b/src/vapi/types/analysis_cost_analysis_type.py new file mode 100644 index 0000000..483ab82 --- /dev/null +++ b/src/vapi/types/analysis_cost_analysis_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AnalysisCostAnalysisType = typing.Union[typing.Literal["summary", "structuredData", "successEvaluation"], typing.Any] diff --git a/src/vapi/types/analysis_cost_breakdown.py b/src/vapi/types/analysis_cost_breakdown.py new file mode 100644 index 0000000..43b4a22 --- /dev/null +++ b/src/vapi/types/analysis_cost_breakdown.py @@ -0,0 +1,80 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AnalysisCostBreakdown(UniversalBaseModel): + summary: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the cost to summarize the call. + """ + + summary_prompt_tokens: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="summaryPromptTokens") + ] = pydantic.Field(default=None) + """ + This is the number of prompt tokens used to summarize the call. + """ + + summary_completion_tokens: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="summaryCompletionTokens") + ] = pydantic.Field(default=None) + """ + This is the number of completion tokens used to summarize the call. + """ + + structured_data: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="structuredData")] = ( + pydantic.Field(default=None) + ) + """ + This is the cost to extract structured data from the call. + """ + + structured_data_prompt_tokens: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="structuredDataPromptTokens") + ] = pydantic.Field(default=None) + """ + This is the number of prompt tokens used to extract structured data from the call. + """ + + structured_data_completion_tokens: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="structuredDataCompletionTokens") + ] = pydantic.Field(default=None) + """ + This is the number of completion tokens used to extract structured data from the call. + """ + + success_evaluation: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="successEvaluation") + ] = pydantic.Field(default=None) + """ + This is the cost to evaluate if the call was successful. + """ + + success_evaluation_prompt_tokens: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="successEvaluationPromptTokens") + ] = pydantic.Field(default=None) + """ + This is the number of prompt tokens used to evaluate if the call was successful. + """ + + success_evaluation_completion_tokens: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="successEvaluationCompletionTokens") + ] = pydantic.Field(default=None) + """ + This is the number of completion tokens used to evaluate if the call was successful. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/analysis_plan.py b/src/vapi/types/analysis_plan.py new file mode 100644 index 0000000..64e5d31 --- /dev/null +++ b/src/vapi/types/analysis_plan.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .summary_plan import SummaryPlan +from ..core.serialization import FieldMetadata +import pydantic +from .structured_data_plan import StructuredDataPlan +from .success_evaluation_plan import SuccessEvaluationPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AnalysisPlan(UniversalBaseModel): + summary_plan: typing_extensions.Annotated[typing.Optional[SummaryPlan], FieldMetadata(alias="summaryPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for generating the summary of the call. This outputs to `call.analysis.summary`. + """ + + structured_data_plan: typing_extensions.Annotated[ + typing.Optional[StructuredDataPlan], FieldMetadata(alias="structuredDataPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for generating the structured data from the call. This outputs to `call.analysis.structuredData`. + """ + + success_evaluation_plan: typing_extensions.Annotated[ + typing.Optional[SuccessEvaluationPlan], FieldMetadata(alias="successEvaluationPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for generating the success evaluation of the call. This outputs to `call.analysis.successEvaluation`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/analytics_operation.py b/src/vapi/types/analytics_operation.py new file mode 100644 index 0000000..fdb4b5c --- /dev/null +++ b/src/vapi/types/analytics_operation.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .analytics_operation_operation import AnalyticsOperationOperation +import pydantic +from .analytics_operation_column import AnalyticsOperationColumn +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AnalyticsOperation(UniversalBaseModel): + operation: AnalyticsOperationOperation = pydantic.Field() + """ + This is the aggregation operation you want to perform. + """ + + column: AnalyticsOperationColumn = pydantic.Field() + """ + This is the columns you want to perform the aggregation operation on. + """ + + alias: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the alias for column name returned. Defaults to `${operation}${column}`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/analytics_operation_column.py b/src/vapi/types/analytics_operation_column.py new file mode 100644 index 0000000..e45992c --- /dev/null +++ b/src/vapi/types/analytics_operation_column.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AnalyticsOperationColumn = typing.Union[ + typing.Literal[ + "id", + "cost", + "costBreakdown.llm", + "costBreakdown.stt", + "costBreakdown.tts", + "costBreakdown.vapi", + "costBreakdown.ttsCharacters", + "costBreakdown.llmPromptTokens", + "costBreakdown.llmCompletionTokens", + "duration", + ], + typing.Any, +] diff --git a/src/vapi/types/analytics_operation_operation.py b/src/vapi/types/analytics_operation_operation.py new file mode 100644 index 0000000..e709ffc --- /dev/null +++ b/src/vapi/types/analytics_operation_operation.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AnalyticsOperationOperation = typing.Union[typing.Literal["sum", "avg", "count", "min", "max"], typing.Any] diff --git a/src/vapi/types/analytics_query.py b/src/vapi/types/analytics_query.py new file mode 100644 index 0000000..639756e --- /dev/null +++ b/src/vapi/types/analytics_query.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from .analytics_query_group_by_item import AnalyticsQueryGroupByItem +from ..core.serialization import FieldMetadata +from .time_range import TimeRange +from .analytics_operation import AnalyticsOperation +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AnalyticsQuery(UniversalBaseModel): + table: typing.Literal["call"] = pydantic.Field(default="call") + """ + This is the table you want to query. + """ + + group_by: typing_extensions.Annotated[ + typing.Optional[typing.List[AnalyticsQueryGroupByItem]], FieldMetadata(alias="groupBy") + ] = pydantic.Field(default=None) + """ + This is the list of columns you want to group by. + """ + + name: str = pydantic.Field() + """ + This is the name of the query. This will be used to identify the query in the response. + """ + + time_range: typing_extensions.Annotated[typing.Optional[TimeRange], FieldMetadata(alias="timeRange")] = ( + pydantic.Field(default=None) + ) + """ + This is the time range for the query. + """ + + operations: typing.List[AnalyticsOperation] = pydantic.Field() + """ + This is the list of operations you want to perform. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/analytics_query_group_by_item.py b/src/vapi/types/analytics_query_group_by_item.py new file mode 100644 index 0000000..075134e --- /dev/null +++ b/src/vapi/types/analytics_query_group_by_item.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AnalyticsQueryGroupByItem = typing.Union[ + typing.Literal["type", "assistantId", "endedReason", "analysis.successEvaluation", "status"], typing.Any +] diff --git a/src/vapi/types/analytics_query_result.py b/src/vapi/types/analytics_query_result.py new file mode 100644 index 0000000..5e91cf9 --- /dev/null +++ b/src/vapi/types/analytics_query_result.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing_extensions +from .time_range import TimeRange +from ..core.serialization import FieldMetadata +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AnalyticsQueryResult(UniversalBaseModel): + name: str = pydantic.Field() + """ + This is the unique key for the query. + """ + + time_range: typing_extensions.Annotated[TimeRange, FieldMetadata(alias="timeRange")] = pydantic.Field() + """ + This is the time range for the query. + """ + + result: typing.List[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field() + """ + This is the result of the query, a list of unique groups with result of their aggregations. + + Example: + "result": [ + { "date": "2023-01-01", "assistantId": "123", "endedReason": "customer-ended-call", "sumDuration": 120, "avgCost": 10.5 }, + { "date": "2023-01-02", "assistantId": "123", "endedReason": "customer-did-not-give-microphone-permission", "sumDuration": 0, "avgCost": 0 }, + // Additional results + ] + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/anthropic_credential.py b/src/vapi/types/anthropic_credential.py new file mode 100644 index 0000000..e36cc37 --- /dev/null +++ b/src/vapi/types/anthropic_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AnthropicCredential(UniversalBaseModel): + provider: typing.Literal["anthropic"] = "anthropic" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/anthropic_model.py b/src/vapi/types/anthropic_model.py new file mode 100644 index 0000000..6667e59 --- /dev/null +++ b/src/vapi/types/anthropic_model.py @@ -0,0 +1,90 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +import pydantic +from .anthropic_model_tools_item import AnthropicModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .anthropic_model_model import AnthropicModelModel +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AnthropicModel(UniversalBaseModel): + messages: typing.Optional[typing.List[OpenAiMessage]] = pydantic.Field(default=None) + """ + This is the starting state for the conversation. + """ + + tools: typing.Optional[typing.List[AnthropicModelToolsItem]] = pydantic.Field(default=None) + """ + These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. + + Both `tools` and `toolIds` can be used together. + """ + + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = ( + pydantic.Field(default=None) + ) + """ + These are the tools that the assistant can use during the call. To use transient tools, use `tools`. + + Both `tools` and `toolIds` can be used together. + """ + + model: AnthropicModelModel = pydantic.Field() + """ + This is the Anthropic/Claude models that will be used. + """ + + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + """ + + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = pydantic.Field(default=None) + """ + These are the options for the knowledge base. + """ + + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = pydantic.Field( + default=None + ) + """ + This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + """ + + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether we detect user's emotion while they speak and send it as an additional info to model. + + Default `false` because the model is usually are good at understanding the user's emotion from text. + + @default false + """ + + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = ( + pydantic.Field(default=None) + ) + """ + This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + + Default is 0. + + @default 0 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/anthropic_model_model.py b/src/vapi/types/anthropic_model_model.py new file mode 100644 index 0000000..671ff39 --- /dev/null +++ b/src/vapi/types/anthropic_model_model.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AnthropicModelModel = typing.Union[ + typing.Literal[ + "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", "claude-3-5-sonnet-20240620" + ], + typing.Any, +] diff --git a/src/vapi/types/anthropic_model_tools_item.py b/src/vapi/types/anthropic_model_tools_item.py new file mode 100644 index 0000000..96bdfcf --- /dev/null +++ b/src/vapi/types/anthropic_model_tools_item.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class AnthropicModelToolsItem_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AnthropicModelToolsItem_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AnthropicModelToolsItem_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AnthropicModelToolsItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AnthropicModelToolsItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AnthropicModelToolsItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AnthropicModelToolsItem_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +AnthropicModelToolsItem = typing.Union[ + AnthropicModelToolsItem_Dtmf, + AnthropicModelToolsItem_EndCall, + AnthropicModelToolsItem_Voicemail, + AnthropicModelToolsItem_Function, + AnthropicModelToolsItem_Ghl, + AnthropicModelToolsItem_Make, + AnthropicModelToolsItem_TransferCall, +] diff --git a/src/vapi/types/anyscale_credential.py b/src/vapi/types/anyscale_credential.py new file mode 100644 index 0000000..2983f0a --- /dev/null +++ b/src/vapi/types/anyscale_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AnyscaleCredential(UniversalBaseModel): + provider: typing.Literal["anyscale"] = "anyscale" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/anyscale_model.py b/src/vapi/types/anyscale_model.py new file mode 100644 index 0000000..0e5a331 --- /dev/null +++ b/src/vapi/types/anyscale_model.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +import pydantic +from .anyscale_model_tools_item import AnyscaleModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AnyscaleModel(UniversalBaseModel): + messages: typing.Optional[typing.List[OpenAiMessage]] = pydantic.Field(default=None) + """ + This is the starting state for the conversation. + """ + + tools: typing.Optional[typing.List[AnyscaleModelToolsItem]] = pydantic.Field(default=None) + """ + These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. + + Both `tools` and `toolIds` can be used together. + """ + + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = ( + pydantic.Field(default=None) + ) + """ + These are the tools that the assistant can use during the call. To use transient tools, use `tools`. + + Both `tools` and `toolIds` can be used together. + """ + + model: str = pydantic.Field() + """ + This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b + """ + + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + """ + + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = pydantic.Field(default=None) + """ + These are the options for the knowledge base. + """ + + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = pydantic.Field( + default=None + ) + """ + This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + """ + + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether we detect user's emotion while they speak and send it as an additional info to model. + + Default `false` because the model is usually are good at understanding the user's emotion from text. + + @default false + """ + + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = ( + pydantic.Field(default=None) + ) + """ + This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + + Default is 0. + + @default 0 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/anyscale_model_tools_item.py b/src/vapi/types/anyscale_model_tools_item.py new file mode 100644 index 0000000..fbb884e --- /dev/null +++ b/src/vapi/types/anyscale_model_tools_item.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class AnyscaleModelToolsItem_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AnyscaleModelToolsItem_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AnyscaleModelToolsItem_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AnyscaleModelToolsItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AnyscaleModelToolsItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AnyscaleModelToolsItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AnyscaleModelToolsItem_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +AnyscaleModelToolsItem = typing.Union[ + AnyscaleModelToolsItem_Dtmf, + AnyscaleModelToolsItem_EndCall, + AnyscaleModelToolsItem_Voicemail, + AnyscaleModelToolsItem_Function, + AnyscaleModelToolsItem_Ghl, + AnyscaleModelToolsItem_Make, + AnyscaleModelToolsItem_TransferCall, +] diff --git a/src/vapi/types/artifact.py b/src/vapi/types/artifact.py new file mode 100644 index 0000000..7afda69 --- /dev/null +++ b/src/vapi/types/artifact.py @@ -0,0 +1,66 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .artifact_messages_item import ArtifactMessagesItem +import pydantic +import typing_extensions +from .open_ai_message import OpenAiMessage +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class Artifact(UniversalBaseModel): + messages: typing.Optional[typing.List[ArtifactMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that were spoken during the call. + """ + + messages_open_ai_formatted: typing_extensions.Annotated[ + typing.Optional[typing.List[OpenAiMessage]], FieldMetadata(alias="messagesOpenAIFormatted") + ] = pydantic.Field(default=None) + """ + These are the messages that were spoken during the call, formatted for OpenAI. + """ + + recording_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="recordingUrl")] = ( + pydantic.Field(default=None) + ) + """ + This is the recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`. + """ + + stereo_recording_url: typing_extensions.Annotated[ + typing.Optional[str], FieldMetadata(alias="stereoRecordingUrl") + ] = pydantic.Field(default=None) + """ + This is the stereo recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`. + """ + + video_recording_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="videoRecordingUrl")] = ( + pydantic.Field(default=None) + ) + """ + This is video recording url for the call. To enable, set `assistant.artifactPlan.videoRecordingEnabled`. + """ + + video_recording_start_delay_seconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="videoRecordingStartDelaySeconds") + ] = pydantic.Field(default=None) + """ + This is video recording start delay in ms. To enable, set `assistant.artifactPlan.videoRecordingEnabled`. This can be used to align the playback of the recording with artifact.messages timestamps. + """ + + transcript: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the transcript of the call. This is derived from `artifact.messages` but provided for convenience. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/artifact_messages_item.py b/src/vapi/types/artifact_messages_item.py new file mode 100644 index 0000000..140bb74 --- /dev/null +++ b/src/vapi/types/artifact_messages_item.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from .user_message import UserMessage +from .system_message import SystemMessage +from .bot_message import BotMessage +from .tool_call_message import ToolCallMessage +from .tool_call_result_message import ToolCallResultMessage + +ArtifactMessagesItem = typing.Union[UserMessage, SystemMessage, BotMessage, ToolCallMessage, ToolCallResultMessage] diff --git a/src/vapi/types/artifact_plan.py b/src/vapi/types/artifact_plan.py new file mode 100644 index 0000000..24da574 --- /dev/null +++ b/src/vapi/types/artifact_plan.py @@ -0,0 +1,70 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .transcript_plan import TranscriptPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ArtifactPlan(UniversalBaseModel): + recording_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="recordingEnabled")] = ( + pydantic.Field(default=None) + ) + """ + This determines whether assistant's calls are recorded. Defaults to true. + + Usage: + + - If you don't want to record the calls, set this to false. + - If you want to record the calls when `assistant.hipaaEnabled`, explicity set this to true and make sure to provide S3 or GCP credentials on the Provider Credentials page in the Dashboard. + + You can find the recording at `call.artifact.recordingUrl` and `call.artifact.stereoRecordingUrl` after the call is ended. + + @default true + """ + + video_recording_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="videoRecordingEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether the video is recorded during the call. Defaults to false. Only relevant for `webCall` type. + + You can find the video recording at `call.artifact.videoRecordingUrl` after the call is ended. + + @default false + """ + + transcript_plan: typing_extensions.Annotated[ + typing.Optional[TranscriptPlan], FieldMetadata(alias="transcriptPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for `call.artifact.transcript`. To disable, set `transcriptPlan.enabled` to false. + """ + + recording_path: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="recordingPath")] = ( + pydantic.Field(default=None) + ) + """ + This is the path where the recording will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard. + + If credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it. + + Usage: + + - If you want to upload the recording to a specific path, set this to the path. Example: `/my-assistant-recordings`. + - If you want to upload the recording to the root of the bucket, set this to `/`. + + @default '/' + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/assignment_mutation.py b/src/vapi/types/assignment_mutation.py new file mode 100644 index 0000000..fc7656e --- /dev/null +++ b/src/vapi/types/assignment_mutation.py @@ -0,0 +1,85 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .assignment_mutation_conditions_item import AssignmentMutationConditionsItem +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AssignmentMutation(UniversalBaseModel): + conditions: typing.Optional[typing.List[AssignmentMutationConditionsItem]] = pydantic.Field(default=None) + """ + This is an optional array of conditions that must be met for this mutation to be triggered. + """ + + type: typing.Literal["assignment"] = pydantic.Field(default="assignment") + """ + This mutation assigns a new value to an existing or new variable. + """ + + variable: str = pydantic.Field() + """ + This is the variable to assign a new value to. + + You can reference any variable in the context of the current block execution (step): + + - "output.your-property-name" for current step's output + - "your-step-name.output.your-property-name" for another step's output (in the same workflow; read caveat #1) + - "your-block-name.output.your-property-name" for another block's output (in the same workflow; read caveat #2) + - "global.your-property-name" for the global context + + This needs to be the key path of the variable. If you use {{}}, it'll dereference that to the value of the variable before assignment. This can be useful if the path is dynamic. Example: + + - "global.{{my-tool-call-step.output.my-key-name}}" + + You can also string interpolate multiple variables to get the key name: + + - "global.{{my-tool-call-step.output.my-key-name-suffix}}-{{my-tool-call-step.output.my-key-name}}" + + The path to the new variable is created if it doesn't exist. Example: + + - "global.this-does-not-exist.neither-does-this" will create `this-does-not-exist` object with `neither-does-this` as a key + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow. + """ + + value: str = pydantic.Field() + """ + The value to assign to the variable. + + You can reference any variable in the context of the current block execution (step): + + - "{{output.your-property-name}}" for current step's output + - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) + - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) + - "{{global.your-property-name}}" for the global context + + Or, you can use a constant: + + - "1" + - "text" + - "true" + - "false" + + Or, you can mix and match with string interpolation: + + - "{{your-property-name}}-{{input.your-property-name-2}}-1" + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/assignment_mutation_conditions_item.py b/src/vapi/types/assignment_mutation_conditions_item.py new file mode 100644 index 0000000..295655f --- /dev/null +++ b/src/vapi/types/assignment_mutation_conditions_item.py @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .rule_based_condition_operator import RuleBasedConditionOperator +import typing_extensions +from ..core.serialization import FieldMetadata + + +class AssignmentMutationConditionsItem_ModelBased(UniversalBaseModel): + type: typing.Literal["model-based"] = "model-based" + instruction: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssignmentMutationConditionsItem_RuleBased(UniversalBaseModel): + type: typing.Literal["rule-based"] = "rule-based" + operator: RuleBasedConditionOperator + left_side: typing_extensions.Annotated[str, FieldMetadata(alias="leftSide")] + right_side: typing_extensions.Annotated[str, FieldMetadata(alias="rightSide")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +AssignmentMutationConditionsItem = typing.Union[ + AssignmentMutationConditionsItem_ModelBased, AssignmentMutationConditionsItem_RuleBased +] diff --git a/src/vapi/types/assistant.py b/src/vapi/types/assistant.py new file mode 100644 index 0000000..c2c7fb9 --- /dev/null +++ b/src/vapi/types/assistant.py @@ -0,0 +1,330 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing +from .assistant_transcriber import AssistantTranscriber +import pydantic +from .assistant_model import AssistantModel +from .assistant_voice import AssistantVoice +import typing_extensions +from .assistant_first_message_mode import AssistantFirstMessageMode +from ..core.serialization import FieldMetadata +from .assistant_client_messages_item import AssistantClientMessagesItem +from .assistant_server_messages_item import AssistantServerMessagesItem +from .assistant_background_sound import AssistantBackgroundSound +from .transport_configuration_twilio import TransportConfigurationTwilio +from .twilio_voicemail_detection import TwilioVoicemailDetection +from .analysis_plan import AnalysisPlan +from .artifact_plan import ArtifactPlan +from .message_plan import MessagePlan +from .start_speaking_plan import StartSpeakingPlan +from .stop_speaking_plan import StopSpeakingPlan +from .monitor_plan import MonitorPlan +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class Assistant(UniversalBaseModel): + transcriber: typing.Optional[AssistantTranscriber] = pydantic.Field(default=None) + """ + These are the options for the assistant's transcriber. + """ + + model: typing.Optional[AssistantModel] = pydantic.Field(default=None) + """ + These are the options for the assistant's LLM. + """ + + voice: typing.Optional[AssistantVoice] = pydantic.Field(default=None) + """ + These are the options for the assistant's voice. + """ + + first_message_mode: typing_extensions.Annotated[ + typing.Optional[AssistantFirstMessageMode], FieldMetadata(alias="firstMessageMode") + ] = pydantic.Field(default=None) + """ + This is the mode for the first message. Default is 'assistant-speaks-first'. + + Use: + + - 'assistant-speaks-first' to have the assistant speak first. + - 'assistant-waits-for-user' to have the assistant wait for the user to speak first. + - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + + @default 'assistant-speaks-first' + """ + + hipaa_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="hipaaEnabled")] = ( + pydantic.Field(default=None) + ) + """ + When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + """ + + client_messages: typing_extensions.Annotated[ + typing.Optional[typing.List[AssistantClientMessagesItem]], FieldMetadata(alias="clientMessages") + ] = pydantic.Field(default=None) + """ + These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + """ + + server_messages: typing_extensions.Annotated[ + typing.Optional[typing.List[AssistantServerMessagesItem]], FieldMetadata(alias="serverMessages") + ] = pydantic.Field(default=None) + """ + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. + """ + + silence_timeout_seconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="silenceTimeoutSeconds") + ] = pydantic.Field(default=None) + """ + How many seconds of silence to wait before ending the call. Defaults to 30. + + @default 30 + """ + + max_duration_seconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="maxDurationSeconds") + ] = pydantic.Field(default=None) + """ + This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + + @default 600 (10 minutes) + """ + + background_sound: typing_extensions.Annotated[ + typing.Optional[AssistantBackgroundSound], FieldMetadata(alias="backgroundSound") + ] = pydantic.Field(default=None) + """ + This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + """ + + backchanneling_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="backchannelingEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. + + Default `false` while in beta. + + @default false + """ + + background_denoising_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="backgroundDenoisingEnabled") + ] = pydantic.Field(default=None) + """ + This enables filtering of noise and background speech while the user is talking. + + Default `false` while in beta. + + @default false + """ + + model_output_in_messages_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="modelOutputInMessagesEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + + Default `false` while in beta. + + @default false + """ + + transport_configurations: typing_extensions.Annotated[ + typing.Optional[typing.List[TransportConfigurationTwilio]], FieldMetadata(alias="transportConfigurations") + ] = pydantic.Field(default=None) + """ + These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the assistant. + + This is required when you want to transfer between assistants in a call. + """ + + first_message: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="firstMessage")] = ( + pydantic.Field(default=None) + ) + """ + This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + + If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + """ + + voicemail_detection: typing_extensions.Annotated[ + typing.Optional[TwilioVoicemailDetection], FieldMetadata(alias="voicemailDetection") + ] = pydantic.Field(default=None) + """ + These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. + You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + """ + + voicemail_message: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="voicemailMessage")] = ( + pydantic.Field(default=None) + ) + """ + This is the message that the assistant will say if the call is forwarded to voicemail. + + If unspecified, it will hang up. + """ + + end_call_message: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="endCallMessage")] = ( + pydantic.Field(default=None) + ) + """ + This is the message that the assistant will say if it ends the call. + + If unspecified, it will hang up without saying anything. + """ + + end_call_phrases: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="endCallPhrases") + ] = pydantic.Field(default=None) + """ + This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + """ + + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + This is for metadata you want to store on the assistant. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + + All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + analysis_plan: typing_extensions.Annotated[typing.Optional[AnalysisPlan], FieldMetadata(alias="analysisPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + """ + + artifact_plan: typing_extensions.Annotated[typing.Optional[ArtifactPlan], FieldMetadata(alias="artifactPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + + Note: `recordingEnabled` is currently at the root level. It will be moved to `artifactPlan` in the future, but will remain backwards compatible. + """ + + message_plan: typing_extensions.Annotated[typing.Optional[MessagePlan], FieldMetadata(alias="messagePlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. + + Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. + """ + + start_speaking_plan: typing_extensions.Annotated[ + typing.Optional[StartSpeakingPlan], FieldMetadata(alias="startSpeakingPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for when the assistant should start talking. + + You should configure this if you're running into these issues: + + - The assistant is too slow to start talking after the customer is done speaking. + - The assistant is too fast to start talking after the customer is done speaking. + - The assistant is so fast that it's actually interrupting the customer. + """ + + stop_speaking_plan: typing_extensions.Annotated[ + typing.Optional[StopSpeakingPlan], FieldMetadata(alias="stopSpeakingPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for when assistant should stop talking on customer interruption. + + You should configure this if you're running into these issues: + + - The assistant is too slow to recognize customer's interruption. + - The assistant is too fast to recognize customer's interruption. + - The assistant is getting interrupted by phrases that are just acknowledgments. + - The assistant is getting interrupted by background noises. + - The assistant is not properly stopping -- it starts talking right after getting interrupted. + """ + + monitor_plan: typing_extensions.Annotated[typing.Optional[MonitorPlan], FieldMetadata(alias="monitorPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for real-time monitoring of the assistant's calls. + + Usage: + + - To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. + - To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + + Note, `serverMessages`, `clientMessages`, `serverUrl` and `serverUrlSecret` are currently at the root level but will be moved to `monitorPlan` in the future. Will remain backwards compatible + """ + + credential_ids: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="credentialIds") + ] = pydantic.Field(default=None) + """ + These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the assistant. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this assistant belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, Assistant=Assistant) +update_forward_refs(CreateWorkflowBlockDto, Assistant=Assistant) +update_forward_refs(HandoffStep, Assistant=Assistant) diff --git a/src/vapi/types/assistant_background_sound.py b/src/vapi/types/assistant_background_sound.py new file mode 100644 index 0000000..147d11c --- /dev/null +++ b/src/vapi/types/assistant_background_sound.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AssistantBackgroundSound = typing.Union[typing.Literal["off", "office"], typing.Any] diff --git a/src/vapi/types/assistant_client_messages_item.py b/src/vapi/types/assistant_client_messages_item.py new file mode 100644 index 0000000..c76465b --- /dev/null +++ b/src/vapi/types/assistant_client_messages_item.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AssistantClientMessagesItem = typing.Union[ + typing.Literal[ + "conversation-update", + "function-call", + "function-call-result", + "hang", + "language-changed", + "metadata", + "model-output", + "speech-update", + "status-update", + "transcript", + "tool-calls", + "tool-calls-result", + "user-interrupted", + "voice-input", + ], + typing.Any, +] diff --git a/src/vapi/types/assistant_first_message_mode.py b/src/vapi/types/assistant_first_message_mode.py new file mode 100644 index 0000000..aa49563 --- /dev/null +++ b/src/vapi/types/assistant_first_message_mode.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AssistantFirstMessageMode = typing.Union[ + typing.Literal[ + "assistant-speaks-first", "assistant-speaks-first-with-model-generated-message", "assistant-waits-for-user" + ], + typing.Any, +] diff --git a/src/vapi/types/assistant_model.py b/src/vapi/types/assistant_model.py new file mode 100644 index 0000000..b1f7103 --- /dev/null +++ b/src/vapi/types/assistant_model.py @@ -0,0 +1,359 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +from .anyscale_model_tools_item import AnyscaleModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .anthropic_model_tools_item import AnthropicModelToolsItem +from .anthropic_model_model import AnthropicModelModel +from .custom_llm_model_tools_item import CustomLlmModelToolsItem +from .custom_llm_model_metadata_send_mode import CustomLlmModelMetadataSendMode +from .deep_infra_model_tools_item import DeepInfraModelToolsItem +from .groq_model_tools_item import GroqModelToolsItem +from .groq_model_model import GroqModelModel +from .open_ai_model_tools_item import OpenAiModelToolsItem +from .open_ai_model_model import OpenAiModelModel +from .open_ai_model_fallback_models_item import OpenAiModelFallbackModelsItem +from .open_router_model_tools_item import OpenRouterModelToolsItem +from .perplexity_ai_model_tools_item import PerplexityAiModelToolsItem +from .together_ai_model_tools_item import TogetherAiModelToolsItem +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +from .vapi_model_tools_item import VapiModelToolsItem +from .vapi_model_steps_item import VapiModelStepsItem +from ..core.pydantic_utilities import update_forward_refs + + +class AssistantModel_Anyscale(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["anyscale"] = "anyscale" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[AnyscaleModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantModel_Anthropic(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["anthropic"] = "anthropic" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[AnthropicModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: AnthropicModelModel + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantModel_CustomLlm(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["custom-llm"] = "custom-llm" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[CustomLlmModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + metadata_send_mode: typing_extensions.Annotated[ + typing.Optional[CustomLlmModelMetadataSendMode], FieldMetadata(alias="metadataSendMode") + ] = None + url: str + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantModel_Deepinfra(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["deepinfra"] = "deepinfra" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[DeepInfraModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantModel_Groq(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["groq"] = "groq" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[GroqModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: GroqModelModel + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantModel_Openai(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["openai"] = "openai" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[OpenAiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: OpenAiModelModel + fallback_models: typing_extensions.Annotated[ + typing.Optional[typing.List[OpenAiModelFallbackModelsItem]], FieldMetadata(alias="fallbackModels") + ] = None + semantic_caching_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="semanticCachingEnabled") + ] = None + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantModel_Openrouter(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["openrouter"] = "openrouter" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[OpenRouterModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantModel_PerplexityAi(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["perplexity-ai"] = "perplexity-ai" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[PerplexityAiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantModel_TogetherAi(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["together-ai"] = "together-ai" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[TogetherAiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantModel_Vapi(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["vapi"] = "vapi" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[VapiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + steps: typing.Optional[typing.List[VapiModelStepsItem]] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +AssistantModel = typing.Union[ + AssistantModel_Anyscale, + AssistantModel_Anthropic, + AssistantModel_CustomLlm, + AssistantModel_Deepinfra, + AssistantModel_Groq, + AssistantModel_Openai, + AssistantModel_Openrouter, + AssistantModel_PerplexityAi, + AssistantModel_TogetherAi, + AssistantModel_Vapi, +] +update_forward_refs(CallbackStep, AssistantModel_Vapi=AssistantModel_Vapi) +update_forward_refs(CreateWorkflowBlockDto, AssistantModel_Vapi=AssistantModel_Vapi) +update_forward_refs(HandoffStep, AssistantModel_Vapi=AssistantModel_Vapi) diff --git a/src/vapi/types/assistant_overrides.py b/src/vapi/types/assistant_overrides.py new file mode 100644 index 0000000..5970d00 --- /dev/null +++ b/src/vapi/types/assistant_overrides.py @@ -0,0 +1,316 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing +from .assistant_overrides_transcriber import AssistantOverridesTranscriber +import pydantic +from .assistant_overrides_model import AssistantOverridesModel +from .assistant_overrides_voice import AssistantOverridesVoice +import typing_extensions +from .assistant_overrides_first_message_mode import AssistantOverridesFirstMessageMode +from ..core.serialization import FieldMetadata +from .assistant_overrides_client_messages_item import AssistantOverridesClientMessagesItem +from .assistant_overrides_server_messages_item import AssistantOverridesServerMessagesItem +from .assistant_overrides_background_sound import AssistantOverridesBackgroundSound +from .transport_configuration_twilio import TransportConfigurationTwilio +from .twilio_voicemail_detection import TwilioVoicemailDetection +from .analysis_plan import AnalysisPlan +from .artifact_plan import ArtifactPlan +from .message_plan import MessagePlan +from .start_speaking_plan import StartSpeakingPlan +from .stop_speaking_plan import StopSpeakingPlan +from .monitor_plan import MonitorPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class AssistantOverrides(UniversalBaseModel): + transcriber: typing.Optional[AssistantOverridesTranscriber] = pydantic.Field(default=None) + """ + These are the options for the assistant's transcriber. + """ + + model: typing.Optional[AssistantOverridesModel] = pydantic.Field(default=None) + """ + These are the options for the assistant's LLM. + """ + + voice: typing.Optional[AssistantOverridesVoice] = pydantic.Field(default=None) + """ + These are the options for the assistant's voice. + """ + + first_message_mode: typing_extensions.Annotated[ + typing.Optional[AssistantOverridesFirstMessageMode], FieldMetadata(alias="firstMessageMode") + ] = pydantic.Field(default=None) + """ + This is the mode for the first message. Default is 'assistant-speaks-first'. + + Use: + + - 'assistant-speaks-first' to have the assistant speak first. + - 'assistant-waits-for-user' to have the assistant wait for the user to speak first. + - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + + @default 'assistant-speaks-first' + """ + + hipaa_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="hipaaEnabled")] = ( + pydantic.Field(default=None) + ) + """ + When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + """ + + client_messages: typing_extensions.Annotated[ + typing.Optional[typing.List[AssistantOverridesClientMessagesItem]], FieldMetadata(alias="clientMessages") + ] = pydantic.Field(default=None) + """ + These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + """ + + server_messages: typing_extensions.Annotated[ + typing.Optional[typing.List[AssistantOverridesServerMessagesItem]], FieldMetadata(alias="serverMessages") + ] = pydantic.Field(default=None) + """ + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. + """ + + silence_timeout_seconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="silenceTimeoutSeconds") + ] = pydantic.Field(default=None) + """ + How many seconds of silence to wait before ending the call. Defaults to 30. + + @default 30 + """ + + max_duration_seconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="maxDurationSeconds") + ] = pydantic.Field(default=None) + """ + This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + + @default 600 (10 minutes) + """ + + background_sound: typing_extensions.Annotated[ + typing.Optional[AssistantOverridesBackgroundSound], FieldMetadata(alias="backgroundSound") + ] = pydantic.Field(default=None) + """ + This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + """ + + backchanneling_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="backchannelingEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. + + Default `false` while in beta. + + @default false + """ + + background_denoising_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="backgroundDenoisingEnabled") + ] = pydantic.Field(default=None) + """ + This enables filtering of noise and background speech while the user is talking. + + Default `false` while in beta. + + @default false + """ + + model_output_in_messages_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="modelOutputInMessagesEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + + Default `false` while in beta. + + @default false + """ + + transport_configurations: typing_extensions.Annotated[ + typing.Optional[typing.List[TransportConfigurationTwilio]], FieldMetadata(alias="transportConfigurations") + ] = pydantic.Field(default=None) + """ + These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + """ + + variable_values: typing_extensions.Annotated[ + typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="variableValues") + ] = pydantic.Field(default=None) + """ + These are values that will be used to replace the template variables in the assistant messages and other text-based fields. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the assistant. + + This is required when you want to transfer between assistants in a call. + """ + + first_message: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="firstMessage")] = ( + pydantic.Field(default=None) + ) + """ + This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + + If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + """ + + voicemail_detection: typing_extensions.Annotated[ + typing.Optional[TwilioVoicemailDetection], FieldMetadata(alias="voicemailDetection") + ] = pydantic.Field(default=None) + """ + These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. + You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + """ + + voicemail_message: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="voicemailMessage")] = ( + pydantic.Field(default=None) + ) + """ + This is the message that the assistant will say if the call is forwarded to voicemail. + + If unspecified, it will hang up. + """ + + end_call_message: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="endCallMessage")] = ( + pydantic.Field(default=None) + ) + """ + This is the message that the assistant will say if it ends the call. + + If unspecified, it will hang up without saying anything. + """ + + end_call_phrases: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="endCallPhrases") + ] = pydantic.Field(default=None) + """ + This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + """ + + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + This is for metadata you want to store on the assistant. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + + All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + analysis_plan: typing_extensions.Annotated[typing.Optional[AnalysisPlan], FieldMetadata(alias="analysisPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + """ + + artifact_plan: typing_extensions.Annotated[typing.Optional[ArtifactPlan], FieldMetadata(alias="artifactPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + + Note: `recordingEnabled` is currently at the root level. It will be moved to `artifactPlan` in the future, but will remain backwards compatible. + """ + + message_plan: typing_extensions.Annotated[typing.Optional[MessagePlan], FieldMetadata(alias="messagePlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. + + Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. + """ + + start_speaking_plan: typing_extensions.Annotated[ + typing.Optional[StartSpeakingPlan], FieldMetadata(alias="startSpeakingPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for when the assistant should start talking. + + You should configure this if you're running into these issues: + + - The assistant is too slow to start talking after the customer is done speaking. + - The assistant is too fast to start talking after the customer is done speaking. + - The assistant is so fast that it's actually interrupting the customer. + """ + + stop_speaking_plan: typing_extensions.Annotated[ + typing.Optional[StopSpeakingPlan], FieldMetadata(alias="stopSpeakingPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for when assistant should stop talking on customer interruption. + + You should configure this if you're running into these issues: + + - The assistant is too slow to recognize customer's interruption. + - The assistant is too fast to recognize customer's interruption. + - The assistant is getting interrupted by phrases that are just acknowledgments. + - The assistant is getting interrupted by background noises. + - The assistant is not properly stopping -- it starts talking right after getting interrupted. + """ + + monitor_plan: typing_extensions.Annotated[typing.Optional[MonitorPlan], FieldMetadata(alias="monitorPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for real-time monitoring of the assistant's calls. + + Usage: + + - To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. + - To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + + Note, `serverMessages`, `clientMessages`, `serverUrl` and `serverUrlSecret` are currently at the root level but will be moved to `monitorPlan` in the future. Will remain backwards compatible + """ + + credential_ids: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="credentialIds") + ] = pydantic.Field(default=None) + """ + These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, AssistantOverrides=AssistantOverrides) +update_forward_refs(CreateWorkflowBlockDto, AssistantOverrides=AssistantOverrides) +update_forward_refs(HandoffStep, AssistantOverrides=AssistantOverrides) diff --git a/src/vapi/types/assistant_overrides_background_sound.py b/src/vapi/types/assistant_overrides_background_sound.py new file mode 100644 index 0000000..8a4c007 --- /dev/null +++ b/src/vapi/types/assistant_overrides_background_sound.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AssistantOverridesBackgroundSound = typing.Union[typing.Literal["off", "office"], typing.Any] diff --git a/src/vapi/types/assistant_overrides_client_messages_item.py b/src/vapi/types/assistant_overrides_client_messages_item.py new file mode 100644 index 0000000..81a3df5 --- /dev/null +++ b/src/vapi/types/assistant_overrides_client_messages_item.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AssistantOverridesClientMessagesItem = typing.Union[ + typing.Literal[ + "conversation-update", + "function-call", + "function-call-result", + "hang", + "language-changed", + "metadata", + "model-output", + "speech-update", + "status-update", + "transcript", + "tool-calls", + "tool-calls-result", + "user-interrupted", + "voice-input", + ], + typing.Any, +] diff --git a/src/vapi/types/assistant_overrides_first_message_mode.py b/src/vapi/types/assistant_overrides_first_message_mode.py new file mode 100644 index 0000000..c615b35 --- /dev/null +++ b/src/vapi/types/assistant_overrides_first_message_mode.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AssistantOverridesFirstMessageMode = typing.Union[ + typing.Literal[ + "assistant-speaks-first", "assistant-speaks-first-with-model-generated-message", "assistant-waits-for-user" + ], + typing.Any, +] diff --git a/src/vapi/types/assistant_overrides_model.py b/src/vapi/types/assistant_overrides_model.py new file mode 100644 index 0000000..93d1083 --- /dev/null +++ b/src/vapi/types/assistant_overrides_model.py @@ -0,0 +1,359 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +from .anyscale_model_tools_item import AnyscaleModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .anthropic_model_tools_item import AnthropicModelToolsItem +from .anthropic_model_model import AnthropicModelModel +from .custom_llm_model_tools_item import CustomLlmModelToolsItem +from .custom_llm_model_metadata_send_mode import CustomLlmModelMetadataSendMode +from .deep_infra_model_tools_item import DeepInfraModelToolsItem +from .groq_model_tools_item import GroqModelToolsItem +from .groq_model_model import GroqModelModel +from .open_ai_model_tools_item import OpenAiModelToolsItem +from .open_ai_model_model import OpenAiModelModel +from .open_ai_model_fallback_models_item import OpenAiModelFallbackModelsItem +from .open_router_model_tools_item import OpenRouterModelToolsItem +from .perplexity_ai_model_tools_item import PerplexityAiModelToolsItem +from .together_ai_model_tools_item import TogetherAiModelToolsItem +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +from .vapi_model_tools_item import VapiModelToolsItem +from .vapi_model_steps_item import VapiModelStepsItem +from ..core.pydantic_utilities import update_forward_refs + + +class AssistantOverridesModel_Anyscale(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["anyscale"] = "anyscale" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[AnyscaleModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesModel_Anthropic(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["anthropic"] = "anthropic" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[AnthropicModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: AnthropicModelModel + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesModel_CustomLlm(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["custom-llm"] = "custom-llm" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[CustomLlmModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + metadata_send_mode: typing_extensions.Annotated[ + typing.Optional[CustomLlmModelMetadataSendMode], FieldMetadata(alias="metadataSendMode") + ] = None + url: str + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesModel_Deepinfra(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["deepinfra"] = "deepinfra" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[DeepInfraModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesModel_Groq(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["groq"] = "groq" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[GroqModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: GroqModelModel + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesModel_Openai(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["openai"] = "openai" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[OpenAiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: OpenAiModelModel + fallback_models: typing_extensions.Annotated[ + typing.Optional[typing.List[OpenAiModelFallbackModelsItem]], FieldMetadata(alias="fallbackModels") + ] = None + semantic_caching_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="semanticCachingEnabled") + ] = None + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesModel_Openrouter(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["openrouter"] = "openrouter" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[OpenRouterModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesModel_PerplexityAi(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["perplexity-ai"] = "perplexity-ai" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[PerplexityAiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesModel_TogetherAi(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["together-ai"] = "together-ai" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[TogetherAiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesModel_Vapi(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["vapi"] = "vapi" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[VapiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + steps: typing.Optional[typing.List[VapiModelStepsItem]] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +AssistantOverridesModel = typing.Union[ + AssistantOverridesModel_Anyscale, + AssistantOverridesModel_Anthropic, + AssistantOverridesModel_CustomLlm, + AssistantOverridesModel_Deepinfra, + AssistantOverridesModel_Groq, + AssistantOverridesModel_Openai, + AssistantOverridesModel_Openrouter, + AssistantOverridesModel_PerplexityAi, + AssistantOverridesModel_TogetherAi, + AssistantOverridesModel_Vapi, +] +update_forward_refs(CallbackStep, AssistantOverridesModel_Vapi=AssistantOverridesModel_Vapi) +update_forward_refs(CreateWorkflowBlockDto, AssistantOverridesModel_Vapi=AssistantOverridesModel_Vapi) +update_forward_refs(HandoffStep, AssistantOverridesModel_Vapi=AssistantOverridesModel_Vapi) diff --git a/src/vapi/types/assistant_overrides_server_messages_item.py b/src/vapi/types/assistant_overrides_server_messages_item.py new file mode 100644 index 0000000..63dc531 --- /dev/null +++ b/src/vapi/types/assistant_overrides_server_messages_item.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AssistantOverridesServerMessagesItem = typing.Union[ + typing.Literal[ + "conversation-update", + "end-of-call-report", + "function-call", + "hang", + "language-changed", + "model-output", + "phone-call-control", + "speech-update", + "status-update", + "transcript", + "tool-calls", + "transfer-destination-request", + "transfer-update", + "user-interrupted", + "voice-input", + ], + typing.Any, +] diff --git a/src/vapi/types/assistant_overrides_transcriber.py b/src/vapi/types/assistant_overrides_transcriber.py new file mode 100644 index 0000000..98ef0c2 --- /dev/null +++ b/src/vapi/types/assistant_overrides_transcriber.py @@ -0,0 +1,93 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .deepgram_transcriber_model import DeepgramTranscriberModel +from .deepgram_transcriber_language import DeepgramTranscriberLanguage +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .gladia_transcriber_model import GladiaTranscriberModel +from .gladia_transcriber_language_behaviour import GladiaTranscriberLanguageBehaviour +from .gladia_transcriber_language import GladiaTranscriberLanguage +from .talkscriber_transcriber_language import TalkscriberTranscriberLanguage + + +class AssistantOverridesTranscriber_Deepgram(UniversalBaseModel): + """ + These are the options for the assistant's transcriber. + """ + + provider: typing.Literal["deepgram"] = "deepgram" + model: typing.Optional[DeepgramTranscriberModel] = None + language: typing.Optional[DeepgramTranscriberLanguage] = None + smart_format: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="smartFormat")] = None + language_detection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="languageDetectionEnabled") + ] = None + keywords: typing.Optional[typing.List[str]] = None + endpointing: typing.Optional[float] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesTranscriber_Gladia(UniversalBaseModel): + """ + These are the options for the assistant's transcriber. + """ + + provider: typing.Literal["gladia"] = "gladia" + model: typing.Optional[GladiaTranscriberModel] = None + language_behaviour: typing_extensions.Annotated[ + typing.Optional[GladiaTranscriberLanguageBehaviour], FieldMetadata(alias="languageBehaviour") + ] = None + language: typing.Optional[GladiaTranscriberLanguage] = None + transcription_hint: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="transcriptionHint")] = ( + None + ) + prosody: typing.Optional[bool] = None + audio_enhancer: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="audioEnhancer")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesTranscriber_Talkscriber(UniversalBaseModel): + """ + These are the options for the assistant's transcriber. + """ + + provider: typing.Literal["talkscriber"] = "talkscriber" + model: typing.Optional[typing.Literal["whisper"]] = None + language: typing.Optional[TalkscriberTranscriberLanguage] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +AssistantOverridesTranscriber = typing.Union[ + AssistantOverridesTranscriber_Deepgram, + AssistantOverridesTranscriber_Gladia, + AssistantOverridesTranscriber_Talkscriber, +] diff --git a/src/vapi/types/assistant_overrides_voice.py b/src/vapi/types/assistant_overrides_voice.py new file mode 100644 index 0000000..2a6140f --- /dev/null +++ b/src/vapi/types/assistant_overrides_voice.py @@ -0,0 +1,259 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .azure_voice_voice_id import AzureVoiceVoiceId +from .chunk_plan import ChunkPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .cartesia_voice_model import CartesiaVoiceModel +from .cartesia_voice_language import CartesiaVoiceLanguage +from .deepgram_voice_voice_id import DeepgramVoiceVoiceId +from .eleven_labs_voice_voice_id import ElevenLabsVoiceVoiceId +from .eleven_labs_voice_model import ElevenLabsVoiceModel +from .lmnt_voice_voice_id import LmntVoiceVoiceId +from .neets_voice_voice_id import NeetsVoiceVoiceId +from .open_ai_voice_voice_id import OpenAiVoiceVoiceId +from .play_ht_voice_voice_id import PlayHtVoiceVoiceId +from .play_ht_voice_emotion import PlayHtVoiceEmotion +from .rime_ai_voice_voice_id import RimeAiVoiceVoiceId +from .rime_ai_voice_model import RimeAiVoiceModel + + +class AssistantOverridesVoice_Azure(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["azure"] = "azure" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[AzureVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesVoice_Cartesia(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["cartesia"] = "cartesia" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + model: typing.Optional[CartesiaVoiceModel] = None + language: typing.Optional[CartesiaVoiceLanguage] = None + voice_id: typing_extensions.Annotated[str, FieldMetadata(alias="voiceId")] + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesVoice_Deepgram(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["deepgram"] = "deepgram" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[DeepgramVoiceVoiceId, FieldMetadata(alias="voiceId")] + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesVoice_11Labs(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["11labs"] = "11labs" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[ElevenLabsVoiceVoiceId, FieldMetadata(alias="voiceId")] + stability: typing.Optional[float] = None + similarity_boost: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="similarityBoost")] = None + style: typing.Optional[float] = None + use_speaker_boost: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="useSpeakerBoost")] = None + optimize_streaming_latency: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="optimizeStreamingLatency") + ] = None + enable_ssml_parsing: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="enableSsmlParsing") + ] = None + model: typing.Optional[ElevenLabsVoiceModel] = None + language: typing.Optional[str] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesVoice_Lmnt(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["lmnt"] = "lmnt" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[LmntVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesVoice_Neets(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["neets"] = "neets" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[NeetsVoiceVoiceId, FieldMetadata(alias="voiceId")] + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesVoice_Openai(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["openai"] = "openai" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[OpenAiVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesVoice_Playht(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["playht"] = "playht" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[PlayHtVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + temperature: typing.Optional[float] = None + emotion: typing.Optional[PlayHtVoiceEmotion] = None + voice_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="voiceGuidance")] = None + style_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="styleGuidance")] = None + text_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="textGuidance")] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantOverridesVoice_RimeAi(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["rime-ai"] = "rime-ai" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[RimeAiVoiceVoiceId, FieldMetadata(alias="voiceId")] + model: typing.Optional[RimeAiVoiceModel] = None + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +AssistantOverridesVoice = typing.Union[ + AssistantOverridesVoice_Azure, + AssistantOverridesVoice_Cartesia, + AssistantOverridesVoice_Deepgram, + AssistantOverridesVoice_11Labs, + AssistantOverridesVoice_Lmnt, + AssistantOverridesVoice_Neets, + AssistantOverridesVoice_Openai, + AssistantOverridesVoice_Playht, + AssistantOverridesVoice_RimeAi, +] diff --git a/src/vapi/types/assistant_server_messages_item.py b/src/vapi/types/assistant_server_messages_item.py new file mode 100644 index 0000000..94e5545 --- /dev/null +++ b/src/vapi/types/assistant_server_messages_item.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AssistantServerMessagesItem = typing.Union[ + typing.Literal[ + "conversation-update", + "end-of-call-report", + "function-call", + "hang", + "language-changed", + "model-output", + "phone-call-control", + "speech-update", + "status-update", + "transcript", + "tool-calls", + "transfer-destination-request", + "transfer-update", + "user-interrupted", + "voice-input", + ], + typing.Any, +] diff --git a/src/vapi/types/assistant_transcriber.py b/src/vapi/types/assistant_transcriber.py new file mode 100644 index 0000000..fdd6162 --- /dev/null +++ b/src/vapi/types/assistant_transcriber.py @@ -0,0 +1,91 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .deepgram_transcriber_model import DeepgramTranscriberModel +from .deepgram_transcriber_language import DeepgramTranscriberLanguage +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .gladia_transcriber_model import GladiaTranscriberModel +from .gladia_transcriber_language_behaviour import GladiaTranscriberLanguageBehaviour +from .gladia_transcriber_language import GladiaTranscriberLanguage +from .talkscriber_transcriber_language import TalkscriberTranscriberLanguage + + +class AssistantTranscriber_Deepgram(UniversalBaseModel): + """ + These are the options for the assistant's transcriber. + """ + + provider: typing.Literal["deepgram"] = "deepgram" + model: typing.Optional[DeepgramTranscriberModel] = None + language: typing.Optional[DeepgramTranscriberLanguage] = None + smart_format: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="smartFormat")] = None + language_detection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="languageDetectionEnabled") + ] = None + keywords: typing.Optional[typing.List[str]] = None + endpointing: typing.Optional[float] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantTranscriber_Gladia(UniversalBaseModel): + """ + These are the options for the assistant's transcriber. + """ + + provider: typing.Literal["gladia"] = "gladia" + model: typing.Optional[GladiaTranscriberModel] = None + language_behaviour: typing_extensions.Annotated[ + typing.Optional[GladiaTranscriberLanguageBehaviour], FieldMetadata(alias="languageBehaviour") + ] = None + language: typing.Optional[GladiaTranscriberLanguage] = None + transcription_hint: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="transcriptionHint")] = ( + None + ) + prosody: typing.Optional[bool] = None + audio_enhancer: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="audioEnhancer")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantTranscriber_Talkscriber(UniversalBaseModel): + """ + These are the options for the assistant's transcriber. + """ + + provider: typing.Literal["talkscriber"] = "talkscriber" + model: typing.Optional[typing.Literal["whisper"]] = None + language: typing.Optional[TalkscriberTranscriberLanguage] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +AssistantTranscriber = typing.Union[ + AssistantTranscriber_Deepgram, AssistantTranscriber_Gladia, AssistantTranscriber_Talkscriber +] diff --git a/src/vapi/types/assistant_voice.py b/src/vapi/types/assistant_voice.py new file mode 100644 index 0000000..46da7e5 --- /dev/null +++ b/src/vapi/types/assistant_voice.py @@ -0,0 +1,259 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .azure_voice_voice_id import AzureVoiceVoiceId +from .chunk_plan import ChunkPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .cartesia_voice_model import CartesiaVoiceModel +from .cartesia_voice_language import CartesiaVoiceLanguage +from .deepgram_voice_voice_id import DeepgramVoiceVoiceId +from .eleven_labs_voice_voice_id import ElevenLabsVoiceVoiceId +from .eleven_labs_voice_model import ElevenLabsVoiceModel +from .lmnt_voice_voice_id import LmntVoiceVoiceId +from .neets_voice_voice_id import NeetsVoiceVoiceId +from .open_ai_voice_voice_id import OpenAiVoiceVoiceId +from .play_ht_voice_voice_id import PlayHtVoiceVoiceId +from .play_ht_voice_emotion import PlayHtVoiceEmotion +from .rime_ai_voice_voice_id import RimeAiVoiceVoiceId +from .rime_ai_voice_model import RimeAiVoiceModel + + +class AssistantVoice_Azure(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["azure"] = "azure" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[AzureVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantVoice_Cartesia(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["cartesia"] = "cartesia" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + model: typing.Optional[CartesiaVoiceModel] = None + language: typing.Optional[CartesiaVoiceLanguage] = None + voice_id: typing_extensions.Annotated[str, FieldMetadata(alias="voiceId")] + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantVoice_Deepgram(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["deepgram"] = "deepgram" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[DeepgramVoiceVoiceId, FieldMetadata(alias="voiceId")] + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantVoice_11Labs(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["11labs"] = "11labs" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[ElevenLabsVoiceVoiceId, FieldMetadata(alias="voiceId")] + stability: typing.Optional[float] = None + similarity_boost: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="similarityBoost")] = None + style: typing.Optional[float] = None + use_speaker_boost: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="useSpeakerBoost")] = None + optimize_streaming_latency: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="optimizeStreamingLatency") + ] = None + enable_ssml_parsing: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="enableSsmlParsing") + ] = None + model: typing.Optional[ElevenLabsVoiceModel] = None + language: typing.Optional[str] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantVoice_Lmnt(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["lmnt"] = "lmnt" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[LmntVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantVoice_Neets(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["neets"] = "neets" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[NeetsVoiceVoiceId, FieldMetadata(alias="voiceId")] + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantVoice_Openai(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["openai"] = "openai" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[OpenAiVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantVoice_Playht(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["playht"] = "playht" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[PlayHtVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + temperature: typing.Optional[float] = None + emotion: typing.Optional[PlayHtVoiceEmotion] = None + voice_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="voiceGuidance")] = None + style_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="styleGuidance")] = None + text_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="textGuidance")] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AssistantVoice_RimeAi(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["rime-ai"] = "rime-ai" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[RimeAiVoiceVoiceId, FieldMetadata(alias="voiceId")] + model: typing.Optional[RimeAiVoiceModel] = None + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +AssistantVoice = typing.Union[ + AssistantVoice_Azure, + AssistantVoice_Cartesia, + AssistantVoice_Deepgram, + AssistantVoice_11Labs, + AssistantVoice_Lmnt, + AssistantVoice_Neets, + AssistantVoice_Openai, + AssistantVoice_Playht, + AssistantVoice_RimeAi, +] diff --git a/src/vapi/types/azure_open_ai_credential.py b/src/vapi/types/azure_open_ai_credential.py new file mode 100644 index 0000000..86a52b5 --- /dev/null +++ b/src/vapi/types/azure_open_ai_credential.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .azure_open_ai_credential_region import AzureOpenAiCredentialRegion +from .azure_open_ai_credential_models_item import AzureOpenAiCredentialModelsItem +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AzureOpenAiCredential(UniversalBaseModel): + provider: typing.Literal["azure-openai"] = "azure-openai" + region: AzureOpenAiCredentialRegion + models: typing.List[AzureOpenAiCredentialModelsItem] + open_ai_key: typing_extensions.Annotated[str, FieldMetadata(alias="openAIKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + open_ai_endpoint: typing_extensions.Annotated[str, FieldMetadata(alias="openAIEndpoint")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/azure_open_ai_credential_models_item.py b/src/vapi/types/azure_open_ai_credential_models_item.py new file mode 100644 index 0000000..bd6cf9d --- /dev/null +++ b/src/vapi/types/azure_open_ai_credential_models_item.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AzureOpenAiCredentialModelsItem = typing.Union[ + typing.Literal[ + "gpt-4o-mini-2024-07-18", + "gpt-4o-2024-05-13", + "gpt-4-turbo-2024-04-09", + "gpt-4-0125-preview", + "gpt-4-1106-preview", + "gpt-4-0613", + "gpt-35-turbo-0125", + "gpt-35-turbo-1106", + ], + typing.Any, +] diff --git a/src/vapi/types/azure_open_ai_credential_region.py b/src/vapi/types/azure_open_ai_credential_region.py new file mode 100644 index 0000000..a82558e --- /dev/null +++ b/src/vapi/types/azure_open_ai_credential_region.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AzureOpenAiCredentialRegion = typing.Union[ + typing.Literal[ + "australia", + "canada", + "eastus2", + "eastus", + "france", + "india", + "japan", + "northcentralus", + "norway", + "southcentralus", + "sweden", + "switzerland", + "uk", + "westus", + "westus3", + ], + typing.Any, +] diff --git a/src/vapi/types/azure_voice.py b/src/vapi/types/azure_voice.py new file mode 100644 index 0000000..9aeb5af --- /dev/null +++ b/src/vapi/types/azure_voice.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .azure_voice_voice_id import AzureVoiceVoiceId +from .chunk_plan import ChunkPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AzureVoice(UniversalBaseModel): + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether fillers are injected into the model output before inputting it into the voice provider. + + Default `false` because you can achieve better results with prompting the model. + """ + + voice_id: typing_extensions.Annotated[AzureVoiceVoiceId, FieldMetadata(alias="voiceId")] = pydantic.Field() + """ + This is the provider-specific ID that will be used. + """ + + speed: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the speed multiplier that will be used. + """ + + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for chunking the model output before it is sent to the voice provider. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/azure_voice_voice_id.py b/src/vapi/types/azure_voice_voice_id.py new file mode 100644 index 0000000..f08f3bb --- /dev/null +++ b/src/vapi/types/azure_voice_voice_id.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AzureVoiceVoiceId = typing.Union[typing.Literal["andrew"], typing.Literal["brian"], typing.Literal["emma"], str] diff --git a/src/vapi/types/block_complete_message.py b/src/vapi/types/block_complete_message.py new file mode 100644 index 0000000..e0d5e02 --- /dev/null +++ b/src/vapi/types/block_complete_message.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .block_complete_message_conditions_item import BlockCompleteMessageConditionsItem +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class BlockCompleteMessage(UniversalBaseModel): + conditions: typing.Optional[typing.List[BlockCompleteMessageConditionsItem]] = pydantic.Field(default=None) + """ + This is an optional array of conditions that must be met for this message to be triggered. + """ + + content: str = pydantic.Field() + """ + This is the content that the assistant will say when this message is triggered. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/block_complete_message_conditions_item.py b/src/vapi/types/block_complete_message_conditions_item.py new file mode 100644 index 0000000..a86b679 --- /dev/null +++ b/src/vapi/types/block_complete_message_conditions_item.py @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .rule_based_condition_operator import RuleBasedConditionOperator +import typing_extensions +from ..core.serialization import FieldMetadata + + +class BlockCompleteMessageConditionsItem_ModelBased(UniversalBaseModel): + type: typing.Literal["model-based"] = "model-based" + instruction: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlockCompleteMessageConditionsItem_RuleBased(UniversalBaseModel): + type: typing.Literal["rule-based"] = "rule-based" + operator: RuleBasedConditionOperator + left_side: typing_extensions.Annotated[str, FieldMetadata(alias="leftSide")] + right_side: typing_extensions.Annotated[str, FieldMetadata(alias="rightSide")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +BlockCompleteMessageConditionsItem = typing.Union[ + BlockCompleteMessageConditionsItem_ModelBased, BlockCompleteMessageConditionsItem_RuleBased +] diff --git a/src/vapi/types/block_start_message.py b/src/vapi/types/block_start_message.py new file mode 100644 index 0000000..4c3bc0e --- /dev/null +++ b/src/vapi/types/block_start_message.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .block_start_message_conditions_item import BlockStartMessageConditionsItem +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class BlockStartMessage(UniversalBaseModel): + conditions: typing.Optional[typing.List[BlockStartMessageConditionsItem]] = pydantic.Field(default=None) + """ + This is an optional array of conditions that must be met for this message to be triggered. + """ + + content: str = pydantic.Field() + """ + This is the content that the assistant will say when this message is triggered. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/block_start_message_conditions_item.py b/src/vapi/types/block_start_message_conditions_item.py new file mode 100644 index 0000000..01b7a76 --- /dev/null +++ b/src/vapi/types/block_start_message_conditions_item.py @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .rule_based_condition_operator import RuleBasedConditionOperator +import typing_extensions +from ..core.serialization import FieldMetadata + + +class BlockStartMessageConditionsItem_ModelBased(UniversalBaseModel): + type: typing.Literal["model-based"] = "model-based" + instruction: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BlockStartMessageConditionsItem_RuleBased(UniversalBaseModel): + type: typing.Literal["rule-based"] = "rule-based" + operator: RuleBasedConditionOperator + left_side: typing_extensions.Annotated[str, FieldMetadata(alias="leftSide")] + right_side: typing_extensions.Annotated[str, FieldMetadata(alias="rightSide")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +BlockStartMessageConditionsItem = typing.Union[ + BlockStartMessageConditionsItem_ModelBased, BlockStartMessageConditionsItem_RuleBased +] diff --git a/src/vapi/types/bot_message.py b/src/vapi/types/bot_message.py new file mode 100644 index 0000000..0d862aa --- /dev/null +++ b/src/vapi/types/bot_message.py @@ -0,0 +1,54 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class BotMessage(UniversalBaseModel): + role: str = pydantic.Field() + """ + The role of the bot in the conversation. + """ + + message: str = pydantic.Field() + """ + The message content from the bot. + """ + + time: float = pydantic.Field() + """ + The timestamp when the message was sent. + """ + + end_time: typing_extensions.Annotated[float, FieldMetadata(alias="endTime")] = pydantic.Field() + """ + The timestamp when the message ended. + """ + + seconds_from_start: typing_extensions.Annotated[float, FieldMetadata(alias="secondsFromStart")] = pydantic.Field() + """ + The number of seconds from the start of the conversation. + """ + + source: typing.Optional[str] = pydantic.Field(default=None) + """ + The source of the message. + """ + + duration: typing.Optional[float] = pydantic.Field(default=None) + """ + The duration of the message in seconds. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/bucket_plan.py b/src/vapi/types/bucket_plan.py new file mode 100644 index 0000000..cb1820f --- /dev/null +++ b/src/vapi/types/bucket_plan.py @@ -0,0 +1,72 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class BucketPlan(UniversalBaseModel): + name: str = pydantic.Field() + """ + This is the name of the bucket. + """ + + region: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the region of the bucket. + + Usage: + + - If `credential.type` is `aws`, then this is required. + - If `credential.type` is `gcp`, then this is optional since GCP allows buckets to be accessed without a region but region is required for data residency requirements. Read here: https://cloud.google.com/storage/docs/request-endpoints + """ + + path: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the path where call artifacts will be stored. + + Usage: + + - To store call artifacts in a specific folder, set this to the full path. Eg. "/folder-name1/folder-name2". + - To store call artifacts in the root of the bucket, leave this blank. + + @default "/" + """ + + hmac_access_key: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="hmacAccessKey")] = ( + pydantic.Field(default=None) + ) + """ + This is the HMAC access key offered by GCP for interoperability with S3 clients. Here is the guide on how to create: https://cloud.google.com/storage/docs/authentication/managing-hmackeys#console + + Usage: + + - If `credential.type` is `gcp`, then this is required. + - If `credential.type` is `aws`, then this is not required since credential.awsAccessKeyId is used instead. + """ + + hmac_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="hmacSecret")] = pydantic.Field( + default=None + ) + """ + This is the secret for the HMAC access key. Here is the guide on how to create: https://cloud.google.com/storage/docs/authentication/managing-hmackeys#console + + Usage: + + - If `credential.type` is `gcp`, then this is required. + - If `credential.type` is `aws`, then this is not required since credential.awsSecretAccessKey is used instead. + + Note: This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/buy_phone_number_dto.py b/src/vapi/types/buy_phone_number_dto.py new file mode 100644 index 0000000..a9dd764 --- /dev/null +++ b/src/vapi/types/buy_phone_number_dto.py @@ -0,0 +1,81 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .buy_phone_number_dto_fallback_destination import BuyPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class BuyPhoneNumberDto(UniversalBaseModel): + fallback_destination: typing_extensions.Annotated[ + typing.Optional[BuyPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = pydantic.Field(default=None) + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + area_code: typing_extensions.Annotated[str, FieldMetadata(alias="areaCode")] = pydantic.Field() + """ + This is the area code of the phone number to purchase. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the phone number. This is just for your own reference. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/buy_phone_number_dto_fallback_destination.py b/src/vapi/types/buy_phone_number_dto_fallback_destination.py new file mode 100644 index 0000000..1113c07 --- /dev/null +++ b/src/vapi/types/buy_phone_number_dto_fallback_destination.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class BuyPhoneNumberDtoFallbackDestination_Number(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class BuyPhoneNumberDtoFallbackDestination_Sip(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +BuyPhoneNumberDtoFallbackDestination = typing.Union[ + BuyPhoneNumberDtoFallbackDestination_Number, BuyPhoneNumberDtoFallbackDestination_Sip +] diff --git a/src/vapi/types/byo_phone_number.py b/src/vapi/types/byo_phone_number.py new file mode 100644 index 0000000..b6d3452 --- /dev/null +++ b/src/vapi/types/byo_phone_number.py @@ -0,0 +1,125 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .byo_phone_number_fallback_destination import ByoPhoneNumberFallbackDestination +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ByoPhoneNumber(UniversalBaseModel): + fallback_destination: typing_extensions.Annotated[ + typing.Optional[ByoPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = pydantic.Field(default=None) + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = pydantic.Field(default=None) + """ + This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it. + + Use cases: + + - `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks. + - `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls. + + If `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\+?[a-zA-Z0-9]+$/`). + + @default true (E164 check is enabled) + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the phone number. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this phone number belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the phone number was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the phone number was last updated. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the phone number. This is just for your own reference. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + number: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the number of the customer. + """ + + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] = pydantic.Field() + """ + This is the credential of your own SIP trunk or Carrier (type `byo-sip-trunk`) which can be used to make calls to this phone number. + + You can add the SIP trunk or Carrier credential in the Provider Credentials page on the Dashboard to get the credentialId. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/byo_phone_number_fallback_destination.py b/src/vapi/types/byo_phone_number_fallback_destination.py new file mode 100644 index 0000000..b0daf51 --- /dev/null +++ b/src/vapi/types/byo_phone_number_fallback_destination.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ByoPhoneNumberFallbackDestination_Number(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ByoPhoneNumberFallbackDestination_Sip(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ByoPhoneNumberFallbackDestination = typing.Union[ + ByoPhoneNumberFallbackDestination_Number, ByoPhoneNumberFallbackDestination_Sip +] diff --git a/src/vapi/types/byo_sip_trunk_credential.py b/src/vapi/types/byo_sip_trunk_credential.py new file mode 100644 index 0000000..29bd130 --- /dev/null +++ b/src/vapi/types/byo_sip_trunk_credential.py @@ -0,0 +1,85 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +import datetime as dt +from .sip_trunk_gateway import SipTrunkGateway +from .sip_trunk_outbound_authentication_plan import SipTrunkOutboundAuthenticationPlan +from .sbc_configuration import SbcConfiguration +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ByoSipTrunkCredential(UniversalBaseModel): + provider: typing.Optional[typing.Literal["byo-sip-trunk"]] = pydantic.Field(default=None) + """ + This can be used to bring your own SIP trunks or to connect to a Carrier. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + gateways: typing.List[SipTrunkGateway] = pydantic.Field() + """ + This is the list of SIP trunk's gateways. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the SIP trunk. This is just for your reference. + """ + + outbound_authentication_plan: typing_extensions.Annotated[ + typing.Optional[SipTrunkOutboundAuthenticationPlan], FieldMetadata(alias="outboundAuthenticationPlan") + ] = pydantic.Field(default=None) + """ + This can be used to configure the outbound authentication if required by the SIP trunk. + """ + + outbound_leading_plus_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="outboundLeadingPlusEnabled") + ] = pydantic.Field(default=None) + """ + This ensures the outbound origination attempts have a leading plus. Defaults to false to match conventional telecom behavior. + + Usage: + + - Vonage/Twilio requires leading plus for all outbound calls. Set this to true. + + @default false + """ + + sbc_configuration: typing_extensions.Annotated[ + typing.Optional[SbcConfiguration], FieldMetadata(alias="sbcConfiguration") + ] = pydantic.Field(default=None) + """ + This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk's `gateways`, rather than the managed SBC provided by Vapi. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/call.py b/src/vapi/types/call.py new file mode 100644 index 0000000..47582e5 --- /dev/null +++ b/src/vapi/types/call.py @@ -0,0 +1,241 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing +from .call_type import CallType +import pydantic +from .call_costs_item import CallCostsItem +from .call_messages_item import CallMessagesItem +import typing_extensions +from .call_phone_call_provider import CallPhoneCallProvider +from ..core.serialization import FieldMetadata +from .call_phone_call_transport import CallPhoneCallTransport +from .call_status import CallStatus +from .call_ended_reason import CallEndedReason +from .call_destination import CallDestination +import datetime as dt +from .cost_breakdown import CostBreakdown +from .artifact_plan import ArtifactPlan +from .analysis import Analysis +from .monitor import Monitor +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .assistant_overrides import AssistantOverrides +from .create_squad_dto import CreateSquadDto +from .import_twilio_phone_number_dto import ImportTwilioPhoneNumberDto +from .create_customer_dto import CreateCustomerDto +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class Call(UniversalBaseModel): + type: typing.Optional[CallType] = pydantic.Field(default=None) + """ + This is the type of call. + """ + + costs: typing.Optional[typing.List[CallCostsItem]] = pydantic.Field(default=None) + """ + These are the costs of individual components of the call in USD. + """ + + messages: typing.Optional[typing.List[CallMessagesItem]] = None + phone_call_provider: typing_extensions.Annotated[ + typing.Optional[CallPhoneCallProvider], FieldMetadata(alias="phoneCallProvider") + ] = pydantic.Field(default=None) + """ + This is the provider of the call. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + """ + + phone_call_transport: typing_extensions.Annotated[ + typing.Optional[CallPhoneCallTransport], FieldMetadata(alias="phoneCallTransport") + ] = pydantic.Field(default=None) + """ + This is the transport of the phone call. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + """ + + status: typing.Optional[CallStatus] = pydantic.Field(default=None) + """ + This is the status of the call. + """ + + ended_reason: typing_extensions.Annotated[typing.Optional[CallEndedReason], FieldMetadata(alias="endedReason")] = ( + pydantic.Field(default=None) + ) + """ + This is the explanation for how the call ended. + """ + + destination: typing.Optional[CallDestination] = pydantic.Field(default=None) + """ + This is the destination where the call ended up being transferred to. If the call was not transferred, this will be empty. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the call. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this call belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the call was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the call was last updated. + """ + + started_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="startedAt")] = ( + pydantic.Field(default=None) + ) + """ + This is the ISO 8601 date-time string of when the call was started. + """ + + ended_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="endedAt")] = ( + pydantic.Field(default=None) + ) + """ + This is the ISO 8601 date-time string of when the call was ended. + """ + + cost: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the cost of the call in USD. + """ + + cost_breakdown: typing_extensions.Annotated[ + typing.Optional[CostBreakdown], FieldMetadata(alias="costBreakdown") + ] = pydantic.Field(default=None) + """ + This is the cost of the call in USD. + """ + + artifact_plan: typing_extensions.Annotated[typing.Optional[ArtifactPlan], FieldMetadata(alias="artifactPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is a copy of assistant artifact plan. This isn't actually stored on the call but rather just returned in POST /call/web to enable artifact creation client side. + """ + + analysis: typing.Optional[Analysis] = pydantic.Field(default=None) + """ + This is the analysis of the call. Configure in `assistant.analysisPlan`. + """ + + monitor: typing.Optional[Monitor] = pydantic.Field(default=None) + """ + This is to real-time monitor the call. Configure in `assistant.monitorPlan`. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + These are the artifacts created from the call. Configure in `assistant.artifactPlan`. + """ + + phone_call_provider_id: typing_extensions.Annotated[ + typing.Optional[str], FieldMetadata(alias="phoneCallProviderId") + ] = pydantic.Field(default=None) + """ + The ID of the call as provided by the phone number service. callSid in Twilio. conversationUuid in Vonage. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. + """ + + assistant_overrides: typing_extensions.Annotated[ + typing.Optional[AssistantOverrides], FieldMetadata(alias="assistantOverrides") + ] = pydantic.Field(default=None) + """ + These are the overrides for the `assistant` or `assistantId`'s settings and template variables. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + """ + + squad: typing.Optional[CreateSquadDto] = pydantic.Field(default=None) + """ + This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + """ + + phone_number_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="phoneNumberId")] = ( + pydantic.Field(default=None) + ) + """ + This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + """ + + phone_number: typing_extensions.Annotated[ + typing.Optional[ImportTwilioPhoneNumberDto], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + """ + + customer_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customerId")] = pydantic.Field( + default=None + ) + """ + This is the customer that will be called. To call a transient customer , use `customer` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer that will be called. To call an existing customer, use `customerId` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the call. This is just for your own reference. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, Call=Call) +update_forward_refs(CreateWorkflowBlockDto, Call=Call) +update_forward_refs(HandoffStep, Call=Call) diff --git a/src/vapi/types/call_costs_item.py b/src/vapi/types/call_costs_item.py new file mode 100644 index 0000000..6980336 --- /dev/null +++ b/src/vapi/types/call_costs_item.py @@ -0,0 +1,117 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from .analysis_cost_analysis_type import AnalysisCostAnalysisType + + +class CallCostsItem_Transport(UniversalBaseModel): + type: typing.Literal["transport"] = "transport" + minutes: float + cost: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CallCostsItem_Transcriber(UniversalBaseModel): + type: typing.Literal["transcriber"] = "transcriber" + transcriber: typing.Dict[str, typing.Optional[typing.Any]] + minutes: float + cost: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CallCostsItem_Model(UniversalBaseModel): + type: typing.Literal["model"] = "model" + model: typing.Dict[str, typing.Optional[typing.Any]] + prompt_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="promptTokens")] + completion_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="completionTokens")] + cost: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CallCostsItem_Voice(UniversalBaseModel): + type: typing.Literal["voice"] = "voice" + voice: typing.Dict[str, typing.Optional[typing.Any]] + characters: float + cost: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CallCostsItem_Vapi(UniversalBaseModel): + type: typing.Literal["vapi"] = "vapi" + minutes: float + cost: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CallCostsItem_Analysis(UniversalBaseModel): + type: typing.Literal["analysis"] = "analysis" + analysis_type: typing_extensions.Annotated[AnalysisCostAnalysisType, FieldMetadata(alias="analysisType")] + model: typing.Dict[str, typing.Optional[typing.Any]] + prompt_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="promptTokens")] + completion_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="completionTokens")] + cost: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CallCostsItem = typing.Union[ + CallCostsItem_Transport, + CallCostsItem_Transcriber, + CallCostsItem_Model, + CallCostsItem_Voice, + CallCostsItem_Vapi, + CallCostsItem_Analysis, +] diff --git a/src/vapi/types/call_destination.py b/src/vapi/types/call_destination.py new file mode 100644 index 0000000..342ed09 --- /dev/null +++ b/src/vapi/types/call_destination.py @@ -0,0 +1,57 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class CallDestination_Number(UniversalBaseModel): + """ + This is the destination where the call ended up being transferred to. If the call was not transferred, this will be empty. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CallDestination_Sip(UniversalBaseModel): + """ + This is the destination where the call ended up being transferred to. If the call was not transferred, this will be empty. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CallDestination = typing.Union[CallDestination_Number, CallDestination_Sip] diff --git a/src/vapi/types/call_ended_reason.py b/src/vapi/types/call_ended_reason.py new file mode 100644 index 0000000..eb300f3 --- /dev/null +++ b/src/vapi/types/call_ended_reason.py @@ -0,0 +1,177 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CallEndedReason = typing.Union[ + typing.Literal[ + "assistant-error", + "assistant-not-found", + "db-error", + "no-server-available", + "license-check-failed", + "pipeline-error-openai-llm-failed", + "pipeline-error-azure-openai-llm-failed", + "pipeline-error-groq-llm-failed", + "pipeline-error-anthropic-llm-failed", + "pipeline-error-vapi-llm-failed", + "pipeline-error-vapi-400-bad-request-validation-failed", + "pipeline-error-vapi-401-unauthorized", + "pipeline-error-vapi-403-model-access-denied", + "pipeline-error-vapi-429-exceeded-quota", + "pipeline-error-vapi-500-server-error", + "pipeline-error-openai-voice-failed", + "pipeline-error-cartesia-voice-failed", + "pipeline-error-deepgram-transcriber-failed", + "pipeline-error-deepgram-voice-failed", + "pipeline-error-gladia-transcriber-failed", + "pipeline-error-eleven-labs-voice-failed", + "pipeline-error-playht-voice-failed", + "pipeline-error-lmnt-voice-failed", + "pipeline-error-azure-voice-failed", + "pipeline-error-rime-ai-voice-failed", + "pipeline-error-neets-voice-failed", + "pipeline-no-available-model", + "worker-shutdown", + "unknown-error", + "vonage-disconnected", + "vonage-failed-to-connect-call", + "phone-call-provider-bypass-enabled-but-no-call-received", + "vapifault-phone-call-worker-setup-socket-error", + "vapifault-phone-call-worker-worker-setup-socket-timeout", + "vapifault-phone-call-worker-could-not-find-call", + "vapifault-transport-never-connected", + "vapifault-web-call-worker-setup-failed", + "vapifault-transport-connected-but-call-not-active", + "assistant-not-invalid", + "assistant-not-provided", + "call-start-error-neither-assistant-nor-server-set", + "assistant-request-failed", + "assistant-request-returned-error", + "assistant-request-returned-unspeakable-error", + "assistant-request-returned-invalid-assistant", + "assistant-request-returned-no-assistant", + "assistant-request-returned-forwarding-phone-number", + "assistant-ended-call", + "assistant-said-end-call-phrase", + "assistant-forwarded-call", + "assistant-join-timed-out", + "customer-busy", + "customer-ended-call", + "customer-did-not-answer", + "customer-did-not-give-microphone-permission", + "assistant-said-message-with-end-call-enabled", + "exceeded-max-duration", + "manually-canceled", + "phone-call-provider-closed-websocket", + "pipeline-error-openai-400-bad-request-validation-failed", + "pipeline-error-openai-401-unauthorized", + "pipeline-error-openai-403-model-access-denied", + "pipeline-error-openai-429-exceeded-quota", + "pipeline-error-openai-500-server-error", + "pipeline-error-azure-openai-400-bad-request-validation-failed", + "pipeline-error-azure-openai-401-unauthorized", + "pipeline-error-azure-openai-403-model-access-denied", + "pipeline-error-azure-openai-429-exceeded-quota", + "pipeline-error-azure-openai-500-server-error", + "pipeline-error-groq-400-bad-request-validation-failed", + "pipeline-error-groq-401-unauthorized", + "pipeline-error-groq-403-model-access-denied", + "pipeline-error-groq-429-exceeded-quota", + "pipeline-error-groq-500-server-error", + "pipeline-error-anthropic-400-bad-request-validation-failed", + "pipeline-error-anthropic-401-unauthorized", + "pipeline-error-anthropic-403-model-access-denied", + "pipeline-error-anthropic-429-exceeded-quota", + "pipeline-error-anthropic-500-server-error", + "pipeline-error-together-ai-400-bad-request-validation-failed", + "pipeline-error-together-ai-401-unauthorized", + "pipeline-error-together-ai-403-model-access-denied", + "pipeline-error-together-ai-429-exceeded-quota", + "pipeline-error-together-ai-500-server-error", + "pipeline-error-together-ai-llm-failed", + "pipeline-error-anyscale-400-bad-request-validation-failed", + "pipeline-error-anyscale-401-unauthorized", + "pipeline-error-anyscale-403-model-access-denied", + "pipeline-error-anyscale-429-exceeded-quota", + "pipeline-error-anyscale-500-server-error", + "pipeline-error-anyscale-llm-failed", + "pipeline-error-openrouter-400-bad-request-validation-failed", + "pipeline-error-openrouter-401-unauthorized", + "pipeline-error-openrouter-403-model-access-denied", + "pipeline-error-openrouter-429-exceeded-quota", + "pipeline-error-openrouter-500-server-error", + "pipeline-error-openrouter-llm-failed", + "pipeline-error-perplexity-ai-400-bad-request-validation-failed", + "pipeline-error-perplexity-ai-401-unauthorized", + "pipeline-error-perplexity-ai-403-model-access-denied", + "pipeline-error-perplexity-ai-429-exceeded-quota", + "pipeline-error-perplexity-ai-500-server-error", + "pipeline-error-perplexity-ai-llm-failed", + "pipeline-error-deepinfra-400-bad-request-validation-failed", + "pipeline-error-deepinfra-401-unauthorized", + "pipeline-error-deepinfra-403-model-access-denied", + "pipeline-error-deepinfra-429-exceeded-quota", + "pipeline-error-deepinfra-500-server-error", + "pipeline-error-deepinfra-llm-failed", + "pipeline-error-runpod-400-bad-request-validation-failed", + "pipeline-error-runpod-401-unauthorized", + "pipeline-error-runpod-403-model-access-denied", + "pipeline-error-runpod-429-exceeded-quota", + "pipeline-error-runpod-500-server-error", + "pipeline-error-runpod-llm-failed", + "pipeline-error-custom-llm-400-bad-request-validation-failed", + "pipeline-error-custom-llm-401-unauthorized", + "pipeline-error-custom-llm-403-model-access-denied", + "pipeline-error-custom-llm-429-exceeded-quota", + "pipeline-error-custom-llm-500-server-error", + "pipeline-error-custom-llm-llm-failed", + "pipeline-error-cartesia-socket-hang-up", + "pipeline-error-cartesia-requested-payment", + "pipeline-error-cartesia-500-server-error", + "pipeline-error-cartesia-503-server-error", + "pipeline-error-cartesia-522-server-error", + "pipeline-error-custom-voice-failed", + "pipeline-error-eleven-labs-voice-not-found", + "pipeline-error-eleven-labs-quota-exceeded", + "pipeline-error-eleven-labs-unauthorized-access", + "pipeline-error-eleven-labs-unauthorized-to-access-model", + "pipeline-error-eleven-labs-professional-voices-only-for-creator-plus", + "pipeline-error-eleven-labs-blocked-free-plan-and-requested-upgrade", + "pipeline-error-eleven-labs-blocked-concurrent-requests-and-requested-upgrade", + "pipeline-error-eleven-labs-blocked-using-instant-voice-clone-and-requested-upgrade", + "pipeline-error-eleven-labs-system-busy-and-requested-upgrade", + "pipeline-error-eleven-labs-voice-not-fine-tuned", + "pipeline-error-eleven-labs-invalid-api-key", + "pipeline-error-eleven-labs-invalid-voice-samples", + "pipeline-error-eleven-labs-voice-disabled-by-owner", + "pipeline-error-eleven-labs-blocked-account-in-probation", + "pipeline-error-eleven-labs-blocked-content-against-their-policy", + "pipeline-error-eleven-labs-missing-samples-for-voice-clone", + "pipeline-error-eleven-labs-voice-not-fine-tuned-and-cannot-be-used", + "pipeline-error-eleven-labs-voice-not-allowed-for-free-users", + "pipeline-error-eleven-labs-500-server-error", + "pipeline-error-eleven-labs-max-character-limit-exceeded", + "pipeline-error-playht-request-timed-out", + "pipeline-error-playht-invalid-voice", + "pipeline-error-playht-unexpected-error", + "pipeline-error-playht-out-of-credits", + "pipeline-error-playht-voice-must-be-a-valid-voice-manifest-uri", + "pipeline-error-playht-401-unauthorized", + "pipeline-error-playht-403-forbidden-out-of-characters", + "pipeline-error-playht-403-forbidden-api-access-not-available", + "pipeline-error-playht-429-exceeded-quota", + "pipeline-error-playht-502-gateway-error", + "pipeline-error-playht-504-gateway-error", + "pipeline-error-deepgram-403-model-access-denied", + "pipeline-error-deepgram-404-not-found", + "pipeline-error-deepgram-400-no-such-model-language-tier-combination", + "pipeline-error-deepgram-500-returning-invalid-json", + "sip-gateway-failed-to-connect-call", + "silence-timed-out", + "twilio-failed-to-connect-call", + "twilio-reported-customer-misdialed", + "voicemail", + "vonage-rejected", + ], + typing.Any, +] diff --git a/src/vapi/types/call_messages_item.py b/src/vapi/types/call_messages_item.py new file mode 100644 index 0000000..b4a7f01 --- /dev/null +++ b/src/vapi/types/call_messages_item.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from .user_message import UserMessage +from .system_message import SystemMessage +from .bot_message import BotMessage +from .tool_call_message import ToolCallMessage +from .tool_call_result_message import ToolCallResultMessage + +CallMessagesItem = typing.Union[UserMessage, SystemMessage, BotMessage, ToolCallMessage, ToolCallResultMessage] diff --git a/src/vapi/types/call_paginated_response.py b/src/vapi/types/call_paginated_response.py new file mode 100644 index 0000000..18b8804 --- /dev/null +++ b/src/vapi/types/call_paginated_response.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing +from .call import Call +from .pagination_meta import PaginationMeta +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ..core.pydantic_utilities import update_forward_refs + + +class CallPaginatedResponse(UniversalBaseModel): + results: typing.List[Call] + metadata: PaginationMeta + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, CallPaginatedResponse=CallPaginatedResponse) +update_forward_refs(CreateWorkflowBlockDto, CallPaginatedResponse=CallPaginatedResponse) +update_forward_refs(HandoffStep, CallPaginatedResponse=CallPaginatedResponse) diff --git a/src/vapi/types/call_phone_call_provider.py b/src/vapi/types/call_phone_call_provider.py new file mode 100644 index 0000000..f08be6b --- /dev/null +++ b/src/vapi/types/call_phone_call_provider.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CallPhoneCallProvider = typing.Union[typing.Literal["twilio", "vonage", "vapi"], typing.Any] diff --git a/src/vapi/types/call_phone_call_transport.py b/src/vapi/types/call_phone_call_transport.py new file mode 100644 index 0000000..6c75e38 --- /dev/null +++ b/src/vapi/types/call_phone_call_transport.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CallPhoneCallTransport = typing.Union[typing.Literal["sip", "pstn"], typing.Any] diff --git a/src/vapi/types/call_status.py b/src/vapi/types/call_status.py new file mode 100644 index 0000000..5b79485 --- /dev/null +++ b/src/vapi/types/call_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CallStatus = typing.Union[typing.Literal["queued", "ringing", "in-progress", "forwarding", "ended"], typing.Any] diff --git a/src/vapi/types/call_type.py b/src/vapi/types/call_type.py new file mode 100644 index 0000000..6c5f62c --- /dev/null +++ b/src/vapi/types/call_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CallType = typing.Union[typing.Literal["inboundPhoneCall", "outboundPhoneCall", "webCall"], typing.Any] diff --git a/src/vapi/types/callback_step.py b/src/vapi/types/callback_step.py new file mode 100644 index 0000000..a1256fc --- /dev/null +++ b/src/vapi/types/callback_step.py @@ -0,0 +1,107 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +from .assignment_mutation import AssignmentMutation +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class CallbackStep(UniversalBaseModel): + block: typing.Optional["CallbackStepBlock"] = pydantic.Field(default=None) + """ + This is the block to use. To use an existing block, use `blockId`. + """ + + mutations: typing.Optional[typing.List[AssignmentMutation]] = pydantic.Field(default=None) + """ + This is the mutations to apply to the context after the step is done. + """ + + name: str = pydantic.Field() + """ + This is the name of the step. + """ + + block_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="blockId")] = pydantic.Field( + default=None + ) + """ + This is the id of the block to use. To use a transient block, use `block`. + """ + + input: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + This is the input to the block. You can use any key-value map as input to the block. + + Example: + { + "name": "John Doe", + "age": 20 + } + + You can reference any variable in the context of the current block: + + - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) + - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) + - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) + - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) + - "{{workflow.input.your-property-name}}" for the current workflow's input + - "{{global.your-property-name}}" for the global context + + Example: + { + "name": "{{my-tool-call-step.output.name}}", + "age": "{{my-tool-call-step.input.age}}", + "date": "{{workflow.input.date}}" + } + + You can dynamically change the key name. + + Example: + { + "{{my-tool-call-step.output.key-name-for-name}}": "{{name}}", + "{{my-tool-call-step.input.key-name-for-age}}": "{{age}}", + "{{workflow.input.key-name-for-date}}": "{{date}}" + } + + You can represent the value as a string, number, boolean, array, or object. + + Example: + { + "name": "john", + "age": 20, + "date": "2021-01-01", + "metadata": { + "unique-key": "{{my-tool-call-step.output.unique-key}}" + }, + "array": ["A", "B", "C"], + } + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.input/output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.input/output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .create_workflow_block_dto import CreateWorkflowBlockDto # noqa: E402 +from .handoff_step import HandoffStep # noqa: E402 +from .callback_step_block import CallbackStepBlock # noqa: E402 + +update_forward_refs(CreateWorkflowBlockDto, CallbackStep=CallbackStep) +update_forward_refs(HandoffStep, CallbackStep=CallbackStep) +update_forward_refs(CallbackStep) diff --git a/src/vapi/types/callback_step_block.py b/src/vapi/types/callback_step_block.py new file mode 100644 index 0000000..998d097 --- /dev/null +++ b/src/vapi/types/callback_step_block.py @@ -0,0 +1,95 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .create_conversation_block_dto_messages_item import CreateConversationBlockDtoMessagesItem +import typing_extensions +from .json_schema import JsonSchema +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_tool_call_block_dto_messages_item import CreateToolCallBlockDtoMessagesItem +from .create_tool_call_block_dto_tool import CreateToolCallBlockDtoTool +from .create_workflow_block_dto_messages_item import CreateWorkflowBlockDtoMessagesItem +from ..core.pydantic_utilities import update_forward_refs + + +class CallbackStepBlock_Conversation(UniversalBaseModel): + """ + This is the block to use. To use an existing block, use `blockId`. + """ + + type: typing.Literal["conversation"] = "conversation" + messages: typing.Optional[typing.List[CreateConversationBlockDtoMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + instruction: str + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CallbackStepBlock_ToolCall(UniversalBaseModel): + """ + This is the block to use. To use an existing block, use `blockId`. + """ + + type: typing.Literal["tool-call"] = "tool-call" + messages: typing.Optional[typing.List[CreateToolCallBlockDtoMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + tool: typing.Optional[CreateToolCallBlockDtoTool] = None + tool_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="toolId")] = None + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CallbackStepBlock_Workflow(UniversalBaseModel): + """ + This is the block to use. To use an existing block, use `blockId`. + """ + + type: typing.Literal["workflow"] = "workflow" + messages: typing.Optional[typing.List[CreateWorkflowBlockDtoMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + steps: typing.Optional[typing.List["CreateWorkflowBlockDtoStepsItem"]] = None + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .callback_step import CallbackStep # noqa: E402 +from .create_workflow_block_dto import CreateWorkflowBlockDto # noqa: E402 +from .handoff_step import HandoffStep # noqa: E402 + +CallbackStepBlock = typing.Union[CallbackStepBlock_Conversation, CallbackStepBlock_ToolCall, CallbackStepBlock_Workflow] +from .create_workflow_block_dto_steps_item import CreateWorkflowBlockDtoStepsItem # noqa: E402 + +update_forward_refs(CallbackStep, CallbackStepBlock_Workflow=CallbackStepBlock_Workflow) +update_forward_refs(CreateWorkflowBlockDto, CallbackStepBlock_Workflow=CallbackStepBlock_Workflow) +update_forward_refs(HandoffStep, CallbackStepBlock_Workflow=CallbackStepBlock_Workflow) +update_forward_refs(CallbackStepBlock_Workflow) diff --git a/src/vapi/types/cartesia_credential.py b/src/vapi/types/cartesia_credential.py new file mode 100644 index 0000000..2fbf720 --- /dev/null +++ b/src/vapi/types/cartesia_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CartesiaCredential(UniversalBaseModel): + provider: typing.Literal["cartesia"] = "cartesia" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/cartesia_voice.py b/src/vapi/types/cartesia_voice.py new file mode 100644 index 0000000..757d7ad --- /dev/null +++ b/src/vapi/types/cartesia_voice.py @@ -0,0 +1,53 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .cartesia_voice_model import CartesiaVoiceModel +from .cartesia_voice_language import CartesiaVoiceLanguage +from .chunk_plan import ChunkPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CartesiaVoice(UniversalBaseModel): + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether fillers are injected into the model output before inputting it into the voice provider. + + Default `false` because you can achieve better results with prompting the model. + """ + + model: typing.Optional[CartesiaVoiceModel] = pydantic.Field(default=None) + """ + This is the model that will be used. This is optional and will default to the correct model for the voiceId. + """ + + language: typing.Optional[CartesiaVoiceLanguage] = pydantic.Field(default=None) + """ + This is the language that will be used. This is optional and will default to the correct language for the voiceId. + """ + + voice_id: typing_extensions.Annotated[str, FieldMetadata(alias="voiceId")] = pydantic.Field() + """ + This is the provider-specific ID that will be used. + """ + + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for chunking the model output before it is sent to the voice provider. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/cartesia_voice_language.py b/src/vapi/types/cartesia_voice_language.py new file mode 100644 index 0000000..ea8e832 --- /dev/null +++ b/src/vapi/types/cartesia_voice_language.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CartesiaVoiceLanguage = typing.Union[typing.Literal["de", "en", "es", "fr", "ja", "pt", "zh"], typing.Any] diff --git a/src/vapi/types/cartesia_voice_model.py b/src/vapi/types/cartesia_voice_model.py new file mode 100644 index 0000000..5236008 --- /dev/null +++ b/src/vapi/types/cartesia_voice_model.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CartesiaVoiceModel = typing.Union[typing.Literal["sonic-english", "sonic-multilingual"], typing.Any] diff --git a/src/vapi/types/chunk_plan.py b/src/vapi/types/chunk_plan.py new file mode 100644 index 0000000..f3719f7 --- /dev/null +++ b/src/vapi/types/chunk_plan.py @@ -0,0 +1,70 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from .chunk_plan_punctuation_boundaries_item import ChunkPlanPunctuationBoundariesItem +from .format_plan import FormatPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ChunkPlan(UniversalBaseModel): + enabled: typing.Optional[bool] = pydantic.Field(default=None) + """ + This determines whether the model output is chunked before being sent to the voice provider. Default `true`. + + Usage: + + - To rely on the voice provider's audio generation logic, set this to `false`. + - If seeing issues with quality, set this to `true`. + + If disabled, Vapi-provided audio control tokens like will not work. + + @default true + """ + + min_characters: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="minCharacters")] = ( + pydantic.Field(default=None) + ) + """ + This is the minimum number of characters in a chunk. + + Usage: + + - To increase quality, set this to a higher value. + - To decrease latency, set this to a lower value. + + @default 30 + """ + + punctuation_boundaries: typing_extensions.Annotated[ + typing.Optional[typing.List[ChunkPlanPunctuationBoundariesItem]], FieldMetadata(alias="punctuationBoundaries") + ] = pydantic.Field(default=None) + """ + These are the punctuations that are considered valid boundaries for a chunk to be created. + + Usage: + + - To increase quality, constrain to fewer boundaries. + - To decrease latency, enable all. + + Default is automatically set to balance the trade-off between quality and latency based on the provider. + """ + + format_plan: typing_extensions.Annotated[typing.Optional[FormatPlan], FieldMetadata(alias="formatPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for formatting the chunk before it is sent to the voice provider. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/chunk_plan_punctuation_boundaries_item.py b/src/vapi/types/chunk_plan_punctuation_boundaries_item.py new file mode 100644 index 0000000..c690096 --- /dev/null +++ b/src/vapi/types/chunk_plan_punctuation_boundaries_item.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ChunkPlanPunctuationBoundariesItem = typing.Union[ + typing.Literal["。", ",", ".", "!", "?", ";", ")", "،", "۔", "।", "॥", "|", "||", ",", ":"], typing.Any +] diff --git a/src/vapi/types/client_inbound_message.py b/src/vapi/types/client_inbound_message.py new file mode 100644 index 0000000..e872bc5 --- /dev/null +++ b/src/vapi/types/client_inbound_message.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .client_inbound_message_message import ClientInboundMessageMessage +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ClientInboundMessage(UniversalBaseModel): + message: ClientInboundMessageMessage = pydantic.Field() + """ + These are the messages that can be sent from client-side SDKs to control the call. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_inbound_message_add_message.py b/src/vapi/types/client_inbound_message_add_message.py new file mode 100644 index 0000000..c001e3b --- /dev/null +++ b/src/vapi/types/client_inbound_message_add_message.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .open_ai_message import OpenAiMessage +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ClientInboundMessageAddMessage(UniversalBaseModel): + message: OpenAiMessage = pydantic.Field() + """ + This is the message to add to the conversation. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_inbound_message_control.py b/src/vapi/types/client_inbound_message_control.py new file mode 100644 index 0000000..b1ceed2 --- /dev/null +++ b/src/vapi/types/client_inbound_message_control.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .client_inbound_message_control_control import ClientInboundMessageControlControl +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ClientInboundMessageControl(UniversalBaseModel): + control: ClientInboundMessageControlControl = pydantic.Field() + """ + This is the control action + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_inbound_message_control_control.py b/src/vapi/types/client_inbound_message_control_control.py new file mode 100644 index 0000000..8081732 --- /dev/null +++ b/src/vapi/types/client_inbound_message_control_control.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ClientInboundMessageControlControl = typing.Union[ + typing.Literal["mute-assistant", "unmute-assistant", "say-first-message"], typing.Any +] diff --git a/src/vapi/types/client_inbound_message_message.py b/src/vapi/types/client_inbound_message_message.py new file mode 100644 index 0000000..f9899c6 --- /dev/null +++ b/src/vapi/types/client_inbound_message_message.py @@ -0,0 +1,73 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .client_inbound_message_control_control import ClientInboundMessageControlControl +import typing_extensions +from ..core.serialization import FieldMetadata + + +class ClientInboundMessageMessage_AddMessage(UniversalBaseModel): + """ + These are the messages that can be sent from client-side SDKs to control the call. + """ + + type: typing.Literal["add-message"] = "add-message" + message: OpenAiMessage + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientInboundMessageMessage_Control(UniversalBaseModel): + """ + These are the messages that can be sent from client-side SDKs to control the call. + """ + + type: typing.Literal["control"] = "control" + control: ClientInboundMessageControlControl + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientInboundMessageMessage_Say(UniversalBaseModel): + """ + These are the messages that can be sent from client-side SDKs to control the call. + """ + + type: typing.Literal["say"] = "say" + content: typing.Optional[str] = None + end_call_after_spoken: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpoken") + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ClientInboundMessageMessage = typing.Union[ + ClientInboundMessageMessage_AddMessage, ClientInboundMessageMessage_Control, ClientInboundMessageMessage_Say +] diff --git a/src/vapi/types/client_inbound_message_say.py b/src/vapi/types/client_inbound_message_say.py new file mode 100644 index 0000000..8ef8eee --- /dev/null +++ b/src/vapi/types/client_inbound_message_say.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ClientInboundMessageSay(UniversalBaseModel): + content: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the content to say. + """ + + end_call_after_spoken: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpoken") + ] = pydantic.Field(default=None) + """ + This is the flag to end call after content is spoken. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_message.py b/src/vapi/types/client_message.py new file mode 100644 index 0000000..55969de --- /dev/null +++ b/src/vapi/types/client_message.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .client_message_message import ClientMessageMessage +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ClientMessage(UniversalBaseModel): + message: ClientMessageMessage = pydantic.Field() + """ + These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_message_conversation_update.py b/src/vapi/types/client_message_conversation_update.py new file mode 100644 index 0000000..dd94a23 --- /dev/null +++ b/src/vapi/types/client_message_conversation_update.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .client_message_conversation_update_messages_item import ClientMessageConversationUpdateMessagesItem +import pydantic +import typing_extensions +from .open_ai_message import OpenAiMessage +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ClientMessageConversationUpdate(UniversalBaseModel): + messages: typing.Optional[typing.List[ClientMessageConversationUpdateMessagesItem]] = pydantic.Field(default=None) + """ + This is the most up-to-date conversation history at the time the message is sent. + """ + + messages_open_ai_formatted: typing_extensions.Annotated[ + typing.List[OpenAiMessage], FieldMetadata(alias="messagesOpenAIFormatted") + ] = pydantic.Field() + """ + This is the most up-to-date conversation history at the time the message is sent, formatted for OpenAI. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_message_conversation_update_messages_item.py b/src/vapi/types/client_message_conversation_update_messages_item.py new file mode 100644 index 0000000..b25bba0 --- /dev/null +++ b/src/vapi/types/client_message_conversation_update_messages_item.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from .user_message import UserMessage +from .system_message import SystemMessage +from .bot_message import BotMessage +from .tool_call_message import ToolCallMessage +from .tool_call_result_message import ToolCallResultMessage + +ClientMessageConversationUpdateMessagesItem = typing.Union[ + UserMessage, SystemMessage, BotMessage, ToolCallMessage, ToolCallResultMessage +] diff --git a/src/vapi/types/client_message_hang.py b/src/vapi/types/client_message_hang.py new file mode 100644 index 0000000..7a7382b --- /dev/null +++ b/src/vapi/types/client_message_hang.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class ClientMessageHang(UniversalBaseModel): + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_message_language_changed.py b/src/vapi/types/client_message_language_changed.py new file mode 100644 index 0000000..84ce324 --- /dev/null +++ b/src/vapi/types/client_message_language_changed.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ClientMessageLanguageChanged(UniversalBaseModel): + language: str = pydantic.Field() + """ + This is the language the transcriber is switched to. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_message_message.py b/src/vapi/types/client_message_message.py new file mode 100644 index 0000000..87330a4 --- /dev/null +++ b/src/vapi/types/client_message_message.py @@ -0,0 +1,241 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .client_message_conversation_update_messages_item import ClientMessageConversationUpdateMessagesItem +import typing_extensions +from .open_ai_message import OpenAiMessage +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .client_message_speech_update_status import ClientMessageSpeechUpdateStatus +from .client_message_speech_update_role import ClientMessageSpeechUpdateRole +from .client_message_transcript_role import ClientMessageTranscriptRole +from .client_message_transcript_transcript_type import ClientMessageTranscriptTranscriptType +from .client_message_tool_calls_tool_with_tool_call_list_item import ClientMessageToolCallsToolWithToolCallListItem +from .tool_call import ToolCall + + +class ClientMessageMessage_ConversationUpdate(UniversalBaseModel): + """ + These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. + """ + + type: typing.Literal["conversation-update"] = "conversation-update" + messages: typing.Optional[typing.List[ClientMessageConversationUpdateMessagesItem]] = None + messages_open_ai_formatted: typing_extensions.Annotated[ + typing.List[OpenAiMessage], FieldMetadata(alias="messagesOpenAIFormatted") + ] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientMessageMessage_Hang(UniversalBaseModel): + """ + These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. + """ + + type: typing.Literal["hang"] = "hang" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientMessageMessage_Metadata(UniversalBaseModel): + """ + These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. + """ + + type: typing.Literal["metadata"] = "metadata" + metadata: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientMessageMessage_ModelOutput(UniversalBaseModel): + """ + These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. + """ + + type: typing.Literal["model-output"] = "model-output" + output: typing.Dict[str, typing.Optional[typing.Any]] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientMessageMessage_SpeechUpdate(UniversalBaseModel): + """ + These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. + """ + + type: typing.Literal["speech-update"] = "speech-update" + status: ClientMessageSpeechUpdateStatus + role: ClientMessageSpeechUpdateRole + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientMessageMessage_Transcript(UniversalBaseModel): + """ + These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. + """ + + type: typing.Literal["transcript"] = "transcript" + role: ClientMessageTranscriptRole + transcript_type: typing_extensions.Annotated[ + ClientMessageTranscriptTranscriptType, FieldMetadata(alias="transcriptType") + ] + transcript: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientMessageMessage_ToolCalls(UniversalBaseModel): + """ + These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. + """ + + type: typing.Literal["tool-calls"] = "tool-calls" + tool_with_tool_call_list: typing_extensions.Annotated[ + typing.List[ClientMessageToolCallsToolWithToolCallListItem], FieldMetadata(alias="toolWithToolCallList") + ] + tool_call_list: typing_extensions.Annotated[typing.List[ToolCall], FieldMetadata(alias="toolCallList")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientMessageMessage_ToolCallsResult(UniversalBaseModel): + """ + These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. + """ + + type: typing.Literal["tool-calls-result"] = "tool-calls-result" + tool_call_result: typing_extensions.Annotated[ + typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="toolCallResult") + ] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientMessageMessage_UserInterrupted(UniversalBaseModel): + """ + These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. + """ + + type: typing.Literal["user-interrupted"] = "user-interrupted" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientMessageMessage_LanguageChanged(UniversalBaseModel): + """ + These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. + """ + + type: typing.Literal["language-changed"] = "language-changed" + language: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientMessageMessage_VoiceInput(UniversalBaseModel): + """ + These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. + """ + + type: typing.Literal["voice-input"] = "voice-input" + input: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ClientMessageMessage = typing.Union[ + ClientMessageMessage_ConversationUpdate, + ClientMessageMessage_Hang, + ClientMessageMessage_Metadata, + ClientMessageMessage_ModelOutput, + ClientMessageMessage_SpeechUpdate, + ClientMessageMessage_Transcript, + ClientMessageMessage_ToolCalls, + ClientMessageMessage_ToolCallsResult, + ClientMessageMessage_UserInterrupted, + ClientMessageMessage_LanguageChanged, + ClientMessageMessage_VoiceInput, +] diff --git a/src/vapi/types/client_message_metadata.py b/src/vapi/types/client_message_metadata.py new file mode 100644 index 0000000..f3377ea --- /dev/null +++ b/src/vapi/types/client_message_metadata.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ClientMessageMetadata(UniversalBaseModel): + metadata: str = pydantic.Field() + """ + This is the metadata content + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_message_model_output.py b/src/vapi/types/client_message_model_output.py new file mode 100644 index 0000000..1d9c7c2 --- /dev/null +++ b/src/vapi/types/client_message_model_output.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ClientMessageModelOutput(UniversalBaseModel): + output: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() + """ + This is the output of the model. It can be a token or tool call. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_message_speech_update.py b/src/vapi/types/client_message_speech_update.py new file mode 100644 index 0000000..b44f546 --- /dev/null +++ b/src/vapi/types/client_message_speech_update.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .client_message_speech_update_status import ClientMessageSpeechUpdateStatus +import pydantic +from .client_message_speech_update_role import ClientMessageSpeechUpdateRole +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ClientMessageSpeechUpdate(UniversalBaseModel): + status: ClientMessageSpeechUpdateStatus = pydantic.Field() + """ + This is the status of the speech update. + """ + + role: ClientMessageSpeechUpdateRole = pydantic.Field() + """ + This is the role which the speech update is for. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_message_speech_update_role.py b/src/vapi/types/client_message_speech_update_role.py new file mode 100644 index 0000000..eca8ba3 --- /dev/null +++ b/src/vapi/types/client_message_speech_update_role.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ClientMessageSpeechUpdateRole = typing.Union[typing.Literal["assistant", "user"], typing.Any] diff --git a/src/vapi/types/client_message_speech_update_status.py b/src/vapi/types/client_message_speech_update_status.py new file mode 100644 index 0000000..39f8028 --- /dev/null +++ b/src/vapi/types/client_message_speech_update_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ClientMessageSpeechUpdateStatus = typing.Union[typing.Literal["started", "stopped"], typing.Any] diff --git a/src/vapi/types/client_message_tool_calls.py b/src/vapi/types/client_message_tool_calls.py new file mode 100644 index 0000000..7356025 --- /dev/null +++ b/src/vapi/types/client_message_tool_calls.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .client_message_tool_calls_tool_with_tool_call_list_item import ClientMessageToolCallsToolWithToolCallListItem +from ..core.serialization import FieldMetadata +import pydantic +from .tool_call import ToolCall +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ClientMessageToolCalls(UniversalBaseModel): + tool_with_tool_call_list: typing_extensions.Annotated[ + typing.List[ClientMessageToolCallsToolWithToolCallListItem], FieldMetadata(alias="toolWithToolCallList") + ] = pydantic.Field() + """ + This is the list of tools calls that the model is requesting along with the original tool configuration. + """ + + tool_call_list: typing_extensions.Annotated[typing.List[ToolCall], FieldMetadata(alias="toolCallList")] = ( + pydantic.Field() + ) + """ + This is the list of tool calls that the model is requesting. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_message_tool_calls_result.py b/src/vapi/types/client_message_tool_calls_result.py new file mode 100644 index 0000000..b19ab06 --- /dev/null +++ b/src/vapi/types/client_message_tool_calls_result.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ClientMessageToolCallsResult(UniversalBaseModel): + tool_call_result: typing_extensions.Annotated[ + typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="toolCallResult") + ] = pydantic.Field() + """ + This is the result of the tool call. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_message_tool_calls_tool_with_tool_call_list_item.py b/src/vapi/types/client_message_tool_calls_tool_with_tool_call_list_item.py new file mode 100644 index 0000000..421f5ce --- /dev/null +++ b/src/vapi/types/client_message_tool_calls_tool_with_tool_call_list_item.py @@ -0,0 +1,80 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .function_tool_with_tool_call_messages_item import FunctionToolWithToolCallMessagesItem +from .tool_call import ToolCall +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .ghl_tool_with_tool_call_messages_item import GhlToolWithToolCallMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .make_tool_with_tool_call_messages_item import MakeToolWithToolCallMessagesItem +from .make_tool_metadata import MakeToolMetadata + + +class ClientMessageToolCallsToolWithToolCallListItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[FunctionToolWithToolCallMessagesItem]] = None + tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientMessageToolCallsToolWithToolCallListItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[GhlToolWithToolCallMessagesItem]] = None + tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ClientMessageToolCallsToolWithToolCallListItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[MakeToolWithToolCallMessagesItem]] = None + tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ClientMessageToolCallsToolWithToolCallListItem = typing.Union[ + ClientMessageToolCallsToolWithToolCallListItem_Function, + ClientMessageToolCallsToolWithToolCallListItem_Ghl, + ClientMessageToolCallsToolWithToolCallListItem_Make, +] diff --git a/src/vapi/types/client_message_transcript.py b/src/vapi/types/client_message_transcript.py new file mode 100644 index 0000000..fa31147 --- /dev/null +++ b/src/vapi/types/client_message_transcript.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .client_message_transcript_role import ClientMessageTranscriptRole +import pydantic +import typing_extensions +from .client_message_transcript_transcript_type import ClientMessageTranscriptTranscriptType +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ClientMessageTranscript(UniversalBaseModel): + role: ClientMessageTranscriptRole = pydantic.Field() + """ + This is the role for which the transcript is for. + """ + + transcript_type: typing_extensions.Annotated[ + ClientMessageTranscriptTranscriptType, FieldMetadata(alias="transcriptType") + ] = pydantic.Field() + """ + This is the type of the transcript. + """ + + transcript: str = pydantic.Field() + """ + This is the transcript content. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_message_transcript_role.py b/src/vapi/types/client_message_transcript_role.py new file mode 100644 index 0000000..c7ce78b --- /dev/null +++ b/src/vapi/types/client_message_transcript_role.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ClientMessageTranscriptRole = typing.Union[typing.Literal["assistant", "user"], typing.Any] diff --git a/src/vapi/types/client_message_transcript_transcript_type.py b/src/vapi/types/client_message_transcript_transcript_type.py new file mode 100644 index 0000000..d865408 --- /dev/null +++ b/src/vapi/types/client_message_transcript_transcript_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ClientMessageTranscriptTranscriptType = typing.Union[typing.Literal["partial", "final"], typing.Any] diff --git a/src/vapi/types/client_message_user_interrupted.py b/src/vapi/types/client_message_user_interrupted.py new file mode 100644 index 0000000..93d9a72 --- /dev/null +++ b/src/vapi/types/client_message_user_interrupted.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class ClientMessageUserInterrupted(UniversalBaseModel): + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/client_message_voice_input.py b/src/vapi/types/client_message_voice_input.py new file mode 100644 index 0000000..87fed19 --- /dev/null +++ b/src/vapi/types/client_message_voice_input.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ClientMessageVoiceInput(UniversalBaseModel): + input: str = pydantic.Field() + """ + This is the voice input content + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/clone_voice_dto.py b/src/vapi/types/clone_voice_dto.py new file mode 100644 index 0000000..c6b7df3 --- /dev/null +++ b/src/vapi/types/clone_voice_dto.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CloneVoiceDto(UniversalBaseModel): + name: str = pydantic.Field() + """ + This is the name of the cloned voice in the provider account. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the description of your cloned voice. + """ + + labels: typing.Optional[str] = pydantic.Field(default=None) + """ + Serialized labels dictionary for the voice. + """ + + files: typing.List[str] = pydantic.Field() + """ + These are the files you want to use to clone your voice. Only Audio files are supported. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/condition.py b/src/vapi/types/condition.py new file mode 100644 index 0000000..dfe4389 --- /dev/null +++ b/src/vapi/types/condition.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +from .condition_operator import ConditionOperator +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class Condition(UniversalBaseModel): + value: str = pydantic.Field() + """ + This is the value you want to compare against the parameter. + """ + + operator: ConditionOperator = pydantic.Field() + """ + This is the operator you want to use to compare the parameter and value. + """ + + param: str = pydantic.Field() + """ + This is the name of the parameter that you want to check. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/condition_operator.py b/src/vapi/types/condition_operator.py new file mode 100644 index 0000000..376df93 --- /dev/null +++ b/src/vapi/types/condition_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ConditionOperator = typing.Union[typing.Literal["eq", "neq", "gt", "gte", "lt", "lte"], typing.Any] diff --git a/src/vapi/types/conversation_block.py b/src/vapi/types/conversation_block.py new file mode 100644 index 0000000..4644dc7 --- /dev/null +++ b/src/vapi/types/conversation_block.py @@ -0,0 +1,108 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .conversation_block_messages_item import ConversationBlockMessagesItem +import pydantic +import typing_extensions +from .json_schema import JsonSchema +from ..core.serialization import FieldMetadata +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ConversationBlock(UniversalBaseModel): + messages: typing.Optional[typing.List[ConversationBlockMessagesItem]] = pydantic.Field(default=None) + """ + These are the pre-configured messages that will be spoken to the user while the block is running. + """ + + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = ( + pydantic.Field(default=None) + ) + """ + This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` + + These are accessible as variables: + + - ({{input.propertyName}}) in context of the block execution (step) + - ({{stepName.input.propertyName}}) in context of the workflow + """ + + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = ( + pydantic.Field(default=None) + ) + """ + This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). + + These are accessible as variables: + + - ({{output.propertyName}}) in context of the block execution (step) + - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) + - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the block. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the organization that this block belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the block was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the block was last updated. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the block. This is just for your reference. + """ + + instruction: str = pydantic.Field() + """ + This is the instruction to the model. + + You can reference any variable in the context of the current block execution (step): + + - "{{input.your-property-name}}" for the current step's input + - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) + - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) + - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) + - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) + - "{{workflow.input.your-property-name}}" for the current workflow's input + - "{{global.your-property-name}}" for the global context + + This can be as simple or as complex as you want it to be. + + - "say hello and ask the user about their day!" + - "collect the user's first and last name" + - "user is {{input.firstName}} {{input.lastName}}. their age is {{input.age}}. ask them about their salary and if they might be interested in buying a house. we offer {{input.offer}}" + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output/input.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output/input.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/conversation_block_messages_item.py b/src/vapi/types/conversation_block_messages_item.py new file mode 100644 index 0000000..7c87a5e --- /dev/null +++ b/src/vapi/types/conversation_block_messages_item.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .block_start_message_conditions_item import BlockStartMessageConditionsItem +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .block_complete_message_conditions_item import BlockCompleteMessageConditionsItem + + +class ConversationBlockMessagesItem_BlockStart(UniversalBaseModel): + type: typing.Literal["block-start"] = "block-start" + conditions: typing.Optional[typing.List[BlockStartMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ConversationBlockMessagesItem_BlockComplete(UniversalBaseModel): + type: typing.Literal["block-complete"] = "block-complete" + conditions: typing.Optional[typing.List[BlockCompleteMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ConversationBlockMessagesItem = typing.Union[ + ConversationBlockMessagesItem_BlockStart, ConversationBlockMessagesItem_BlockComplete +] diff --git a/src/vapi/types/cost_breakdown.py b/src/vapi/types/cost_breakdown.py new file mode 100644 index 0000000..406d577 --- /dev/null +++ b/src/vapi/types/cost_breakdown.py @@ -0,0 +1,78 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from .analysis_cost_breakdown import AnalysisCostBreakdown +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CostBreakdown(UniversalBaseModel): + transport: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the cost of the transport provider, like Twilio or Vonage. + """ + + stt: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the cost of the speech-to-text service. + """ + + llm: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the cost of the language model. + """ + + tts: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the cost of the text-to-speech service. + """ + + vapi: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the cost of Vapi. + """ + + total: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the total cost of the call. + """ + + llm_prompt_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="llmPromptTokens")] = ( + pydantic.Field(default=None) + ) + """ + This is the LLM prompt tokens used for the call. + """ + + llm_completion_tokens: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="llmCompletionTokens") + ] = pydantic.Field(default=None) + """ + This is the LLM completion tokens used for the call. + """ + + tts_characters: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="ttsCharacters")] = ( + pydantic.Field(default=None) + ) + """ + This is the TTS characters used for the call. + """ + + analysis_cost_breakdown: typing_extensions.Annotated[ + typing.Optional[AnalysisCostBreakdown], FieldMetadata(alias="analysisCostBreakdown") + ] = pydantic.Field(default=None) + """ + This is the cost of the analysis. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_anthropic_credential_dto.py b/src/vapi/types/create_anthropic_credential_dto.py new file mode 100644 index 0000000..43d9dd3 --- /dev/null +++ b/src/vapi/types/create_anthropic_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateAnthropicCredentialDto(UniversalBaseModel): + provider: typing.Literal["anthropic"] = "anthropic" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_anyscale_credential_dto.py b/src/vapi/types/create_anyscale_credential_dto.py new file mode 100644 index 0000000..b99dede --- /dev/null +++ b/src/vapi/types/create_anyscale_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateAnyscaleCredentialDto(UniversalBaseModel): + provider: typing.Literal["anyscale"] = "anyscale" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_assistant_dto.py b/src/vapi/types/create_assistant_dto.py new file mode 100644 index 0000000..e54ec79 --- /dev/null +++ b/src/vapi/types/create_assistant_dto.py @@ -0,0 +1,309 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing +from .create_assistant_dto_transcriber import CreateAssistantDtoTranscriber +import pydantic +from .create_assistant_dto_model import CreateAssistantDtoModel +from .create_assistant_dto_voice import CreateAssistantDtoVoice +import typing_extensions +from .create_assistant_dto_first_message_mode import CreateAssistantDtoFirstMessageMode +from ..core.serialization import FieldMetadata +from .create_assistant_dto_client_messages_item import CreateAssistantDtoClientMessagesItem +from .create_assistant_dto_server_messages_item import CreateAssistantDtoServerMessagesItem +from .create_assistant_dto_background_sound import CreateAssistantDtoBackgroundSound +from .transport_configuration_twilio import TransportConfigurationTwilio +from .twilio_voicemail_detection import TwilioVoicemailDetection +from .analysis_plan import AnalysisPlan +from .artifact_plan import ArtifactPlan +from .message_plan import MessagePlan +from .start_speaking_plan import StartSpeakingPlan +from .stop_speaking_plan import StopSpeakingPlan +from .monitor_plan import MonitorPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class CreateAssistantDto(UniversalBaseModel): + transcriber: typing.Optional[CreateAssistantDtoTranscriber] = pydantic.Field(default=None) + """ + These are the options for the assistant's transcriber. + """ + + model: typing.Optional[CreateAssistantDtoModel] = pydantic.Field(default=None) + """ + These are the options for the assistant's LLM. + """ + + voice: typing.Optional[CreateAssistantDtoVoice] = pydantic.Field(default=None) + """ + These are the options for the assistant's voice. + """ + + first_message_mode: typing_extensions.Annotated[ + typing.Optional[CreateAssistantDtoFirstMessageMode], FieldMetadata(alias="firstMessageMode") + ] = pydantic.Field(default=None) + """ + This is the mode for the first message. Default is 'assistant-speaks-first'. + + Use: + + - 'assistant-speaks-first' to have the assistant speak first. + - 'assistant-waits-for-user' to have the assistant wait for the user to speak first. + - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + + @default 'assistant-speaks-first' + """ + + hipaa_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="hipaaEnabled")] = ( + pydantic.Field(default=None) + ) + """ + When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + """ + + client_messages: typing_extensions.Annotated[ + typing.Optional[typing.List[CreateAssistantDtoClientMessagesItem]], FieldMetadata(alias="clientMessages") + ] = pydantic.Field(default=None) + """ + These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + """ + + server_messages: typing_extensions.Annotated[ + typing.Optional[typing.List[CreateAssistantDtoServerMessagesItem]], FieldMetadata(alias="serverMessages") + ] = pydantic.Field(default=None) + """ + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. + """ + + silence_timeout_seconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="silenceTimeoutSeconds") + ] = pydantic.Field(default=None) + """ + How many seconds of silence to wait before ending the call. Defaults to 30. + + @default 30 + """ + + max_duration_seconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="maxDurationSeconds") + ] = pydantic.Field(default=None) + """ + This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + + @default 600 (10 minutes) + """ + + background_sound: typing_extensions.Annotated[ + typing.Optional[CreateAssistantDtoBackgroundSound], FieldMetadata(alias="backgroundSound") + ] = pydantic.Field(default=None) + """ + This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + """ + + backchanneling_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="backchannelingEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking. + + Default `false` while in beta. + + @default false + """ + + background_denoising_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="backgroundDenoisingEnabled") + ] = pydantic.Field(default=None) + """ + This enables filtering of noise and background speech while the user is talking. + + Default `false` while in beta. + + @default false + """ + + model_output_in_messages_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="modelOutputInMessagesEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + + Default `false` while in beta. + + @default false + """ + + transport_configurations: typing_extensions.Annotated[ + typing.Optional[typing.List[TransportConfigurationTwilio]], FieldMetadata(alias="transportConfigurations") + ] = pydantic.Field(default=None) + """ + These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the assistant. + + This is required when you want to transfer between assistants in a call. + """ + + first_message: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="firstMessage")] = ( + pydantic.Field(default=None) + ) + """ + This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + + If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + """ + + voicemail_detection: typing_extensions.Annotated[ + typing.Optional[TwilioVoicemailDetection], FieldMetadata(alias="voicemailDetection") + ] = pydantic.Field(default=None) + """ + These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. + You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + """ + + voicemail_message: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="voicemailMessage")] = ( + pydantic.Field(default=None) + ) + """ + This is the message that the assistant will say if the call is forwarded to voicemail. + + If unspecified, it will hang up. + """ + + end_call_message: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="endCallMessage")] = ( + pydantic.Field(default=None) + ) + """ + This is the message that the assistant will say if it ends the call. + + If unspecified, it will hang up without saying anything. + """ + + end_call_phrases: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="endCallPhrases") + ] = pydantic.Field(default=None) + """ + This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + """ + + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + This is for metadata you want to store on the assistant. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + + All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + analysis_plan: typing_extensions.Annotated[typing.Optional[AnalysisPlan], FieldMetadata(alias="analysisPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + """ + + artifact_plan: typing_extensions.Annotated[typing.Optional[ArtifactPlan], FieldMetadata(alias="artifactPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + + Note: `recordingEnabled` is currently at the root level. It will be moved to `artifactPlan` in the future, but will remain backwards compatible. + """ + + message_plan: typing_extensions.Annotated[typing.Optional[MessagePlan], FieldMetadata(alias="messagePlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. + + Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. + """ + + start_speaking_plan: typing_extensions.Annotated[ + typing.Optional[StartSpeakingPlan], FieldMetadata(alias="startSpeakingPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for when the assistant should start talking. + + You should configure this if you're running into these issues: + + - The assistant is too slow to start talking after the customer is done speaking. + - The assistant is too fast to start talking after the customer is done speaking. + - The assistant is so fast that it's actually interrupting the customer. + """ + + stop_speaking_plan: typing_extensions.Annotated[ + typing.Optional[StopSpeakingPlan], FieldMetadata(alias="stopSpeakingPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for when assistant should stop talking on customer interruption. + + You should configure this if you're running into these issues: + + - The assistant is too slow to recognize customer's interruption. + - The assistant is too fast to recognize customer's interruption. + - The assistant is getting interrupted by phrases that are just acknowledgments. + - The assistant is getting interrupted by background noises. + - The assistant is not properly stopping -- it starts talking right after getting interrupted. + """ + + monitor_plan: typing_extensions.Annotated[typing.Optional[MonitorPlan], FieldMetadata(alias="monitorPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for real-time monitoring of the assistant's calls. + + Usage: + + - To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. + - To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + + Note, `serverMessages`, `clientMessages`, `serverUrl` and `serverUrlSecret` are currently at the root level but will be moved to `monitorPlan` in the future. Will remain backwards compatible + """ + + credential_ids: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="credentialIds") + ] = pydantic.Field(default=None) + """ + These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, CreateAssistantDto=CreateAssistantDto) +update_forward_refs(CreateWorkflowBlockDto, CreateAssistantDto=CreateAssistantDto) +update_forward_refs(HandoffStep, CreateAssistantDto=CreateAssistantDto) diff --git a/src/vapi/types/create_assistant_dto_background_sound.py b/src/vapi/types/create_assistant_dto_background_sound.py new file mode 100644 index 0000000..6a0c5ef --- /dev/null +++ b/src/vapi/types/create_assistant_dto_background_sound.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateAssistantDtoBackgroundSound = typing.Union[typing.Literal["off", "office"], typing.Any] diff --git a/src/vapi/types/create_assistant_dto_client_messages_item.py b/src/vapi/types/create_assistant_dto_client_messages_item.py new file mode 100644 index 0000000..aff9644 --- /dev/null +++ b/src/vapi/types/create_assistant_dto_client_messages_item.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateAssistantDtoClientMessagesItem = typing.Union[ + typing.Literal[ + "conversation-update", + "function-call", + "function-call-result", + "hang", + "language-changed", + "metadata", + "model-output", + "speech-update", + "status-update", + "transcript", + "tool-calls", + "tool-calls-result", + "user-interrupted", + "voice-input", + ], + typing.Any, +] diff --git a/src/vapi/types/create_assistant_dto_first_message_mode.py b/src/vapi/types/create_assistant_dto_first_message_mode.py new file mode 100644 index 0000000..e4b7f01 --- /dev/null +++ b/src/vapi/types/create_assistant_dto_first_message_mode.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateAssistantDtoFirstMessageMode = typing.Union[ + typing.Literal[ + "assistant-speaks-first", "assistant-speaks-first-with-model-generated-message", "assistant-waits-for-user" + ], + typing.Any, +] diff --git a/src/vapi/types/create_assistant_dto_model.py b/src/vapi/types/create_assistant_dto_model.py new file mode 100644 index 0000000..5e4ae35 --- /dev/null +++ b/src/vapi/types/create_assistant_dto_model.py @@ -0,0 +1,359 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +from .anyscale_model_tools_item import AnyscaleModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .anthropic_model_tools_item import AnthropicModelToolsItem +from .anthropic_model_model import AnthropicModelModel +from .custom_llm_model_tools_item import CustomLlmModelToolsItem +from .custom_llm_model_metadata_send_mode import CustomLlmModelMetadataSendMode +from .deep_infra_model_tools_item import DeepInfraModelToolsItem +from .groq_model_tools_item import GroqModelToolsItem +from .groq_model_model import GroqModelModel +from .open_ai_model_tools_item import OpenAiModelToolsItem +from .open_ai_model_model import OpenAiModelModel +from .open_ai_model_fallback_models_item import OpenAiModelFallbackModelsItem +from .open_router_model_tools_item import OpenRouterModelToolsItem +from .perplexity_ai_model_tools_item import PerplexityAiModelToolsItem +from .together_ai_model_tools_item import TogetherAiModelToolsItem +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +from .vapi_model_tools_item import VapiModelToolsItem +from .vapi_model_steps_item import VapiModelStepsItem +from ..core.pydantic_utilities import update_forward_refs + + +class CreateAssistantDtoModel_Anyscale(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["anyscale"] = "anyscale" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[AnyscaleModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoModel_Anthropic(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["anthropic"] = "anthropic" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[AnthropicModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: AnthropicModelModel + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoModel_CustomLlm(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["custom-llm"] = "custom-llm" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[CustomLlmModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + metadata_send_mode: typing_extensions.Annotated[ + typing.Optional[CustomLlmModelMetadataSendMode], FieldMetadata(alias="metadataSendMode") + ] = None + url: str + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoModel_Deepinfra(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["deepinfra"] = "deepinfra" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[DeepInfraModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoModel_Groq(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["groq"] = "groq" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[GroqModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: GroqModelModel + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoModel_Openai(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["openai"] = "openai" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[OpenAiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: OpenAiModelModel + fallback_models: typing_extensions.Annotated[ + typing.Optional[typing.List[OpenAiModelFallbackModelsItem]], FieldMetadata(alias="fallbackModels") + ] = None + semantic_caching_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="semanticCachingEnabled") + ] = None + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoModel_Openrouter(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["openrouter"] = "openrouter" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[OpenRouterModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoModel_PerplexityAi(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["perplexity-ai"] = "perplexity-ai" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[PerplexityAiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoModel_TogetherAi(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["together-ai"] = "together-ai" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[TogetherAiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoModel_Vapi(UniversalBaseModel): + """ + These are the options for the assistant's LLM. + """ + + provider: typing.Literal["vapi"] = "vapi" + messages: typing.Optional[typing.List[OpenAiMessage]] = None + tools: typing.Optional[typing.List[VapiModelToolsItem]] = None + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = None + steps: typing.Optional[typing.List[VapiModelStepsItem]] = None + model: str + temperature: typing.Optional[float] = None + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = None + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = None + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = None + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateAssistantDtoModel = typing.Union[ + CreateAssistantDtoModel_Anyscale, + CreateAssistantDtoModel_Anthropic, + CreateAssistantDtoModel_CustomLlm, + CreateAssistantDtoModel_Deepinfra, + CreateAssistantDtoModel_Groq, + CreateAssistantDtoModel_Openai, + CreateAssistantDtoModel_Openrouter, + CreateAssistantDtoModel_PerplexityAi, + CreateAssistantDtoModel_TogetherAi, + CreateAssistantDtoModel_Vapi, +] +update_forward_refs(CallbackStep, CreateAssistantDtoModel_Vapi=CreateAssistantDtoModel_Vapi) +update_forward_refs(CreateWorkflowBlockDto, CreateAssistantDtoModel_Vapi=CreateAssistantDtoModel_Vapi) +update_forward_refs(HandoffStep, CreateAssistantDtoModel_Vapi=CreateAssistantDtoModel_Vapi) diff --git a/src/vapi/types/create_assistant_dto_server_messages_item.py b/src/vapi/types/create_assistant_dto_server_messages_item.py new file mode 100644 index 0000000..1b33b84 --- /dev/null +++ b/src/vapi/types/create_assistant_dto_server_messages_item.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateAssistantDtoServerMessagesItem = typing.Union[ + typing.Literal[ + "conversation-update", + "end-of-call-report", + "function-call", + "hang", + "language-changed", + "model-output", + "phone-call-control", + "speech-update", + "status-update", + "transcript", + "tool-calls", + "transfer-destination-request", + "transfer-update", + "user-interrupted", + "voice-input", + ], + typing.Any, +] diff --git a/src/vapi/types/create_assistant_dto_transcriber.py b/src/vapi/types/create_assistant_dto_transcriber.py new file mode 100644 index 0000000..c420aea --- /dev/null +++ b/src/vapi/types/create_assistant_dto_transcriber.py @@ -0,0 +1,93 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .deepgram_transcriber_model import DeepgramTranscriberModel +from .deepgram_transcriber_language import DeepgramTranscriberLanguage +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .gladia_transcriber_model import GladiaTranscriberModel +from .gladia_transcriber_language_behaviour import GladiaTranscriberLanguageBehaviour +from .gladia_transcriber_language import GladiaTranscriberLanguage +from .talkscriber_transcriber_language import TalkscriberTranscriberLanguage + + +class CreateAssistantDtoTranscriber_Deepgram(UniversalBaseModel): + """ + These are the options for the assistant's transcriber. + """ + + provider: typing.Literal["deepgram"] = "deepgram" + model: typing.Optional[DeepgramTranscriberModel] = None + language: typing.Optional[DeepgramTranscriberLanguage] = None + smart_format: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="smartFormat")] = None + language_detection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="languageDetectionEnabled") + ] = None + keywords: typing.Optional[typing.List[str]] = None + endpointing: typing.Optional[float] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoTranscriber_Gladia(UniversalBaseModel): + """ + These are the options for the assistant's transcriber. + """ + + provider: typing.Literal["gladia"] = "gladia" + model: typing.Optional[GladiaTranscriberModel] = None + language_behaviour: typing_extensions.Annotated[ + typing.Optional[GladiaTranscriberLanguageBehaviour], FieldMetadata(alias="languageBehaviour") + ] = None + language: typing.Optional[GladiaTranscriberLanguage] = None + transcription_hint: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="transcriptionHint")] = ( + None + ) + prosody: typing.Optional[bool] = None + audio_enhancer: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="audioEnhancer")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoTranscriber_Talkscriber(UniversalBaseModel): + """ + These are the options for the assistant's transcriber. + """ + + provider: typing.Literal["talkscriber"] = "talkscriber" + model: typing.Optional[typing.Literal["whisper"]] = None + language: typing.Optional[TalkscriberTranscriberLanguage] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateAssistantDtoTranscriber = typing.Union[ + CreateAssistantDtoTranscriber_Deepgram, + CreateAssistantDtoTranscriber_Gladia, + CreateAssistantDtoTranscriber_Talkscriber, +] diff --git a/src/vapi/types/create_assistant_dto_voice.py b/src/vapi/types/create_assistant_dto_voice.py new file mode 100644 index 0000000..e2ba21a --- /dev/null +++ b/src/vapi/types/create_assistant_dto_voice.py @@ -0,0 +1,259 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .azure_voice_voice_id import AzureVoiceVoiceId +from .chunk_plan import ChunkPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .cartesia_voice_model import CartesiaVoiceModel +from .cartesia_voice_language import CartesiaVoiceLanguage +from .deepgram_voice_voice_id import DeepgramVoiceVoiceId +from .eleven_labs_voice_voice_id import ElevenLabsVoiceVoiceId +from .eleven_labs_voice_model import ElevenLabsVoiceModel +from .lmnt_voice_voice_id import LmntVoiceVoiceId +from .neets_voice_voice_id import NeetsVoiceVoiceId +from .open_ai_voice_voice_id import OpenAiVoiceVoiceId +from .play_ht_voice_voice_id import PlayHtVoiceVoiceId +from .play_ht_voice_emotion import PlayHtVoiceEmotion +from .rime_ai_voice_voice_id import RimeAiVoiceVoiceId +from .rime_ai_voice_model import RimeAiVoiceModel + + +class CreateAssistantDtoVoice_Azure(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["azure"] = "azure" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[AzureVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoVoice_Cartesia(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["cartesia"] = "cartesia" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + model: typing.Optional[CartesiaVoiceModel] = None + language: typing.Optional[CartesiaVoiceLanguage] = None + voice_id: typing_extensions.Annotated[str, FieldMetadata(alias="voiceId")] + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoVoice_Deepgram(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["deepgram"] = "deepgram" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[DeepgramVoiceVoiceId, FieldMetadata(alias="voiceId")] + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoVoice_11Labs(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["11labs"] = "11labs" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[ElevenLabsVoiceVoiceId, FieldMetadata(alias="voiceId")] + stability: typing.Optional[float] = None + similarity_boost: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="similarityBoost")] = None + style: typing.Optional[float] = None + use_speaker_boost: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="useSpeakerBoost")] = None + optimize_streaming_latency: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="optimizeStreamingLatency") + ] = None + enable_ssml_parsing: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="enableSsmlParsing") + ] = None + model: typing.Optional[ElevenLabsVoiceModel] = None + language: typing.Optional[str] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoVoice_Lmnt(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["lmnt"] = "lmnt" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[LmntVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoVoice_Neets(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["neets"] = "neets" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[NeetsVoiceVoiceId, FieldMetadata(alias="voiceId")] + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoVoice_Openai(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["openai"] = "openai" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[OpenAiVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoVoice_Playht(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["playht"] = "playht" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[PlayHtVoiceVoiceId, FieldMetadata(alias="voiceId")] + speed: typing.Optional[float] = None + temperature: typing.Optional[float] = None + emotion: typing.Optional[PlayHtVoiceEmotion] = None + voice_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="voiceGuidance")] = None + style_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="styleGuidance")] = None + text_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="textGuidance")] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateAssistantDtoVoice_RimeAi(UniversalBaseModel): + """ + These are the options for the assistant's voice. + """ + + provider: typing.Literal["rime-ai"] = "rime-ai" + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = None + voice_id: typing_extensions.Annotated[RimeAiVoiceVoiceId, FieldMetadata(alias="voiceId")] + model: typing.Optional[RimeAiVoiceModel] = None + speed: typing.Optional[float] = None + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateAssistantDtoVoice = typing.Union[ + CreateAssistantDtoVoice_Azure, + CreateAssistantDtoVoice_Cartesia, + CreateAssistantDtoVoice_Deepgram, + CreateAssistantDtoVoice_11Labs, + CreateAssistantDtoVoice_Lmnt, + CreateAssistantDtoVoice_Neets, + CreateAssistantDtoVoice_Openai, + CreateAssistantDtoVoice_Playht, + CreateAssistantDtoVoice_RimeAi, +] diff --git a/src/vapi/types/create_azure_open_ai_credential_dto.py b/src/vapi/types/create_azure_open_ai_credential_dto.py new file mode 100644 index 0000000..41822fa --- /dev/null +++ b/src/vapi/types/create_azure_open_ai_credential_dto.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .create_azure_open_ai_credential_dto_region import CreateAzureOpenAiCredentialDtoRegion +from .create_azure_open_ai_credential_dto_models_item import CreateAzureOpenAiCredentialDtoModelsItem +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateAzureOpenAiCredentialDto(UniversalBaseModel): + provider: typing.Literal["azure-openai"] = "azure-openai" + region: CreateAzureOpenAiCredentialDtoRegion + models: typing.List[CreateAzureOpenAiCredentialDtoModelsItem] + open_ai_key: typing_extensions.Annotated[str, FieldMetadata(alias="openAIKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + open_ai_endpoint: typing_extensions.Annotated[str, FieldMetadata(alias="openAIEndpoint")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_azure_open_ai_credential_dto_models_item.py b/src/vapi/types/create_azure_open_ai_credential_dto_models_item.py new file mode 100644 index 0000000..97e3f64 --- /dev/null +++ b/src/vapi/types/create_azure_open_ai_credential_dto_models_item.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateAzureOpenAiCredentialDtoModelsItem = typing.Union[ + typing.Literal[ + "gpt-4o-mini-2024-07-18", + "gpt-4o-2024-05-13", + "gpt-4-turbo-2024-04-09", + "gpt-4-0125-preview", + "gpt-4-1106-preview", + "gpt-4-0613", + "gpt-35-turbo-0125", + "gpt-35-turbo-1106", + ], + typing.Any, +] diff --git a/src/vapi/types/create_azure_open_ai_credential_dto_region.py b/src/vapi/types/create_azure_open_ai_credential_dto_region.py new file mode 100644 index 0000000..208ea50 --- /dev/null +++ b/src/vapi/types/create_azure_open_ai_credential_dto_region.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateAzureOpenAiCredentialDtoRegion = typing.Union[ + typing.Literal[ + "australia", + "canada", + "eastus2", + "eastus", + "france", + "india", + "japan", + "northcentralus", + "norway", + "southcentralus", + "sweden", + "switzerland", + "uk", + "westus", + "westus3", + ], + typing.Any, +] diff --git a/src/vapi/types/create_byo_phone_number_dto.py b/src/vapi/types/create_byo_phone_number_dto.py new file mode 100644 index 0000000..be806d9 --- /dev/null +++ b/src/vapi/types/create_byo_phone_number_dto.py @@ -0,0 +1,104 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateByoPhoneNumberDto(UniversalBaseModel): + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = pydantic.Field(default=None) + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = pydantic.Field(default=None) + """ + This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it. + + Use cases: + + - `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks. + - `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls. + + If `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\+?[a-zA-Z0-9]+$/`). + + @default true (E164 check is enabled) + """ + + number: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the number of the customer. + """ + + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] = pydantic.Field() + """ + This is the credential of your own SIP trunk or Carrier (type `byo-sip-trunk`) which can be used to make calls to this phone number. + + You can add the SIP trunk or Carrier credential in the Provider Credentials page on the Dashboard to get the credentialId. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the phone number. This is just for your own reference. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_byo_phone_number_dto_fallback_destination.py b/src/vapi/types/create_byo_phone_number_dto_fallback_destination.py new file mode 100644 index 0000000..f15eead --- /dev/null +++ b/src/vapi/types/create_byo_phone_number_dto_fallback_destination.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class CreateByoPhoneNumberDtoFallbackDestination_Number(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateByoPhoneNumberDtoFallbackDestination_Sip(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateByoPhoneNumberDtoFallbackDestination = typing.Union[ + CreateByoPhoneNumberDtoFallbackDestination_Number, CreateByoPhoneNumberDtoFallbackDestination_Sip +] diff --git a/src/vapi/types/create_byo_sip_trunk_credential_dto.py b/src/vapi/types/create_byo_sip_trunk_credential_dto.py new file mode 100644 index 0000000..6fd17ca --- /dev/null +++ b/src/vapi/types/create_byo_sip_trunk_credential_dto.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +from .sip_trunk_gateway import SipTrunkGateway +import typing_extensions +from .sip_trunk_outbound_authentication_plan import SipTrunkOutboundAuthenticationPlan +from ..core.serialization import FieldMetadata +from .sbc_configuration import SbcConfiguration +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateByoSipTrunkCredentialDto(UniversalBaseModel): + provider: typing.Optional[typing.Literal["byo-sip-trunk"]] = pydantic.Field(default=None) + """ + This can be used to bring your own SIP trunks or to connect to a Carrier. + """ + + gateways: typing.List[SipTrunkGateway] = pydantic.Field() + """ + This is the list of SIP trunk's gateways. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the SIP trunk. This is just for your reference. + """ + + outbound_authentication_plan: typing_extensions.Annotated[ + typing.Optional[SipTrunkOutboundAuthenticationPlan], FieldMetadata(alias="outboundAuthenticationPlan") + ] = pydantic.Field(default=None) + """ + This can be used to configure the outbound authentication if required by the SIP trunk. + """ + + outbound_leading_plus_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="outboundLeadingPlusEnabled") + ] = pydantic.Field(default=None) + """ + This ensures the outbound origination attempts have a leading plus. Defaults to false to match conventional telecom behavior. + + Usage: + + - Vonage/Twilio requires leading plus for all outbound calls. Set this to true. + + @default false + """ + + sbc_configuration: typing_extensions.Annotated[ + typing.Optional[SbcConfiguration], FieldMetadata(alias="sbcConfiguration") + ] = pydantic.Field(default=None) + """ + This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk's `gateways`, rather than the managed SBC provided by Vapi. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_cartesia_credential_dto.py b/src/vapi/types/create_cartesia_credential_dto.py new file mode 100644 index 0000000..7c275ca --- /dev/null +++ b/src/vapi/types/create_cartesia_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateCartesiaCredentialDto(UniversalBaseModel): + provider: typing.Literal["cartesia"] = "cartesia" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_conversation_block_dto.py b/src/vapi/types/create_conversation_block_dto.py new file mode 100644 index 0000000..7d76a6f --- /dev/null +++ b/src/vapi/types/create_conversation_block_dto.py @@ -0,0 +1,87 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .create_conversation_block_dto_messages_item import CreateConversationBlockDtoMessagesItem +import pydantic +import typing_extensions +from .json_schema import JsonSchema +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateConversationBlockDto(UniversalBaseModel): + messages: typing.Optional[typing.List[CreateConversationBlockDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the pre-configured messages that will be spoken to the user while the block is running. + """ + + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = ( + pydantic.Field(default=None) + ) + """ + This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` + + These are accessible as variables: + + - ({{input.propertyName}}) in context of the block execution (step) + - ({{stepName.input.propertyName}}) in context of the workflow + """ + + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = ( + pydantic.Field(default=None) + ) + """ + This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). + + These are accessible as variables: + + - ({{output.propertyName}}) in context of the block execution (step) + - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) + - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + """ + + instruction: str = pydantic.Field() + """ + This is the instruction to the model. + + You can reference any variable in the context of the current block execution (step): + + - "{{input.your-property-name}}" for the current step's input + - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) + - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) + - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) + - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) + - "{{workflow.input.your-property-name}}" for the current workflow's input + - "{{global.your-property-name}}" for the global context + + This can be as simple or as complex as you want it to be. + + - "say hello and ask the user about their day!" + - "collect the user's first and last name" + - "user is {{input.firstName}} {{input.lastName}}. their age is {{input.age}}. ask them about their salary and if they might be interested in buying a house. we offer {{input.offer}}" + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output/input.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output/input.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the block. This is just for your reference. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_conversation_block_dto_messages_item.py b/src/vapi/types/create_conversation_block_dto_messages_item.py new file mode 100644 index 0000000..7846242 --- /dev/null +++ b/src/vapi/types/create_conversation_block_dto_messages_item.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .block_start_message_conditions_item import BlockStartMessageConditionsItem +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .block_complete_message_conditions_item import BlockCompleteMessageConditionsItem + + +class CreateConversationBlockDtoMessagesItem_BlockStart(UniversalBaseModel): + type: typing.Literal["block-start"] = "block-start" + conditions: typing.Optional[typing.List[BlockStartMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateConversationBlockDtoMessagesItem_BlockComplete(UniversalBaseModel): + type: typing.Literal["block-complete"] = "block-complete" + conditions: typing.Optional[typing.List[BlockCompleteMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateConversationBlockDtoMessagesItem = typing.Union[ + CreateConversationBlockDtoMessagesItem_BlockStart, CreateConversationBlockDtoMessagesItem_BlockComplete +] diff --git a/src/vapi/types/create_custom_llm_credential_dto.py b/src/vapi/types/create_custom_llm_credential_dto.py new file mode 100644 index 0000000..ad87dd7 --- /dev/null +++ b/src/vapi/types/create_custom_llm_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateCustomLlmCredentialDto(UniversalBaseModel): + provider: typing.Literal["custom-llm"] = "custom-llm" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_customer_dto.py b/src/vapi/types/create_customer_dto.py new file mode 100644 index 0000000..e0481e4 --- /dev/null +++ b/src/vapi/types/create_customer_dto.py @@ -0,0 +1,59 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateCustomerDto(UniversalBaseModel): + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = pydantic.Field(default=None) + """ + This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it. + + Use cases: + + - `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks. + - `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls. + + If `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\+?[a-zA-Z0-9]+$/`). + + @default true (E164 check is enabled) + """ + + extension: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the extension that will be dialed after the call is answered. + """ + + number: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the number of the customer. + """ + + sip_uri: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="sipUri")] = pydantic.Field( + default=None + ) + """ + This is the SIP URI of the customer. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the customer. This is just for your own reference. + + For SIP inbound calls, this is extracted from the `From` SIP header with format `"Display Name" `. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_deep_infra_credential_dto.py b/src/vapi/types/create_deep_infra_credential_dto.py new file mode 100644 index 0000000..96a3da0 --- /dev/null +++ b/src/vapi/types/create_deep_infra_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateDeepInfraCredentialDto(UniversalBaseModel): + provider: typing.Literal["deepinfra"] = "deepinfra" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_deepgram_credential_dto.py b/src/vapi/types/create_deepgram_credential_dto.py new file mode 100644 index 0000000..884c0d0 --- /dev/null +++ b/src/vapi/types/create_deepgram_credential_dto.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateDeepgramCredentialDto(UniversalBaseModel): + provider: typing.Literal["deepgram"] = "deepgram" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + api_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="apiUrl")] = pydantic.Field( + default=None + ) + """ + This can be used to point to an onprem Deepgram instance. Defaults to api.deepgram.com. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_dtmf_tool_dto.py b/src/vapi/types/create_dtmf_tool_dto.py new file mode 100644 index 0000000..1ed8d5f --- /dev/null +++ b/src/vapi/types/create_dtmf_tool_dto.py @@ -0,0 +1,60 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateDtmfToolDto(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_dtmf_tool_dto_messages_item.py b/src/vapi/types/create_dtmf_tool_dto_messages_item.py new file mode 100644 index 0000000..d4cdbf3 --- /dev/null +++ b/src/vapi/types/create_dtmf_tool_dto_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class CreateDtmfToolDtoMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateDtmfToolDtoMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateDtmfToolDtoMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateDtmfToolDtoMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateDtmfToolDtoMessagesItem = typing.Union[ + CreateDtmfToolDtoMessagesItem_RequestStart, + CreateDtmfToolDtoMessagesItem_RequestComplete, + CreateDtmfToolDtoMessagesItem_RequestFailed, + CreateDtmfToolDtoMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/create_eleven_labs_credential_dto.py b/src/vapi/types/create_eleven_labs_credential_dto.py new file mode 100644 index 0000000..12aeedc --- /dev/null +++ b/src/vapi/types/create_eleven_labs_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateElevenLabsCredentialDto(UniversalBaseModel): + provider: typing.Literal["11labs"] = "11labs" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_end_call_tool_dto.py b/src/vapi/types/create_end_call_tool_dto.py new file mode 100644 index 0000000..b8f095d --- /dev/null +++ b/src/vapi/types/create_end_call_tool_dto.py @@ -0,0 +1,60 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateEndCallToolDto(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_end_call_tool_dto_messages_item.py b/src/vapi/types/create_end_call_tool_dto_messages_item.py new file mode 100644 index 0000000..6ffd77d --- /dev/null +++ b/src/vapi/types/create_end_call_tool_dto_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class CreateEndCallToolDtoMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateEndCallToolDtoMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateEndCallToolDtoMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateEndCallToolDtoMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateEndCallToolDtoMessagesItem = typing.Union[ + CreateEndCallToolDtoMessagesItem_RequestStart, + CreateEndCallToolDtoMessagesItem_RequestComplete, + CreateEndCallToolDtoMessagesItem_RequestFailed, + CreateEndCallToolDtoMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/create_function_tool_dto.py b/src/vapi/types/create_function_tool_dto.py new file mode 100644 index 0000000..e43b965 --- /dev/null +++ b/src/vapi/types/create_function_tool_dto.py @@ -0,0 +1,60 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateFunctionToolDto(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_function_tool_dto_messages_item.py b/src/vapi/types/create_function_tool_dto_messages_item.py new file mode 100644 index 0000000..74c1e1e --- /dev/null +++ b/src/vapi/types/create_function_tool_dto_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class CreateFunctionToolDtoMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateFunctionToolDtoMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateFunctionToolDtoMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateFunctionToolDtoMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateFunctionToolDtoMessagesItem = typing.Union[ + CreateFunctionToolDtoMessagesItem_RequestStart, + CreateFunctionToolDtoMessagesItem_RequestComplete, + CreateFunctionToolDtoMessagesItem_RequestFailed, + CreateFunctionToolDtoMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/create_gcp_credential_dto.py b/src/vapi/types/create_gcp_credential_dto.py new file mode 100644 index 0000000..8869673 --- /dev/null +++ b/src/vapi/types/create_gcp_credential_dto.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from .gcp_key import GcpKey +from ..core.serialization import FieldMetadata +from .bucket_plan import BucketPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateGcpCredentialDto(UniversalBaseModel): + provider: typing.Literal["gcp"] = "gcp" + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the GCP credential. This is just for your reference. + """ + + gcp_key: typing_extensions.Annotated[GcpKey, FieldMetadata(alias="gcpKey")] = pydantic.Field() + """ + This is the GCP key. This is the JSON that can be generated in the Google Cloud Console at https://console.cloud.google.com/iam-admin/serviceaccounts/details//keys. + + The schema is identical to the JSON that GCP outputs. + """ + + bucket_plan: typing_extensions.Annotated[typing.Optional[BucketPlan], FieldMetadata(alias="bucketPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the bucket plan that can be provided to store call artifacts in GCP. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_ghl_tool_dto.py b/src/vapi/types/create_ghl_tool_dto.py new file mode 100644 index 0000000..a69bd90 --- /dev/null +++ b/src/vapi/types/create_ghl_tool_dto.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateGhlToolDto(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_ghl_tool_dto_messages_item.py b/src/vapi/types/create_ghl_tool_dto_messages_item.py new file mode 100644 index 0000000..d044b92 --- /dev/null +++ b/src/vapi/types/create_ghl_tool_dto_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class CreateGhlToolDtoMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateGhlToolDtoMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateGhlToolDtoMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateGhlToolDtoMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateGhlToolDtoMessagesItem = typing.Union[ + CreateGhlToolDtoMessagesItem_RequestStart, + CreateGhlToolDtoMessagesItem_RequestComplete, + CreateGhlToolDtoMessagesItem_RequestFailed, + CreateGhlToolDtoMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/create_gladia_credential_dto.py b/src/vapi/types/create_gladia_credential_dto.py new file mode 100644 index 0000000..798377f --- /dev/null +++ b/src/vapi/types/create_gladia_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateGladiaCredentialDto(UniversalBaseModel): + provider: typing.Literal["gladia"] = "gladia" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_go_high_level_credential_dto.py b/src/vapi/types/create_go_high_level_credential_dto.py new file mode 100644 index 0000000..2b3a7c7 --- /dev/null +++ b/src/vapi/types/create_go_high_level_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateGoHighLevelCredentialDto(UniversalBaseModel): + provider: typing.Literal["gohighlevel"] = "gohighlevel" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_groq_credential_dto.py b/src/vapi/types/create_groq_credential_dto.py new file mode 100644 index 0000000..40d67a7 --- /dev/null +++ b/src/vapi/types/create_groq_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateGroqCredentialDto(UniversalBaseModel): + provider: typing.Literal["groq"] = "groq" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_lmnt_credential_dto.py b/src/vapi/types/create_lmnt_credential_dto.py new file mode 100644 index 0000000..cb3e516 --- /dev/null +++ b/src/vapi/types/create_lmnt_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateLmntCredentialDto(UniversalBaseModel): + provider: typing.Literal["lmnt"] = "lmnt" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_make_credential_dto.py b/src/vapi/types/create_make_credential_dto.py new file mode 100644 index 0000000..461f9c8 --- /dev/null +++ b/src/vapi/types/create_make_credential_dto.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateMakeCredentialDto(UniversalBaseModel): + provider: typing.Literal["make"] = "make" + team_id: typing_extensions.Annotated[str, FieldMetadata(alias="teamId")] = pydantic.Field() + """ + Team ID + """ + + region: str = pydantic.Field() + """ + Region of your application. For example: eu1, eu2, us1, us2 + """ + + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_make_tool_dto.py b/src/vapi/types/create_make_tool_dto.py new file mode 100644 index 0000000..e6c109f --- /dev/null +++ b/src/vapi/types/create_make_tool_dto.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateMakeToolDto(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_make_tool_dto_messages_item.py b/src/vapi/types/create_make_tool_dto_messages_item.py new file mode 100644 index 0000000..5e44103 --- /dev/null +++ b/src/vapi/types/create_make_tool_dto_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class CreateMakeToolDtoMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateMakeToolDtoMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateMakeToolDtoMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateMakeToolDtoMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateMakeToolDtoMessagesItem = typing.Union[ + CreateMakeToolDtoMessagesItem_RequestStart, + CreateMakeToolDtoMessagesItem_RequestComplete, + CreateMakeToolDtoMessagesItem_RequestFailed, + CreateMakeToolDtoMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/create_open_ai_credential_dto.py b/src/vapi/types/create_open_ai_credential_dto.py new file mode 100644 index 0000000..0e19c57 --- /dev/null +++ b/src/vapi/types/create_open_ai_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateOpenAiCredentialDto(UniversalBaseModel): + provider: typing.Literal["openai"] = "openai" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_open_router_credential_dto.py b/src/vapi/types/create_open_router_credential_dto.py new file mode 100644 index 0000000..9985829 --- /dev/null +++ b/src/vapi/types/create_open_router_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateOpenRouterCredentialDto(UniversalBaseModel): + provider: typing.Literal["openrouter"] = "openrouter" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_org_dto.py b/src/vapi/types/create_org_dto.py new file mode 100644 index 0000000..16f6435 --- /dev/null +++ b/src/vapi/types/create_org_dto.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateOrgDto(UniversalBaseModel): + hipaa_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="hipaaEnabled")] = ( + pydantic.Field(default=None) + ) + """ + When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + When HIPAA is enabled, only OpenAI/Custom LLM or Azure Providers will be available for LLM and Voice respectively. + This is due to the compliance requirements of HIPAA. Other providers may not meet these requirements. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the org. This is just for your own reference. + """ + + billing_limit: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="billingLimit")] = ( + pydantic.Field(default=None) + ) + """ + This is the monthly billing limit for the org. To go beyond $1000/mo, please contact us at support@vapi.ai. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + + All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + """ + + concurrency_limit: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="concurrencyLimit")] = ( + pydantic.Field(default=None) + ) + """ + This is the concurrency limit for the org. This is the maximum number of calls that can be active at any given time. To go beyond 10, please contact us at support@vapi.ai. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_outbound_call_dto.py b/src/vapi/types/create_outbound_call_dto.py new file mode 100644 index 0000000..6c0d05e --- /dev/null +++ b/src/vapi/types/create_outbound_call_dto.py @@ -0,0 +1,104 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_assistant_dto import CreateAssistantDto +from .assistant_overrides import AssistantOverrides +from .create_squad_dto import CreateSquadDto +from .import_twilio_phone_number_dto import ImportTwilioPhoneNumberDto +from .create_customer_dto import CreateCustomerDto +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class CreateOutboundCallDto(UniversalBaseModel): + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the call. This is just for your own reference. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. + """ + + assistant_overrides: typing_extensions.Annotated[ + typing.Optional[AssistantOverrides], FieldMetadata(alias="assistantOverrides") + ] = pydantic.Field(default=None) + """ + These are the overrides for the `assistant` or `assistantId`'s settings and template variables. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + """ + + squad: typing.Optional[CreateSquadDto] = pydantic.Field(default=None) + """ + This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + """ + + phone_number_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="phoneNumberId")] = ( + pydantic.Field(default=None) + ) + """ + This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + """ + + phone_number: typing_extensions.Annotated[ + typing.Optional[ImportTwilioPhoneNumberDto], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + """ + + customer_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customerId")] = pydantic.Field( + default=None + ) + """ + This is the customer that will be called. To call a transient customer , use `customer` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer that will be called. To call an existing customer, use `customerId` instead. + + Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, CreateOutboundCallDto=CreateOutboundCallDto) +update_forward_refs(CreateWorkflowBlockDto, CreateOutboundCallDto=CreateOutboundCallDto) +update_forward_refs(HandoffStep, CreateOutboundCallDto=CreateOutboundCallDto) diff --git a/src/vapi/types/create_output_tool_dto.py b/src/vapi/types/create_output_tool_dto.py new file mode 100644 index 0000000..c61d1c2 --- /dev/null +++ b/src/vapi/types/create_output_tool_dto.py @@ -0,0 +1,60 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .create_output_tool_dto_messages_item import CreateOutputToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateOutputToolDto(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[CreateOutputToolDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_output_tool_dto_messages_item.py b/src/vapi/types/create_output_tool_dto_messages_item.py new file mode 100644 index 0000000..1ffbe5d --- /dev/null +++ b/src/vapi/types/create_output_tool_dto_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class CreateOutputToolDtoMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateOutputToolDtoMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateOutputToolDtoMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateOutputToolDtoMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateOutputToolDtoMessagesItem = typing.Union[ + CreateOutputToolDtoMessagesItem_RequestStart, + CreateOutputToolDtoMessagesItem_RequestComplete, + CreateOutputToolDtoMessagesItem_RequestFailed, + CreateOutputToolDtoMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/create_perplexity_ai_credential_dto.py b/src/vapi/types/create_perplexity_ai_credential_dto.py new file mode 100644 index 0000000..b47d72f --- /dev/null +++ b/src/vapi/types/create_perplexity_ai_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreatePerplexityAiCredentialDto(UniversalBaseModel): + provider: typing.Literal["perplexity-ai"] = "perplexity-ai" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_play_ht_credential_dto.py b/src/vapi/types/create_play_ht_credential_dto.py new file mode 100644 index 0000000..79b83a6 --- /dev/null +++ b/src/vapi/types/create_play_ht_credential_dto.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreatePlayHtCredentialDto(UniversalBaseModel): + provider: typing.Literal["playht"] = "playht" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + user_id: typing_extensions.Annotated[str, FieldMetadata(alias="userId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_rime_ai_credential_dto.py b/src/vapi/types/create_rime_ai_credential_dto.py new file mode 100644 index 0000000..ce70aba --- /dev/null +++ b/src/vapi/types/create_rime_ai_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateRimeAiCredentialDto(UniversalBaseModel): + provider: typing.Literal["rime-ai"] = "rime-ai" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_runpod_credential_dto.py b/src/vapi/types/create_runpod_credential_dto.py new file mode 100644 index 0000000..e3cdfed --- /dev/null +++ b/src/vapi/types/create_runpod_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateRunpodCredentialDto(UniversalBaseModel): + provider: typing.Literal["runpod"] = "runpod" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_s_3_credential_dto.py b/src/vapi/types/create_s_3_credential_dto.py new file mode 100644 index 0000000..3e56e58 --- /dev/null +++ b/src/vapi/types/create_s_3_credential_dto.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateS3CredentialDto(UniversalBaseModel): + provider: typing.Literal["s3"] = pydantic.Field(default="s3") + """ + Credential provider. Only allowed value is s3 + """ + + aws_access_key_id: typing_extensions.Annotated[str, FieldMetadata(alias="awsAccessKeyId")] = pydantic.Field() + """ + AWS access key ID. + """ + + aws_secret_access_key: typing_extensions.Annotated[str, FieldMetadata(alias="awsSecretAccessKey")] = ( + pydantic.Field() + ) + """ + AWS access key secret. This is not returned in the API. + """ + + region: str = pydantic.Field() + """ + AWS region in which the S3 bucket is located. + """ + + s_3_bucket_name: typing_extensions.Annotated[str, FieldMetadata(alias="s3BucketName")] = pydantic.Field() + """ + AWS S3 bucket name. + """ + + s_3_path_prefix: typing_extensions.Annotated[str, FieldMetadata(alias="s3PathPrefix")] = pydantic.Field() + """ + The path prefix for the uploaded recording. Ex. "recordings/" + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_squad_dto.py b/src/vapi/types/create_squad_dto.py new file mode 100644 index 0000000..045e0de --- /dev/null +++ b/src/vapi/types/create_squad_dto.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing +import pydantic +from .squad_member_dto import SquadMemberDto +import typing_extensions +from .assistant_overrides import AssistantOverrides +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class CreateSquadDto(UniversalBaseModel): + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the squad. + """ + + members: typing.List[SquadMemberDto] = pydantic.Field() + """ + This is the list of assistants that make up the squad. + + The call will start with the first assistant in the list. + """ + + members_overrides: typing_extensions.Annotated[ + typing.Optional[AssistantOverrides], FieldMetadata(alias="membersOverrides") + ] = pydantic.Field(default=None) + """ + This can be used to override all the assistants' settings and provide values for their template variables. + + Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, CreateSquadDto=CreateSquadDto) +update_forward_refs(CreateWorkflowBlockDto, CreateSquadDto=CreateSquadDto) +update_forward_refs(HandoffStep, CreateSquadDto=CreateSquadDto) diff --git a/src/vapi/types/create_together_ai_credential_dto.py b/src/vapi/types/create_together_ai_credential_dto.py new file mode 100644 index 0000000..4f4c4c2 --- /dev/null +++ b/src/vapi/types/create_together_ai_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateTogetherAiCredentialDto(UniversalBaseModel): + provider: typing.Literal["together-ai"] = "together-ai" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_token_dto.py b/src/vapi/types/create_token_dto.py new file mode 100644 index 0000000..14ff97c --- /dev/null +++ b/src/vapi/types/create_token_dto.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .create_token_dto_tag import CreateTokenDtoTag +import pydantic +from .token_restrictions import TokenRestrictions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateTokenDto(UniversalBaseModel): + tag: typing.Optional[CreateTokenDtoTag] = pydantic.Field(default=None) + """ + This is the tag for the token. It represents its scope. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the token. This is just for your own reference. + """ + + restrictions: typing.Optional[TokenRestrictions] = pydantic.Field(default=None) + """ + This are the restrictions for the token. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_token_dto_tag.py b/src/vapi/types/create_token_dto_tag.py new file mode 100644 index 0000000..533bd1e --- /dev/null +++ b/src/vapi/types/create_token_dto_tag.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateTokenDtoTag = typing.Union[typing.Literal["private", "public"], typing.Any] diff --git a/src/vapi/types/create_tool_call_block_dto.py b/src/vapi/types/create_tool_call_block_dto.py new file mode 100644 index 0000000..39a3759 --- /dev/null +++ b/src/vapi/types/create_tool_call_block_dto.py @@ -0,0 +1,74 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .create_tool_call_block_dto_messages_item import CreateToolCallBlockDtoMessagesItem +import pydantic +import typing_extensions +from .json_schema import JsonSchema +from ..core.serialization import FieldMetadata +from .create_tool_call_block_dto_tool import CreateToolCallBlockDtoTool +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateToolCallBlockDto(UniversalBaseModel): + messages: typing.Optional[typing.List[CreateToolCallBlockDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the pre-configured messages that will be spoken to the user while the block is running. + """ + + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = ( + pydantic.Field(default=None) + ) + """ + This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` + + These are accessible as variables: + + - ({{input.propertyName}}) in context of the block execution (step) + - ({{stepName.input.propertyName}}) in context of the workflow + """ + + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = ( + pydantic.Field(default=None) + ) + """ + This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). + + These are accessible as variables: + + - ({{output.propertyName}}) in context of the block execution (step) + - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) + - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + """ + + tool: typing.Optional[CreateToolCallBlockDtoTool] = pydantic.Field(default=None) + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + tool_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="toolId")] = pydantic.Field( + default=None + ) + """ + This is the id of the tool that the block will call. To use a transient tool, use `tool`. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the block. This is just for your reference. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_tool_call_block_dto_messages_item.py b/src/vapi/types/create_tool_call_block_dto_messages_item.py new file mode 100644 index 0000000..6a73ae5 --- /dev/null +++ b/src/vapi/types/create_tool_call_block_dto_messages_item.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .block_start_message_conditions_item import BlockStartMessageConditionsItem +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .block_complete_message_conditions_item import BlockCompleteMessageConditionsItem + + +class CreateToolCallBlockDtoMessagesItem_BlockStart(UniversalBaseModel): + type: typing.Literal["block-start"] = "block-start" + conditions: typing.Optional[typing.List[BlockStartMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolCallBlockDtoMessagesItem_BlockComplete(UniversalBaseModel): + type: typing.Literal["block-complete"] = "block-complete" + conditions: typing.Optional[typing.List[BlockCompleteMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateToolCallBlockDtoMessagesItem = typing.Union[ + CreateToolCallBlockDtoMessagesItem_BlockStart, CreateToolCallBlockDtoMessagesItem_BlockComplete +] diff --git a/src/vapi/types/create_tool_call_block_dto_tool.py b/src/vapi/types/create_tool_call_block_dto_tool.py new file mode 100644 index 0000000..020bb70 --- /dev/null +++ b/src/vapi/types/create_tool_call_block_dto_tool.py @@ -0,0 +1,182 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class CreateToolCallBlockDtoTool_Dtmf(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolCallBlockDtoTool_EndCall(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolCallBlockDtoTool_Voicemail(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolCallBlockDtoTool_Function(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolCallBlockDtoTool_Ghl(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolCallBlockDtoTool_Make(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolCallBlockDtoTool_TransferCall(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateToolCallBlockDtoTool = typing.Union[ + CreateToolCallBlockDtoTool_Dtmf, + CreateToolCallBlockDtoTool_EndCall, + CreateToolCallBlockDtoTool_Voicemail, + CreateToolCallBlockDtoTool_Function, + CreateToolCallBlockDtoTool_Ghl, + CreateToolCallBlockDtoTool_Make, + CreateToolCallBlockDtoTool_TransferCall, +] diff --git a/src/vapi/types/create_tool_template_dto.py b/src/vapi/types/create_tool_template_dto.py new file mode 100644 index 0000000..8dcbea3 --- /dev/null +++ b/src/vapi/types/create_tool_template_dto.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .create_tool_template_dto_details import CreateToolTemplateDtoDetails +import typing_extensions +from .create_tool_template_dto_provider_details import CreateToolTemplateDtoProviderDetails +from ..core.serialization import FieldMetadata +from .tool_template_metadata import ToolTemplateMetadata +from .create_tool_template_dto_visibility import CreateToolTemplateDtoVisibility +import pydantic +from .create_tool_template_dto_provider import CreateToolTemplateDtoProvider +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateToolTemplateDto(UniversalBaseModel): + details: typing.Optional[CreateToolTemplateDtoDetails] = None + provider_details: typing_extensions.Annotated[ + typing.Optional[CreateToolTemplateDtoProviderDetails], FieldMetadata(alias="providerDetails") + ] = None + metadata: typing.Optional[ToolTemplateMetadata] = None + visibility: typing.Optional[CreateToolTemplateDtoVisibility] = None + type: typing.Literal["tool"] = "tool" + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The name of the template. This is just for your own reference. + """ + + provider: typing.Optional[CreateToolTemplateDtoProvider] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_tool_template_dto_details.py b/src/vapi/types/create_tool_template_dto_details.py new file mode 100644 index 0000000..6965e49 --- /dev/null +++ b/src/vapi/types/create_tool_template_dto_details.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class CreateToolTemplateDtoDetails_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolTemplateDtoDetails_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolTemplateDtoDetails_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolTemplateDtoDetails_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolTemplateDtoDetails_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolTemplateDtoDetails_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolTemplateDtoDetails_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateToolTemplateDtoDetails = typing.Union[ + CreateToolTemplateDtoDetails_Dtmf, + CreateToolTemplateDtoDetails_EndCall, + CreateToolTemplateDtoDetails_Voicemail, + CreateToolTemplateDtoDetails_Function, + CreateToolTemplateDtoDetails_Ghl, + CreateToolTemplateDtoDetails_Make, + CreateToolTemplateDtoDetails_TransferCall, +] diff --git a/src/vapi/types/create_tool_template_dto_provider.py b/src/vapi/types/create_tool_template_dto_provider.py new file mode 100644 index 0000000..2d5db5c --- /dev/null +++ b/src/vapi/types/create_tool_template_dto_provider.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateToolTemplateDtoProvider = typing.Union[typing.Literal["make", "gohighlevel", "function"], typing.Any] diff --git a/src/vapi/types/create_tool_template_dto_provider_details.py b/src/vapi/types/create_tool_template_dto_provider_details.py new file mode 100644 index 0000000..0de92c5 --- /dev/null +++ b/src/vapi/types/create_tool_template_dto_provider_details.py @@ -0,0 +1,77 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .tool_template_setup import ToolTemplateSetup +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class CreateToolTemplateDtoProviderDetails_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + template_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateUrl")] = None + setup_instructions: typing_extensions.Annotated[ + typing.Optional[typing.List[ToolTemplateSetup]], FieldMetadata(alias="setupInstructions") + ] = None + scenario_id: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="scenarioId")] = None + scenario_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="scenarioName")] = None + trigger_hook_id: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="triggerHookId")] = None + trigger_hook_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="triggerHookName")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolTemplateDtoProviderDetails_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + template_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateUrl")] = None + setup_instructions: typing_extensions.Annotated[ + typing.Optional[typing.List[ToolTemplateSetup]], FieldMetadata(alias="setupInstructions") + ] = None + workflow_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="workflowId")] = None + workflow_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="workflowName")] = None + webhook_hook_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="webhookHookId")] = None + webhook_hook_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="webhookHookName")] = None + location_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="locationId")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateToolTemplateDtoProviderDetails_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + template_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateUrl")] = None + setup_instructions: typing_extensions.Annotated[ + typing.Optional[typing.List[ToolTemplateSetup]], FieldMetadata(alias="setupInstructions") + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateToolTemplateDtoProviderDetails = typing.Union[ + CreateToolTemplateDtoProviderDetails_Make, + CreateToolTemplateDtoProviderDetails_Ghl, + CreateToolTemplateDtoProviderDetails_Function, +] diff --git a/src/vapi/types/create_tool_template_dto_visibility.py b/src/vapi/types/create_tool_template_dto_visibility.py new file mode 100644 index 0000000..01a2fa5 --- /dev/null +++ b/src/vapi/types/create_tool_template_dto_visibility.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateToolTemplateDtoVisibility = typing.Union[typing.Literal["public", "private"], typing.Any] diff --git a/src/vapi/types/create_transfer_call_tool_dto.py b/src/vapi/types/create_transfer_call_tool_dto.py new file mode 100644 index 0000000..5a7ad1a --- /dev/null +++ b/src/vapi/types/create_transfer_call_tool_dto.py @@ -0,0 +1,66 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateTransferCallToolDto(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = pydantic.Field(default=None) + """ + These are the destinations that the call can be transferred to. If no destinations are provided, server.url will be used to get the transfer destination once the tool is called. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_transfer_call_tool_dto_destinations_item.py b/src/vapi/types/create_transfer_call_tool_dto_destinations_item.py new file mode 100644 index 0000000..4264ded --- /dev/null +++ b/src/vapi/types/create_transfer_call_tool_dto_destinations_item.py @@ -0,0 +1,90 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .transfer_destination_assistant_transfer_mode import TransferDestinationAssistantTransferMode +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class CreateTransferCallToolDtoDestinationsItem_Assistant(UniversalBaseModel): + type: typing.Literal["assistant"] = "assistant" + transfer_mode: typing_extensions.Annotated[ + typing.Optional[TransferDestinationAssistantTransferMode], FieldMetadata(alias="transferMode") + ] = None + assistant_name: typing_extensions.Annotated[str, FieldMetadata(alias="assistantName")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateTransferCallToolDtoDestinationsItem_Step(UniversalBaseModel): + type: typing.Literal["step"] = "step" + step_name: typing_extensions.Annotated[str, FieldMetadata(alias="stepName")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateTransferCallToolDtoDestinationsItem_Number(UniversalBaseModel): + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateTransferCallToolDtoDestinationsItem_Sip(UniversalBaseModel): + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateTransferCallToolDtoDestinationsItem = typing.Union[ + CreateTransferCallToolDtoDestinationsItem_Assistant, + CreateTransferCallToolDtoDestinationsItem_Step, + CreateTransferCallToolDtoDestinationsItem_Number, + CreateTransferCallToolDtoDestinationsItem_Sip, +] diff --git a/src/vapi/types/create_transfer_call_tool_dto_messages_item.py b/src/vapi/types/create_transfer_call_tool_dto_messages_item.py new file mode 100644 index 0000000..d3b3d26 --- /dev/null +++ b/src/vapi/types/create_transfer_call_tool_dto_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class CreateTransferCallToolDtoMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateTransferCallToolDtoMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateTransferCallToolDtoMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateTransferCallToolDtoMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateTransferCallToolDtoMessagesItem = typing.Union[ + CreateTransferCallToolDtoMessagesItem_RequestStart, + CreateTransferCallToolDtoMessagesItem_RequestComplete, + CreateTransferCallToolDtoMessagesItem_RequestFailed, + CreateTransferCallToolDtoMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/create_twilio_credential_dto.py b/src/vapi/types/create_twilio_credential_dto.py new file mode 100644 index 0000000..0a11e75 --- /dev/null +++ b/src/vapi/types/create_twilio_credential_dto.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateTwilioCredentialDto(UniversalBaseModel): + provider: typing.Literal["twilio"] = "twilio" + auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="authToken")] = pydantic.Field() + """ + This is not returned in the API. + """ + + account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="accountSid")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_twilio_phone_number_dto.py b/src/vapi/types/create_twilio_phone_number_dto.py new file mode 100644 index 0000000..8c68769 --- /dev/null +++ b/src/vapi/types/create_twilio_phone_number_dto.py @@ -0,0 +1,91 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateTwilioPhoneNumberDto(UniversalBaseModel): + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = pydantic.Field(default=None) + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + number: str = pydantic.Field() + """ + These are the digits of the phone number you own on your Twilio. + """ + + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] = pydantic.Field() + """ + This is the Twilio Account SID for the phone number. + """ + + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] = pydantic.Field() + """ + This is the Twilio Auth Token for the phone number. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the phone number. This is just for your own reference. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_twilio_phone_number_dto_fallback_destination.py b/src/vapi/types/create_twilio_phone_number_dto_fallback_destination.py new file mode 100644 index 0000000..2089ae4 --- /dev/null +++ b/src/vapi/types/create_twilio_phone_number_dto_fallback_destination.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class CreateTwilioPhoneNumberDtoFallbackDestination_Number(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateTwilioPhoneNumberDtoFallbackDestination_Sip(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateTwilioPhoneNumberDtoFallbackDestination = typing.Union[ + CreateTwilioPhoneNumberDtoFallbackDestination_Number, CreateTwilioPhoneNumberDtoFallbackDestination_Sip +] diff --git a/src/vapi/types/create_vapi_phone_number_dto.py b/src/vapi/types/create_vapi_phone_number_dto.py new file mode 100644 index 0000000..a22e147 --- /dev/null +++ b/src/vapi/types/create_vapi_phone_number_dto.py @@ -0,0 +1,83 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateVapiPhoneNumberDto(UniversalBaseModel): + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = pydantic.Field(default=None) + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] = pydantic.Field() + """ + This is the SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer. + + This is case-insensitive. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the phone number. This is just for your own reference. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_vapi_phone_number_dto_fallback_destination.py b/src/vapi/types/create_vapi_phone_number_dto_fallback_destination.py new file mode 100644 index 0000000..b3a6381 --- /dev/null +++ b/src/vapi/types/create_vapi_phone_number_dto_fallback_destination.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class CreateVapiPhoneNumberDtoFallbackDestination_Number(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateVapiPhoneNumberDtoFallbackDestination_Sip(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateVapiPhoneNumberDtoFallbackDestination = typing.Union[ + CreateVapiPhoneNumberDtoFallbackDestination_Number, CreateVapiPhoneNumberDtoFallbackDestination_Sip +] diff --git a/src/vapi/types/create_voicemail_tool_dto.py b/src/vapi/types/create_voicemail_tool_dto.py new file mode 100644 index 0000000..7b1323e --- /dev/null +++ b/src/vapi/types/create_voicemail_tool_dto.py @@ -0,0 +1,60 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateVoicemailToolDto(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_voicemail_tool_dto_messages_item.py b/src/vapi/types/create_voicemail_tool_dto_messages_item.py new file mode 100644 index 0000000..f8643b9 --- /dev/null +++ b/src/vapi/types/create_voicemail_tool_dto_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class CreateVoicemailToolDtoMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateVoicemailToolDtoMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateVoicemailToolDtoMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateVoicemailToolDtoMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateVoicemailToolDtoMessagesItem = typing.Union[ + CreateVoicemailToolDtoMessagesItem_RequestStart, + CreateVoicemailToolDtoMessagesItem_RequestComplete, + CreateVoicemailToolDtoMessagesItem_RequestFailed, + CreateVoicemailToolDtoMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/create_vonage_credential_dto.py b/src/vapi/types/create_vonage_credential_dto.py new file mode 100644 index 0000000..ad1e492 --- /dev/null +++ b/src/vapi/types/create_vonage_credential_dto.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateVonageCredentialDto(UniversalBaseModel): + provider: typing.Literal["vonage"] = "vonage" + api_secret: typing_extensions.Annotated[str, FieldMetadata(alias="apiSecret")] = pydantic.Field() + """ + This is not returned in the API. + """ + + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_vonage_phone_number_dto.py b/src/vapi/types/create_vonage_phone_number_dto.py new file mode 100644 index 0000000..1ec8df9 --- /dev/null +++ b/src/vapi/types/create_vonage_phone_number_dto.py @@ -0,0 +1,86 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateVonagePhoneNumberDto(UniversalBaseModel): + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = pydantic.Field(default=None) + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + number: str = pydantic.Field() + """ + These are the digits of the phone number you own on your Vonage. + """ + + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] = pydantic.Field() + """ + This is the credential that is used to make outgoing calls, and do operations like call transfer and hang up. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the phone number. This is just for your own reference. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_vonage_phone_number_dto_fallback_destination.py b/src/vapi/types/create_vonage_phone_number_dto_fallback_destination.py new file mode 100644 index 0000000..7c1c54c --- /dev/null +++ b/src/vapi/types/create_vonage_phone_number_dto_fallback_destination.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class CreateVonagePhoneNumberDtoFallbackDestination_Number(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateVonagePhoneNumberDtoFallbackDestination_Sip(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateVonagePhoneNumberDtoFallbackDestination = typing.Union[ + CreateVonagePhoneNumberDtoFallbackDestination_Number, CreateVonagePhoneNumberDtoFallbackDestination_Sip +] diff --git a/src/vapi/types/create_web_call_dto.py b/src/vapi/types/create_web_call_dto.py new file mode 100644 index 0000000..0ba28ee --- /dev/null +++ b/src/vapi/types/create_web_call_dto.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .create_assistant_dto import CreateAssistantDto +from .assistant_overrides import AssistantOverrides +from .create_squad_dto import CreateSquadDto +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class CreateWebCallDto(UniversalBaseModel): + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. + """ + + assistant_overrides: typing_extensions.Annotated[ + typing.Optional[AssistantOverrides], FieldMetadata(alias="assistantOverrides") + ] = pydantic.Field(default=None) + """ + These are the overrides for the `assistant` or `assistantId`'s settings and template variables. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + """ + + squad: typing.Optional[CreateSquadDto] = pydantic.Field(default=None) + """ + This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, CreateWebCallDto=CreateWebCallDto) +update_forward_refs(CreateWorkflowBlockDto, CreateWebCallDto=CreateWebCallDto) +update_forward_refs(HandoffStep, CreateWebCallDto=CreateWebCallDto) diff --git a/src/vapi/types/create_workflow_block_dto.py b/src/vapi/types/create_workflow_block_dto.py new file mode 100644 index 0000000..d563a8a --- /dev/null +++ b/src/vapi/types/create_workflow_block_dto.py @@ -0,0 +1,77 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .create_workflow_block_dto_messages_item import CreateWorkflowBlockDtoMessagesItem +import pydantic +import typing_extensions +from .json_schema import JsonSchema +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class CreateWorkflowBlockDto(UniversalBaseModel): + messages: typing.Optional[typing.List[CreateWorkflowBlockDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the pre-configured messages that will be spoken to the user while the block is running. + """ + + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = ( + pydantic.Field(default=None) + ) + """ + This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` + + These are accessible as variables: + + - ({{input.propertyName}}) in context of the block execution (step) + - ({{stepName.input.propertyName}}) in context of the workflow + """ + + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = ( + pydantic.Field(default=None) + ) + """ + This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). + + These are accessible as variables: + + - ({{output.propertyName}}) in context of the block execution (step) + - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) + - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + """ + + steps: typing.Optional[typing.List["CreateWorkflowBlockDtoStepsItem"]] = pydantic.Field(default=None) + """ + These are the steps in the workflow. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the block. This is just for your reference. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .callback_step import CallbackStep # noqa: E402 +from .handoff_step import HandoffStep # noqa: E402 +from .create_workflow_block_dto_steps_item import CreateWorkflowBlockDtoStepsItem # noqa: E402 + +update_forward_refs(CallbackStep, CreateWorkflowBlockDto=CreateWorkflowBlockDto) +update_forward_refs(HandoffStep, CreateWorkflowBlockDto=CreateWorkflowBlockDto) +update_forward_refs(CreateWorkflowBlockDto) diff --git a/src/vapi/types/create_workflow_block_dto_messages_item.py b/src/vapi/types/create_workflow_block_dto_messages_item.py new file mode 100644 index 0000000..c25a254 --- /dev/null +++ b/src/vapi/types/create_workflow_block_dto_messages_item.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .block_start_message_conditions_item import BlockStartMessageConditionsItem +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .block_complete_message_conditions_item import BlockCompleteMessageConditionsItem + + +class CreateWorkflowBlockDtoMessagesItem_BlockStart(UniversalBaseModel): + type: typing.Literal["block-start"] = "block-start" + conditions: typing.Optional[typing.List[BlockStartMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateWorkflowBlockDtoMessagesItem_BlockComplete(UniversalBaseModel): + type: typing.Literal["block-complete"] = "block-complete" + conditions: typing.Optional[typing.List[BlockCompleteMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateWorkflowBlockDtoMessagesItem = typing.Union[ + CreateWorkflowBlockDtoMessagesItem_BlockStart, CreateWorkflowBlockDtoMessagesItem_BlockComplete +] diff --git a/src/vapi/types/create_workflow_block_dto_steps_item.py b/src/vapi/types/create_workflow_block_dto_steps_item.py new file mode 100644 index 0000000..fa29886 --- /dev/null +++ b/src/vapi/types/create_workflow_block_dto_steps_item.py @@ -0,0 +1,72 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .step_destination import StepDestination +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .assignment_mutation import AssignmentMutation +from ..core.pydantic_utilities import update_forward_refs + + +class CreateWorkflowBlockDtoStepsItem_Handoff(UniversalBaseModel): + type: typing.Literal["handoff"] = "handoff" + block: typing.Optional["HandoffStepBlock"] = None + destinations: typing.Optional[typing.List[StepDestination]] = None + name: str + block_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="blockId")] = None + input: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateWorkflowBlockDtoStepsItem_Callback(UniversalBaseModel): + type: typing.Literal["callback"] = "callback" + block: typing.Optional["CallbackStepBlock"] = None + mutations: typing.Optional[typing.List[AssignmentMutation]] = None + name: str + block_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="blockId")] = None + input: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .callback_step import CallbackStep # noqa: E402 +from .create_workflow_block_dto import CreateWorkflowBlockDto # noqa: E402 +from .handoff_step import HandoffStep # noqa: E402 + +CreateWorkflowBlockDtoStepsItem = typing.Union[ + CreateWorkflowBlockDtoStepsItem_Handoff, CreateWorkflowBlockDtoStepsItem_Callback +] +from .handoff_step_block import HandoffStepBlock # noqa: E402 +from .callback_step_block import CallbackStepBlock # noqa: E402 + +update_forward_refs(CallbackStep, CreateWorkflowBlockDtoStepsItem_Handoff=CreateWorkflowBlockDtoStepsItem_Handoff) +update_forward_refs( + CreateWorkflowBlockDto, CreateWorkflowBlockDtoStepsItem_Handoff=CreateWorkflowBlockDtoStepsItem_Handoff +) +update_forward_refs(HandoffStep, CreateWorkflowBlockDtoStepsItem_Handoff=CreateWorkflowBlockDtoStepsItem_Handoff) +update_forward_refs(CreateWorkflowBlockDtoStepsItem_Handoff) +update_forward_refs(CallbackStep, CreateWorkflowBlockDtoStepsItem_Callback=CreateWorkflowBlockDtoStepsItem_Callback) +update_forward_refs( + CreateWorkflowBlockDto, CreateWorkflowBlockDtoStepsItem_Callback=CreateWorkflowBlockDtoStepsItem_Callback +) +update_forward_refs(HandoffStep, CreateWorkflowBlockDtoStepsItem_Callback=CreateWorkflowBlockDtoStepsItem_Callback) +update_forward_refs(CreateWorkflowBlockDtoStepsItem_Callback) diff --git a/src/vapi/types/custom_llm_credential.py b/src/vapi/types/custom_llm_credential.py new file mode 100644 index 0000000..0e9c3a2 --- /dev/null +++ b/src/vapi/types/custom_llm_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CustomLlmCredential(UniversalBaseModel): + provider: typing.Literal["custom-llm"] = "custom-llm" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/custom_llm_model.py b/src/vapi/types/custom_llm_model.py new file mode 100644 index 0000000..b164b4d --- /dev/null +++ b/src/vapi/types/custom_llm_model.py @@ -0,0 +1,110 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +import pydantic +from .custom_llm_model_tools_item import CustomLlmModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .custom_llm_model_metadata_send_mode import CustomLlmModelMetadataSendMode +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CustomLlmModel(UniversalBaseModel): + messages: typing.Optional[typing.List[OpenAiMessage]] = pydantic.Field(default=None) + """ + This is the starting state for the conversation. + """ + + tools: typing.Optional[typing.List[CustomLlmModelToolsItem]] = pydantic.Field(default=None) + """ + These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. + + Both `tools` and `toolIds` can be used together. + """ + + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = ( + pydantic.Field(default=None) + ) + """ + These are the tools that the assistant can use during the call. To use transient tools, use `tools`. + + Both `tools` and `toolIds` can be used together. + """ + + metadata_send_mode: typing_extensions.Annotated[ + typing.Optional[CustomLlmModelMetadataSendMode], FieldMetadata(alias="metadataSendMode") + ] = pydantic.Field(default=None) + """ + This determines whether metadata is sent in requests to the custom provider. + + - `off` will not send any metadata. payload will look like `{ messages }` + - `variable` will send `assistant.metadata` as a variable on the payload. payload will look like `{ messages, metadata }` + - `destructured` will send `assistant.metadata` fields directly on the payload. payload will look like `{ messages, ...metadata }` + + Further, `variable` and `destructured` will send `call`, `phoneNumber`, and `customer` objects in the payload. + + Default is `variable`. + """ + + url: str = pydantic.Field() + """ + These is the URL we'll use for the OpenAI client's `baseURL`. Ex. https://openrouter.ai/api/v1 + """ + + model: str = pydantic.Field() + """ + This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b + """ + + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + """ + + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = pydantic.Field(default=None) + """ + These are the options for the knowledge base. + """ + + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = pydantic.Field( + default=None + ) + """ + This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + """ + + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether we detect user's emotion while they speak and send it as an additional info to model. + + Default `false` because the model is usually are good at understanding the user's emotion from text. + + @default false + """ + + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = ( + pydantic.Field(default=None) + ) + """ + This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + + Default is 0. + + @default 0 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/custom_llm_model_metadata_send_mode.py b/src/vapi/types/custom_llm_model_metadata_send_mode.py new file mode 100644 index 0000000..0d33100 --- /dev/null +++ b/src/vapi/types/custom_llm_model_metadata_send_mode.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CustomLlmModelMetadataSendMode = typing.Union[typing.Literal["off", "variable", "destructured"], typing.Any] diff --git a/src/vapi/types/custom_llm_model_tools_item.py b/src/vapi/types/custom_llm_model_tools_item.py new file mode 100644 index 0000000..c33e0d9 --- /dev/null +++ b/src/vapi/types/custom_llm_model_tools_item.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class CustomLlmModelToolsItem_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CustomLlmModelToolsItem_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CustomLlmModelToolsItem_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CustomLlmModelToolsItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CustomLlmModelToolsItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CustomLlmModelToolsItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CustomLlmModelToolsItem_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CustomLlmModelToolsItem = typing.Union[ + CustomLlmModelToolsItem_Dtmf, + CustomLlmModelToolsItem_EndCall, + CustomLlmModelToolsItem_Voicemail, + CustomLlmModelToolsItem_Function, + CustomLlmModelToolsItem_Ghl, + CustomLlmModelToolsItem_Make, + CustomLlmModelToolsItem_TransferCall, +] diff --git a/src/vapi/types/deep_infra_credential.py b/src/vapi/types/deep_infra_credential.py new file mode 100644 index 0000000..d4660c0 --- /dev/null +++ b/src/vapi/types/deep_infra_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class DeepInfraCredential(UniversalBaseModel): + provider: typing.Literal["deepinfra"] = "deepinfra" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/deep_infra_model.py b/src/vapi/types/deep_infra_model.py new file mode 100644 index 0000000..4d6143c --- /dev/null +++ b/src/vapi/types/deep_infra_model.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +import pydantic +from .deep_infra_model_tools_item import DeepInfraModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class DeepInfraModel(UniversalBaseModel): + messages: typing.Optional[typing.List[OpenAiMessage]] = pydantic.Field(default=None) + """ + This is the starting state for the conversation. + """ + + tools: typing.Optional[typing.List[DeepInfraModelToolsItem]] = pydantic.Field(default=None) + """ + These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. + + Both `tools` and `toolIds` can be used together. + """ + + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = ( + pydantic.Field(default=None) + ) + """ + These are the tools that the assistant can use during the call. To use transient tools, use `tools`. + + Both `tools` and `toolIds` can be used together. + """ + + model: str = pydantic.Field() + """ + This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b + """ + + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + """ + + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = pydantic.Field(default=None) + """ + These are the options for the knowledge base. + """ + + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = pydantic.Field( + default=None + ) + """ + This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + """ + + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether we detect user's emotion while they speak and send it as an additional info to model. + + Default `false` because the model is usually are good at understanding the user's emotion from text. + + @default false + """ + + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = ( + pydantic.Field(default=None) + ) + """ + This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + + Default is 0. + + @default 0 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/deep_infra_model_tools_item.py b/src/vapi/types/deep_infra_model_tools_item.py new file mode 100644 index 0000000..54b72f1 --- /dev/null +++ b/src/vapi/types/deep_infra_model_tools_item.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class DeepInfraModelToolsItem_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class DeepInfraModelToolsItem_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class DeepInfraModelToolsItem_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class DeepInfraModelToolsItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class DeepInfraModelToolsItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class DeepInfraModelToolsItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class DeepInfraModelToolsItem_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +DeepInfraModelToolsItem = typing.Union[ + DeepInfraModelToolsItem_Dtmf, + DeepInfraModelToolsItem_EndCall, + DeepInfraModelToolsItem_Voicemail, + DeepInfraModelToolsItem_Function, + DeepInfraModelToolsItem_Ghl, + DeepInfraModelToolsItem_Make, + DeepInfraModelToolsItem_TransferCall, +] diff --git a/src/vapi/types/deepgram_credential.py b/src/vapi/types/deepgram_credential.py new file mode 100644 index 0000000..d2d1809 --- /dev/null +++ b/src/vapi/types/deepgram_credential.py @@ -0,0 +1,53 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class DeepgramCredential(UniversalBaseModel): + provider: typing.Literal["deepgram"] = "deepgram" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + api_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="apiUrl")] = pydantic.Field( + default=None + ) + """ + This can be used to point to an onprem Deepgram instance. Defaults to api.deepgram.com. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/deepgram_transcriber.py b/src/vapi/types/deepgram_transcriber.py new file mode 100644 index 0000000..aa396fa --- /dev/null +++ b/src/vapi/types/deepgram_transcriber.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .deepgram_transcriber_model import DeepgramTranscriberModel +import pydantic +from .deepgram_transcriber_language import DeepgramTranscriberLanguage +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class DeepgramTranscriber(UniversalBaseModel): + model: typing.Optional[DeepgramTranscriberModel] = pydantic.Field(default=None) + """ + This is the Deepgram model that will be used. A list of models can be found here: https://developers.deepgram.com/docs/models-languages-overview + """ + + language: typing.Optional[DeepgramTranscriberLanguage] = pydantic.Field(default=None) + """ + This is the language that will be set for the transcription. The list of languages Deepgram supports can be found here: https://developers.deepgram.com/docs/models-languages-overview + """ + + smart_format: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="smartFormat")] = ( + pydantic.Field(default=None) + ) + """ + This will be use smart format option provided by Deepgram. It's default disabled because it can sometimes format numbers as times but it's getting better. + """ + + language_detection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="languageDetectionEnabled") + ] = pydantic.Field(default=None) + """ + This enables or disables language detection. If true, swaps transcribers to detected language automatically. Defaults to false. + """ + + keywords: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + These keywords are passed to the transcription model to help it pick up use-case specific words. Anything that may not be a common word, like your company name, should be added here. + """ + + endpointing: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the timeout after which Deepgram will send transcription on user silence. You can read in-depth documentation here: https://developers.deepgram.com/docs/endpointing. + + Here are the most important bits: + + - Defaults to 10. This is recommended for most use cases to optimize for latency. + - 10 can cause some missing transcriptions since because of the shorter context. This mostly happens for one-word utterances. For those uses cases, it's recommended to try 300. It will add a bit of latency but the quality and reliability of the experience will be better. + - If neither 10 nor 300 work, contact support@vapi.ai and we'll find another solution. + + @default 10 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/deepgram_transcriber_language.py b/src/vapi/types/deepgram_transcriber_language.py new file mode 100644 index 0000000..3664152 --- /dev/null +++ b/src/vapi/types/deepgram_transcriber_language.py @@ -0,0 +1,65 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DeepgramTranscriberLanguage = typing.Union[ + typing.Literal[ + "bg", + "ca", + "cs", + "da", + "da-DK", + "de", + "de-CH", + "el", + "en", + "en-AU", + "en-GB", + "en-IN", + "en-NZ", + "en-US", + "es", + "es-419", + "es-LATAM", + "et", + "fi", + "fr", + "fr-CA", + "hi", + "hi-Latn", + "hu", + "id", + "it", + "ja", + "ko", + "ko-KR", + "lt", + "lv", + "ms", + "multi", + "nl", + "nl-BE", + "no", + "pl", + "pt", + "pt-BR", + "ro", + "ru", + "sk", + "sv", + "sv-SE", + "ta", + "taq", + "th", + "th-TH", + "tr", + "uk", + "vi", + "zh", + "zh-CN", + "zh-Hans", + "zh-Hant", + "zh-TW", + ], + typing.Any, +] diff --git a/src/vapi/types/deepgram_transcriber_model.py b/src/vapi/types/deepgram_transcriber_model.py new file mode 100644 index 0000000..0b61675 --- /dev/null +++ b/src/vapi/types/deepgram_transcriber_model.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DeepgramTranscriberModel = typing.Union[ + typing.Literal["nova-2"], + typing.Literal["nova-2-general"], + typing.Literal["nova-2-meeting"], + typing.Literal["nova-2-phonecall"], + typing.Literal["nova-2-finance"], + typing.Literal["nova-2-conversationalai"], + typing.Literal["nova-2-voicemail"], + typing.Literal["nova-2-video"], + typing.Literal["nova-2-medical"], + typing.Literal["nova-2-drivethru"], + typing.Literal["nova-2-automotive"], + typing.Literal["nova"], + typing.Literal["nova-general"], + typing.Literal["nova-phonecall"], + typing.Literal["nova-medical"], + typing.Literal["enhanced"], + typing.Literal["enhanced-general"], + typing.Literal["enhanced-meeting"], + typing.Literal["enhanced-phonecall"], + typing.Literal["enhanced-finance"], + typing.Literal["base"], + typing.Literal["base-general"], + typing.Literal["base-meeting"], + typing.Literal["base-phonecall"], + typing.Literal["base-finance"], + typing.Literal["base-conversationalai"], + typing.Literal["base-voicemail"], + typing.Literal["base-video"], + str, +] diff --git a/src/vapi/types/deepgram_voice.py b/src/vapi/types/deepgram_voice.py new file mode 100644 index 0000000..265a053 --- /dev/null +++ b/src/vapi/types/deepgram_voice.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .deepgram_voice_voice_id import DeepgramVoiceVoiceId +from .chunk_plan import ChunkPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class DeepgramVoice(UniversalBaseModel): + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether fillers are injected into the model output before inputting it into the voice provider. + + Default `false` because you can achieve better results with prompting the model. + """ + + voice_id: typing_extensions.Annotated[DeepgramVoiceVoiceId, FieldMetadata(alias="voiceId")] = pydantic.Field() + """ + This is the provider-specific ID that will be used. + """ + + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for chunking the model output before it is sent to the voice provider. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/deepgram_voice_voice_id.py b/src/vapi/types/deepgram_voice_voice_id.py new file mode 100644 index 0000000..00d6970 --- /dev/null +++ b/src/vapi/types/deepgram_voice_voice_id.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DeepgramVoiceVoiceId = typing.Union[ + typing.Literal["asteria"], + typing.Literal["luna"], + typing.Literal["stella"], + typing.Literal["athena"], + typing.Literal["hera"], + typing.Literal["orion"], + typing.Literal["arcas"], + typing.Literal["perseus"], + typing.Literal["angus"], + typing.Literal["orpheus"], + typing.Literal["helios"], + typing.Literal["zeus"], + str, +] diff --git a/src/vapi/types/dtmf_tool.py b/src/vapi/types/dtmf_tool.py new file mode 100644 index 0000000..e8a6c7d --- /dev/null +++ b/src/vapi/types/dtmf_tool.py @@ -0,0 +1,81 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .dtmf_tool_messages_item import DtmfToolMessagesItem +import datetime as dt +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class DtmfTool(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[DtmfToolMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the tool. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the organization that this tool belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was last updated. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/dtmf_tool_messages_item.py b/src/vapi/types/dtmf_tool_messages_item.py new file mode 100644 index 0000000..6a93742 --- /dev/null +++ b/src/vapi/types/dtmf_tool_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class DtmfToolMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class DtmfToolMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class DtmfToolMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class DtmfToolMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +DtmfToolMessagesItem = typing.Union[ + DtmfToolMessagesItem_RequestStart, + DtmfToolMessagesItem_RequestComplete, + DtmfToolMessagesItem_RequestFailed, + DtmfToolMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/eleven_labs_credential.py b/src/vapi/types/eleven_labs_credential.py new file mode 100644 index 0000000..5a4f707 --- /dev/null +++ b/src/vapi/types/eleven_labs_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ElevenLabsCredential(UniversalBaseModel): + provider: typing.Literal["11labs"] = "11labs" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/eleven_labs_voice.py b/src/vapi/types/eleven_labs_voice.py new file mode 100644 index 0000000..c980c46 --- /dev/null +++ b/src/vapi/types/eleven_labs_voice.py @@ -0,0 +1,93 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .eleven_labs_voice_voice_id import ElevenLabsVoiceVoiceId +from .eleven_labs_voice_model import ElevenLabsVoiceModel +from .chunk_plan import ChunkPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ElevenLabsVoice(UniversalBaseModel): + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether fillers are injected into the model output before inputting it into the voice provider. + + Default `false` because you can achieve better results with prompting the model. + """ + + voice_id: typing_extensions.Annotated[ElevenLabsVoiceVoiceId, FieldMetadata(alias="voiceId")] = pydantic.Field() + """ + This is the provider-specific ID that will be used. Ensure the Voice is present in your 11Labs Voice Library. + """ + + stability: typing.Optional[float] = pydantic.Field(default=None) + """ + Defines the stability for voice settings. + """ + + similarity_boost: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="similarityBoost")] = ( + pydantic.Field(default=None) + ) + """ + Defines the similarity boost for voice settings. + """ + + style: typing.Optional[float] = pydantic.Field(default=None) + """ + Defines the style for voice settings. + """ + + use_speaker_boost: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="useSpeakerBoost")] = ( + pydantic.Field(default=None) + ) + """ + Defines the use speaker boost for voice settings. + """ + + optimize_streaming_latency: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="optimizeStreamingLatency") + ] = pydantic.Field(default=None) + """ + Defines the optimize streaming latency for voice settings. Defaults to 3. + """ + + enable_ssml_parsing: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="enableSsmlParsing") + ] = pydantic.Field(default=None) + """ + This enables the use of https://elevenlabs.io/docs/speech-synthesis/prompting#pronunciation. Defaults to false to save latency. + + @default false + """ + + model: typing.Optional[ElevenLabsVoiceModel] = pydantic.Field(default=None) + """ + This is the model that will be used. Defaults to 'eleven_turbo_v2' if not specified. + """ + + language: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided. + """ + + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for chunking the model output before it is sent to the voice provider. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/eleven_labs_voice_model.py b/src/vapi/types/eleven_labs_voice_model.py new file mode 100644 index 0000000..b22563d --- /dev/null +++ b/src/vapi/types/eleven_labs_voice_model.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ElevenLabsVoiceModel = typing.Union[ + typing.Literal["eleven_multilingual_v2", "eleven_turbo_v2", "eleven_turbo_v2_5", "eleven_monolingual_v1"], + typing.Any, +] diff --git a/src/vapi/types/eleven_labs_voice_voice_id.py b/src/vapi/types/eleven_labs_voice_voice_id.py new file mode 100644 index 0000000..b1f8f55 --- /dev/null +++ b/src/vapi/types/eleven_labs_voice_voice_id.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ElevenLabsVoiceVoiceId = typing.Union[ + typing.Literal["burt"], + typing.Literal["marissa"], + typing.Literal["andrea"], + typing.Literal["sarah"], + typing.Literal["phillip"], + typing.Literal["steve"], + typing.Literal["joseph"], + typing.Literal["myra"], + typing.Literal["paula"], + typing.Literal["ryan"], + typing.Literal["drew"], + typing.Literal["paul"], + typing.Literal["mrb"], + typing.Literal["matilda"], + typing.Literal["mark"], + str, +] diff --git a/src/vapi/types/end_call_tool.py b/src/vapi/types/end_call_tool.py new file mode 100644 index 0000000..9633bf5 --- /dev/null +++ b/src/vapi/types/end_call_tool.py @@ -0,0 +1,81 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .end_call_tool_messages_item import EndCallToolMessagesItem +import datetime as dt +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class EndCallTool(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[EndCallToolMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the tool. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the organization that this tool belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was last updated. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/end_call_tool_messages_item.py b/src/vapi/types/end_call_tool_messages_item.py new file mode 100644 index 0000000..ccc6697 --- /dev/null +++ b/src/vapi/types/end_call_tool_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class EndCallToolMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EndCallToolMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EndCallToolMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EndCallToolMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +EndCallToolMessagesItem = typing.Union[ + EndCallToolMessagesItem_RequestStart, + EndCallToolMessagesItem_RequestComplete, + EndCallToolMessagesItem_RequestFailed, + EndCallToolMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/error.py b/src/vapi/types/error.py new file mode 100644 index 0000000..48db281 --- /dev/null +++ b/src/vapi/types/error.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class Error(UniversalBaseModel): + message: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/exact_replacement.py b/src/vapi/types/exact_replacement.py new file mode 100644 index 0000000..51dc552 --- /dev/null +++ b/src/vapi/types/exact_replacement.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ExactReplacement(UniversalBaseModel): + key: str = pydantic.Field() + """ + This is the key to replace. + """ + + value: str = pydantic.Field() + """ + This is the value that will replace the match. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/file.py b/src/vapi/types/file.py new file mode 100644 index 0000000..2b867ab --- /dev/null +++ b/src/vapi/types/file.py @@ -0,0 +1,57 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .file_status import FileStatus +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class File(UniversalBaseModel): + object: typing.Optional[typing.Literal["file"]] = None + status: typing.Optional[FileStatus] = None + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the file. This is just for your own reference. + """ + + original_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="originalName")] = None + bytes: typing.Optional[float] = None + purpose: typing.Optional[str] = None + mimetype: typing.Optional[str] = None + key: typing.Optional[str] = None + path: typing.Optional[str] = None + bucket: typing.Optional[str] = None + url: typing.Optional[str] = None + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + id: str = pydantic.Field() + """ + This is the unique identifier for the file. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this file belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the file was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the file was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/file_status.py b/src/vapi/types/file_status.py new file mode 100644 index 0000000..4ac56f7 --- /dev/null +++ b/src/vapi/types/file_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +FileStatus = typing.Union[typing.Literal["indexed", "not_indexed"], typing.Any] diff --git a/src/vapi/types/format_plan.py b/src/vapi/types/format_plan.py new file mode 100644 index 0000000..4982f87 --- /dev/null +++ b/src/vapi/types/format_plan.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from .format_plan_replacements_item import FormatPlanReplacementsItem +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class FormatPlan(UniversalBaseModel): + enabled: typing.Optional[bool] = pydantic.Field(default=None) + """ + This determines whether the chunk is formatted before being sent to the voice provider. This helps with enunciation. This includes phone numbers, emails and addresses. Default `true`. + + Usage: + + - To rely on the voice provider's formatting logic, set this to `false`. + - To use ElevenLabs's `enableSsmlParsing` feature, set this to `false`. + + If `voice.chunkPlan.enabled` is `false`, this is automatically `false` since there's no chunk to format. + + @default true + """ + + number_to_digits_cutoff: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="numberToDigitsCutoff") + ] = pydantic.Field(default=None) + """ + This is the cutoff after which a number is converted to individual digits instead of being spoken as words. + + Example: + + - If cutoff 2025, "12345" is converted to "1 2 3 4 5" while "1200" is converted to "twelve hundred". + + Usage: + + - If your use case doesn't involve IDs like zip codes, set this to a high value. + - If your use case involves IDs that are shorter than 5 digits, set this to a lower value. + + @default 2025 + """ + + replacements: typing.Optional[typing.List[FormatPlanReplacementsItem]] = pydantic.Field(default=None) + """ + These are the custom replacements you can make to the chunk before it is sent to the voice provider. + + Usage: + + - To replace a specific word or phrase with a different word or phrase, use the `ExactReplacement` type. Eg. `{ type: 'exact', key: 'hello', value: 'hi' }` + - To replace a word or phrase that matches a pattern, use the `RegexReplacement` type. Eg. `{ type: 'regex', regex: '\\b[a-zA-Z]{5}\\b', value: 'hi' }` + + @default [] + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/format_plan_replacements_item.py b/src/vapi/types/format_plan_replacements_item.py new file mode 100644 index 0000000..acfd0b5 --- /dev/null +++ b/src/vapi/types/format_plan_replacements_item.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .regex_option import RegexOption + + +class FormatPlanReplacementsItem_Exact(UniversalBaseModel): + type: typing.Literal["exact"] = "exact" + key: str + value: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class FormatPlanReplacementsItem_Regex(UniversalBaseModel): + type: typing.Literal["regex"] = "regex" + regex: str + options: typing.Optional[typing.List[RegexOption]] = None + value: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +FormatPlanReplacementsItem = typing.Union[FormatPlanReplacementsItem_Exact, FormatPlanReplacementsItem_Regex] diff --git a/src/vapi/types/function_tool.py b/src/vapi/types/function_tool.py new file mode 100644 index 0000000..48a5b4f --- /dev/null +++ b/src/vapi/types/function_tool.py @@ -0,0 +1,81 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .function_tool_messages_item import FunctionToolMessagesItem +import datetime as dt +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class FunctionTool(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[FunctionToolMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the tool. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the organization that this tool belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was last updated. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/function_tool_messages_item.py b/src/vapi/types/function_tool_messages_item.py new file mode 100644 index 0000000..248a6e6 --- /dev/null +++ b/src/vapi/types/function_tool_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class FunctionToolMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class FunctionToolMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class FunctionToolMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class FunctionToolMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +FunctionToolMessagesItem = typing.Union[ + FunctionToolMessagesItem_RequestStart, + FunctionToolMessagesItem_RequestComplete, + FunctionToolMessagesItem_RequestFailed, + FunctionToolMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/function_tool_provider_details.py b/src/vapi/types/function_tool_provider_details.py new file mode 100644 index 0000000..e616659 --- /dev/null +++ b/src/vapi/types/function_tool_provider_details.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .tool_template_setup import ToolTemplateSetup +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class FunctionToolProviderDetails(UniversalBaseModel): + template_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateUrl")] = ( + pydantic.Field(default=None) + ) + """ + This is the Template URL or the Snapshot URL corresponding to the Template. + """ + + setup_instructions: typing_extensions.Annotated[ + typing.Optional[typing.List[ToolTemplateSetup]], FieldMetadata(alias="setupInstructions") + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/function_tool_with_tool_call.py b/src/vapi/types/function_tool_with_tool_call.py new file mode 100644 index 0000000..161196b --- /dev/null +++ b/src/vapi/types/function_tool_with_tool_call.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .function_tool_with_tool_call_messages_item import FunctionToolWithToolCallMessagesItem +from .tool_call import ToolCall +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class FunctionToolWithToolCall(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[FunctionToolWithToolCallMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/function_tool_with_tool_call_messages_item.py b/src/vapi/types/function_tool_with_tool_call_messages_item.py new file mode 100644 index 0000000..865ad0d --- /dev/null +++ b/src/vapi/types/function_tool_with_tool_call_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class FunctionToolWithToolCallMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class FunctionToolWithToolCallMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class FunctionToolWithToolCallMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class FunctionToolWithToolCallMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +FunctionToolWithToolCallMessagesItem = typing.Union[ + FunctionToolWithToolCallMessagesItem_RequestStart, + FunctionToolWithToolCallMessagesItem_RequestComplete, + FunctionToolWithToolCallMessagesItem_RequestFailed, + FunctionToolWithToolCallMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/gcp_credential.py b/src/vapi/types/gcp_credential.py new file mode 100644 index 0000000..d203a07 --- /dev/null +++ b/src/vapi/types/gcp_credential.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +import datetime as dt +from .gcp_key import GcpKey +from .bucket_plan import BucketPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class GcpCredential(UniversalBaseModel): + provider: typing.Literal["gcp"] = "gcp" + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the GCP credential. This is just for your reference. + """ + + gcp_key: typing_extensions.Annotated[GcpKey, FieldMetadata(alias="gcpKey")] = pydantic.Field() + """ + This is the GCP key. This is the JSON that can be generated in the Google Cloud Console at https://console.cloud.google.com/iam-admin/serviceaccounts/details//keys. + + The schema is identical to the JSON that GCP outputs. + """ + + bucket_plan: typing_extensions.Annotated[typing.Optional[BucketPlan], FieldMetadata(alias="bucketPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the bucket plan that can be provided to store call artifacts in GCP. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/gcp_key.py b/src/vapi/types/gcp_key.py new file mode 100644 index 0000000..e896001 --- /dev/null +++ b/src/vapi/types/gcp_key.py @@ -0,0 +1,78 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class GcpKey(UniversalBaseModel): + type: str = pydantic.Field() + """ + This is the type of the key. Most likely, this is "service_account". + """ + + project_id: typing_extensions.Annotated[str, FieldMetadata(alias="projectId")] = pydantic.Field() + """ + This is the ID of the Google Cloud project associated with this key. + """ + + private_key_id: typing_extensions.Annotated[str, FieldMetadata(alias="privateKeyId")] = pydantic.Field() + """ + This is the unique identifier for the private key. + """ + + private_key: typing_extensions.Annotated[str, FieldMetadata(alias="privateKey")] = pydantic.Field() + """ + This is the private key in PEM format. + + Note: This is not returned in the API. + """ + + client_email: typing_extensions.Annotated[str, FieldMetadata(alias="clientEmail")] = pydantic.Field() + """ + This is the email address associated with the service account. + """ + + client_id: typing_extensions.Annotated[str, FieldMetadata(alias="clientId")] = pydantic.Field() + """ + This is the unique identifier for the client. + """ + + auth_uri: typing_extensions.Annotated[str, FieldMetadata(alias="authUri")] = pydantic.Field() + """ + This is the URI for the auth provider's authorization endpoint. + """ + + token_uri: typing_extensions.Annotated[str, FieldMetadata(alias="tokenUri")] = pydantic.Field() + """ + This is the URI for the auth provider's token endpoint. + """ + + auth_provider_x_509_cert_url: typing_extensions.Annotated[str, FieldMetadata(alias="authProviderX509CertUrl")] = ( + pydantic.Field() + ) + """ + This is the URL of the public x509 certificate for the auth provider. + """ + + client_x_509_cert_url: typing_extensions.Annotated[str, FieldMetadata(alias="clientX509CertUrl")] = pydantic.Field() + """ + This is the URL of the public x509 certificate for the client. + """ + + universe_domain: typing_extensions.Annotated[str, FieldMetadata(alias="universeDomain")] = pydantic.Field() + """ + This is the domain associated with the universe this service account belongs to. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/ghl_tool.py b/src/vapi/types/ghl_tool.py new file mode 100644 index 0000000..949ad56 --- /dev/null +++ b/src/vapi/types/ghl_tool.py @@ -0,0 +1,84 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .ghl_tool_messages_item import GhlToolMessagesItem +import datetime as dt +from .open_ai_function import OpenAiFunction +from .server import Server +from .ghl_tool_metadata import GhlToolMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class GhlTool(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[GhlToolMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the tool. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the organization that this tool belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was last updated. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + metadata: GhlToolMetadata + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/ghl_tool_messages_item.py b/src/vapi/types/ghl_tool_messages_item.py new file mode 100644 index 0000000..218b3e7 --- /dev/null +++ b/src/vapi/types/ghl_tool_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class GhlToolMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GhlToolMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GhlToolMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GhlToolMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +GhlToolMessagesItem = typing.Union[ + GhlToolMessagesItem_RequestStart, + GhlToolMessagesItem_RequestComplete, + GhlToolMessagesItem_RequestFailed, + GhlToolMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/ghl_tool_metadata.py b/src/vapi/types/ghl_tool_metadata.py new file mode 100644 index 0000000..95d6aed --- /dev/null +++ b/src/vapi/types/ghl_tool_metadata.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class GhlToolMetadata(UniversalBaseModel): + workflow_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="workflowId")] = None + location_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="locationId")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/ghl_tool_provider_details.py b/src/vapi/types/ghl_tool_provider_details.py new file mode 100644 index 0000000..c8fba31 --- /dev/null +++ b/src/vapi/types/ghl_tool_provider_details.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .tool_template_setup import ToolTemplateSetup +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class GhlToolProviderDetails(UniversalBaseModel): + template_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateUrl")] = ( + pydantic.Field(default=None) + ) + """ + This is the Template URL or the Snapshot URL corresponding to the Template. + """ + + setup_instructions: typing_extensions.Annotated[ + typing.Optional[typing.List[ToolTemplateSetup]], FieldMetadata(alias="setupInstructions") + ] = None + workflow_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="workflowId")] = None + workflow_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="workflowName")] = None + webhook_hook_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="webhookHookId")] = None + webhook_hook_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="webhookHookName")] = None + location_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="locationId")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/ghl_tool_with_tool_call.py b/src/vapi/types/ghl_tool_with_tool_call.py new file mode 100644 index 0000000..1974761 --- /dev/null +++ b/src/vapi/types/ghl_tool_with_tool_call.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .ghl_tool_with_tool_call_messages_item import GhlToolWithToolCallMessagesItem +from .tool_call import ToolCall +from .ghl_tool_metadata import GhlToolMetadata +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class GhlToolWithToolCall(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[GhlToolWithToolCallMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/ghl_tool_with_tool_call_messages_item.py b/src/vapi/types/ghl_tool_with_tool_call_messages_item.py new file mode 100644 index 0000000..eb624da --- /dev/null +++ b/src/vapi/types/ghl_tool_with_tool_call_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class GhlToolWithToolCallMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GhlToolWithToolCallMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GhlToolWithToolCallMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GhlToolWithToolCallMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +GhlToolWithToolCallMessagesItem = typing.Union[ + GhlToolWithToolCallMessagesItem_RequestStart, + GhlToolWithToolCallMessagesItem_RequestComplete, + GhlToolWithToolCallMessagesItem_RequestFailed, + GhlToolWithToolCallMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/gladia_credential.py b/src/vapi/types/gladia_credential.py new file mode 100644 index 0000000..c40754c --- /dev/null +++ b/src/vapi/types/gladia_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class GladiaCredential(UniversalBaseModel): + provider: typing.Literal["gladia"] = "gladia" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/gladia_transcriber.py b/src/vapi/types/gladia_transcriber.py new file mode 100644 index 0000000..69dbcad --- /dev/null +++ b/src/vapi/types/gladia_transcriber.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .gladia_transcriber_model import GladiaTranscriberModel +import typing_extensions +from .gladia_transcriber_language_behaviour import GladiaTranscriberLanguageBehaviour +from ..core.serialization import FieldMetadata +from .gladia_transcriber_language import GladiaTranscriberLanguage +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class GladiaTranscriber(UniversalBaseModel): + model: typing.Optional[GladiaTranscriberModel] = None + language_behaviour: typing_extensions.Annotated[ + typing.Optional[GladiaTranscriberLanguageBehaviour], FieldMetadata(alias="languageBehaviour") + ] = None + language: typing.Optional[GladiaTranscriberLanguage] = pydantic.Field(default=None) + """ + Defines the language to use for the transcription. Required when languageBehaviour is 'manual'. + """ + + transcription_hint: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="transcriptionHint")] = ( + pydantic.Field(default=None) + ) + """ + Provides a custom vocabulary to the model to improve accuracy of transcribing context specific words, technical terms, names, etc. If empty, this argument is ignored. + ⚠️ Warning ⚠️: Please be aware that the transcription_hint field has a character limit of 600. If you provide a transcription_hint longer than 600 characters, it will be automatically truncated to meet this limit. + """ + + prosody: typing.Optional[bool] = pydantic.Field(default=None) + """ + If prosody is true, you will get a transcription that can contain prosodies i.e. (laugh) (giggles) (malefic laugh) (toss) (music)… Default value is false. + """ + + audio_enhancer: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="audioEnhancer")] = ( + pydantic.Field(default=None) + ) + """ + If true, audio will be pre-processed to improve accuracy but latency will increase. Default value is false. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/gladia_transcriber_language.py b/src/vapi/types/gladia_transcriber_language.py new file mode 100644 index 0000000..a311144 --- /dev/null +++ b/src/vapi/types/gladia_transcriber_language.py @@ -0,0 +1,109 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GladiaTranscriberLanguage = typing.Union[ + typing.Literal[ + "af", + "sq", + "am", + "ar", + "hy", + "as", + "az", + "ba", + "eu", + "be", + "bn", + "bs", + "br", + "bg", + "ca", + "zh", + "hr", + "cs", + "da", + "nl", + "en", + "et", + "fo", + "fi", + "fr", + "gl", + "ka", + "de", + "el", + "gu", + "ht", + "ha", + "haw", + "he", + "hi", + "hu", + "is", + "id", + "it", + "ja", + "jp", + "jv", + "kn", + "kk", + "km", + "ko", + "lo", + "la", + "lv", + "ln", + "lt", + "lb", + "mk", + "mg", + "ms", + "ml", + "mt", + "mi", + "mr", + "mn", + "mymr", + "ne", + "no", + "nn", + "oc", + "ps", + "fa", + "pl", + "pt", + "pa", + "ro", + "ru", + "sa", + "sr", + "sn", + "sd", + "si", + "sk", + "sl", + "so", + "es", + "su", + "sw", + "sv", + "tl", + "tg", + "ta", + "tt", + "te", + "th", + "bo", + "tr", + "tk", + "uk", + "ur", + "uz", + "vi", + "cy", + "yi", + "yo", + ], + typing.Any, +] diff --git a/src/vapi/types/gladia_transcriber_language_behaviour.py b/src/vapi/types/gladia_transcriber_language_behaviour.py new file mode 100644 index 0000000..d21c145 --- /dev/null +++ b/src/vapi/types/gladia_transcriber_language_behaviour.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GladiaTranscriberLanguageBehaviour = typing.Union[ + typing.Literal["manual", "automatic single language", "automatic multiple languages"], typing.Any +] diff --git a/src/vapi/types/gladia_transcriber_model.py b/src/vapi/types/gladia_transcriber_model.py new file mode 100644 index 0000000..c2fe11e --- /dev/null +++ b/src/vapi/types/gladia_transcriber_model.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GladiaTranscriberModel = typing.Union[typing.Literal["fast", "accurate"], typing.Any] diff --git a/src/vapi/types/go_high_level_credential.py b/src/vapi/types/go_high_level_credential.py new file mode 100644 index 0000000..998eade --- /dev/null +++ b/src/vapi/types/go_high_level_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class GoHighLevelCredential(UniversalBaseModel): + provider: typing.Literal["gohighlevel"] = "gohighlevel" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/groq_credential.py b/src/vapi/types/groq_credential.py new file mode 100644 index 0000000..f0bb13e --- /dev/null +++ b/src/vapi/types/groq_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class GroqCredential(UniversalBaseModel): + provider: typing.Literal["groq"] = "groq" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/groq_model.py b/src/vapi/types/groq_model.py new file mode 100644 index 0000000..1a1e70d --- /dev/null +++ b/src/vapi/types/groq_model.py @@ -0,0 +1,90 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +import pydantic +from .groq_model_tools_item import GroqModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .groq_model_model import GroqModelModel +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class GroqModel(UniversalBaseModel): + messages: typing.Optional[typing.List[OpenAiMessage]] = pydantic.Field(default=None) + """ + This is the starting state for the conversation. + """ + + tools: typing.Optional[typing.List[GroqModelToolsItem]] = pydantic.Field(default=None) + """ + These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. + + Both `tools` and `toolIds` can be used together. + """ + + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = ( + pydantic.Field(default=None) + ) + """ + These are the tools that the assistant can use during the call. To use transient tools, use `tools`. + + Both `tools` and `toolIds` can be used together. + """ + + model: GroqModelModel = pydantic.Field() + """ + This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b + """ + + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + """ + + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = pydantic.Field(default=None) + """ + These are the options for the knowledge base. + """ + + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = pydantic.Field( + default=None + ) + """ + This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + """ + + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether we detect user's emotion while they speak and send it as an additional info to model. + + Default `false` because the model is usually are good at understanding the user's emotion from text. + + @default false + """ + + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = ( + pydantic.Field(default=None) + ) + """ + This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + + Default is 0. + + @default 0 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/groq_model_model.py b/src/vapi/types/groq_model_model.py new file mode 100644 index 0000000..809b43e --- /dev/null +++ b/src/vapi/types/groq_model_model.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GroqModelModel = typing.Union[ + typing.Literal[ + "llama-3.1-405b-reasoning", + "llama-3.1-70b-versatile", + "llama-3.1-8b-instant", + "mixtral-8x7b-32768", + "llama3-8b-8192", + "llama3-70b-8192", + "llama3-groq-8b-8192-tool-use-preview", + "llama3-groq-70b-8192-tool-use-preview", + "gemma-7b-it", + "gemma2-9b-it", + ], + typing.Any, +] diff --git a/src/vapi/types/groq_model_tools_item.py b/src/vapi/types/groq_model_tools_item.py new file mode 100644 index 0000000..6ddc356 --- /dev/null +++ b/src/vapi/types/groq_model_tools_item.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class GroqModelToolsItem_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GroqModelToolsItem_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GroqModelToolsItem_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GroqModelToolsItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GroqModelToolsItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GroqModelToolsItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GroqModelToolsItem_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +GroqModelToolsItem = typing.Union[ + GroqModelToolsItem_Dtmf, + GroqModelToolsItem_EndCall, + GroqModelToolsItem_Voicemail, + GroqModelToolsItem_Function, + GroqModelToolsItem_Ghl, + GroqModelToolsItem_Make, + GroqModelToolsItem_TransferCall, +] diff --git a/src/vapi/types/handoff_step.py b/src/vapi/types/handoff_step.py new file mode 100644 index 0000000..5afd1bc --- /dev/null +++ b/src/vapi/types/handoff_step.py @@ -0,0 +1,107 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +from .step_destination import StepDestination +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class HandoffStep(UniversalBaseModel): + block: typing.Optional["HandoffStepBlock"] = pydantic.Field(default=None) + """ + This is the block to use. To use an existing block, use `blockId`. + """ + + destinations: typing.Optional[typing.List[StepDestination]] = pydantic.Field(default=None) + """ + These are the destinations that the step can go to after it's done. + """ + + name: str = pydantic.Field() + """ + This is the name of the step. + """ + + block_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="blockId")] = pydantic.Field( + default=None + ) + """ + This is the id of the block to use. To use a transient block, use `block`. + """ + + input: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + This is the input to the block. You can use any key-value map as input to the block. + + Example: + { + "name": "John Doe", + "age": 20 + } + + You can reference any variable in the context of the current block: + + - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) + - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) + - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) + - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) + - "{{workflow.input.your-property-name}}" for the current workflow's input + - "{{global.your-property-name}}" for the global context + + Example: + { + "name": "{{my-tool-call-step.output.name}}", + "age": "{{my-tool-call-step.input.age}}", + "date": "{{workflow.input.date}}" + } + + You can dynamically change the key name. + + Example: + { + "{{my-tool-call-step.output.key-name-for-name}}": "{{name}}", + "{{my-tool-call-step.input.key-name-for-age}}": "{{age}}", + "{{workflow.input.key-name-for-date}}": "{{date}}" + } + + You can represent the value as a string, number, boolean, array, or object. + + Example: + { + "name": "john", + "age": 20, + "date": "2021-01-01", + "metadata": { + "unique-key": "{{my-tool-call-step.output.unique-key}}" + }, + "array": ["A", "B", "C"], + } + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.input/output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.input/output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .callback_step import CallbackStep # noqa: E402 +from .create_workflow_block_dto import CreateWorkflowBlockDto # noqa: E402 +from .handoff_step_block import HandoffStepBlock # noqa: E402 + +update_forward_refs(CallbackStep, HandoffStep=HandoffStep) +update_forward_refs(CreateWorkflowBlockDto, HandoffStep=HandoffStep) +update_forward_refs(HandoffStep) diff --git a/src/vapi/types/handoff_step_block.py b/src/vapi/types/handoff_step_block.py new file mode 100644 index 0000000..38ecfd0 --- /dev/null +++ b/src/vapi/types/handoff_step_block.py @@ -0,0 +1,95 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .create_conversation_block_dto_messages_item import CreateConversationBlockDtoMessagesItem +import typing_extensions +from .json_schema import JsonSchema +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_tool_call_block_dto_messages_item import CreateToolCallBlockDtoMessagesItem +from .create_tool_call_block_dto_tool import CreateToolCallBlockDtoTool +from .create_workflow_block_dto_messages_item import CreateWorkflowBlockDtoMessagesItem +from ..core.pydantic_utilities import update_forward_refs + + +class HandoffStepBlock_Conversation(UniversalBaseModel): + """ + This is the block to use. To use an existing block, use `blockId`. + """ + + type: typing.Literal["conversation"] = "conversation" + messages: typing.Optional[typing.List[CreateConversationBlockDtoMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + instruction: str + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class HandoffStepBlock_ToolCall(UniversalBaseModel): + """ + This is the block to use. To use an existing block, use `blockId`. + """ + + type: typing.Literal["tool-call"] = "tool-call" + messages: typing.Optional[typing.List[CreateToolCallBlockDtoMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + tool: typing.Optional[CreateToolCallBlockDtoTool] = None + tool_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="toolId")] = None + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class HandoffStepBlock_Workflow(UniversalBaseModel): + """ + This is the block to use. To use an existing block, use `blockId`. + """ + + type: typing.Literal["workflow"] = "workflow" + messages: typing.Optional[typing.List[CreateWorkflowBlockDtoMessagesItem]] = None + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = None + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = None + steps: typing.Optional[typing.List["CreateWorkflowBlockDtoStepsItem"]] = None + name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .callback_step import CallbackStep # noqa: E402 +from .create_workflow_block_dto import CreateWorkflowBlockDto # noqa: E402 +from .handoff_step import HandoffStep # noqa: E402 + +HandoffStepBlock = typing.Union[HandoffStepBlock_Conversation, HandoffStepBlock_ToolCall, HandoffStepBlock_Workflow] +from .create_workflow_block_dto_steps_item import CreateWorkflowBlockDtoStepsItem # noqa: E402 + +update_forward_refs(CallbackStep, HandoffStepBlock_Workflow=HandoffStepBlock_Workflow) +update_forward_refs(CreateWorkflowBlockDto, HandoffStepBlock_Workflow=HandoffStepBlock_Workflow) +update_forward_refs(HandoffStep, HandoffStepBlock_Workflow=HandoffStepBlock_Workflow) +update_forward_refs(HandoffStepBlock_Workflow) diff --git a/src/vapi/types/import_twilio_phone_number_dto.py b/src/vapi/types/import_twilio_phone_number_dto.py new file mode 100644 index 0000000..1ef045e --- /dev/null +++ b/src/vapi/types/import_twilio_phone_number_dto.py @@ -0,0 +1,91 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .import_twilio_phone_number_dto_fallback_destination import ImportTwilioPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ImportTwilioPhoneNumberDto(UniversalBaseModel): + fallback_destination: typing_extensions.Annotated[ + typing.Optional[ImportTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = pydantic.Field(default=None) + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + twilio_phone_number: typing_extensions.Annotated[str, FieldMetadata(alias="twilioPhoneNumber")] = pydantic.Field() + """ + These are the digits of the phone number you own on your Twilio. + """ + + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] = pydantic.Field() + """ + This is your Twilio Account SID that will be used to handle this phone number. + """ + + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] = pydantic.Field() + """ + This is the Twilio Auth Token that will be used to handle this phone number. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the phone number. This is just for your own reference. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/import_twilio_phone_number_dto_fallback_destination.py b/src/vapi/types/import_twilio_phone_number_dto_fallback_destination.py new file mode 100644 index 0000000..5b90ee9 --- /dev/null +++ b/src/vapi/types/import_twilio_phone_number_dto_fallback_destination.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ImportTwilioPhoneNumberDtoFallbackDestination_Number(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ImportTwilioPhoneNumberDtoFallbackDestination_Sip(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ImportTwilioPhoneNumberDtoFallbackDestination = typing.Union[ + ImportTwilioPhoneNumberDtoFallbackDestination_Number, ImportTwilioPhoneNumberDtoFallbackDestination_Sip +] diff --git a/src/vapi/types/import_vonage_phone_number_dto.py b/src/vapi/types/import_vonage_phone_number_dto.py new file mode 100644 index 0000000..c7e59e8 --- /dev/null +++ b/src/vapi/types/import_vonage_phone_number_dto.py @@ -0,0 +1,88 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .import_vonage_phone_number_dto_fallback_destination import ImportVonagePhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ImportVonagePhoneNumberDto(UniversalBaseModel): + fallback_destination: typing_extensions.Annotated[ + typing.Optional[ImportVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = pydantic.Field(default=None) + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + vonage_phone_number: typing_extensions.Annotated[str, FieldMetadata(alias="vonagePhoneNumber")] = pydantic.Field() + """ + These are the digits of the phone number you own on your Vonage. + """ + + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] = pydantic.Field() + """ + This is the credential that is used to make outgoing calls, and do operations like call transfer and hang up. + + You can add the Vonage Credential in the Provider Credentials page on the dashboard to get the credentialId. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the phone number. This is just for your own reference. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/import_vonage_phone_number_dto_fallback_destination.py b/src/vapi/types/import_vonage_phone_number_dto_fallback_destination.py new file mode 100644 index 0000000..a29277b --- /dev/null +++ b/src/vapi/types/import_vonage_phone_number_dto_fallback_destination.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ImportVonagePhoneNumberDtoFallbackDestination_Number(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ImportVonagePhoneNumberDtoFallbackDestination_Sip(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ImportVonagePhoneNumberDtoFallbackDestination = typing.Union[ + ImportVonagePhoneNumberDtoFallbackDestination_Number, ImportVonagePhoneNumberDtoFallbackDestination_Sip +] diff --git a/src/vapi/types/invite_user_dto.py b/src/vapi/types/invite_user_dto.py new file mode 100644 index 0000000..7d336e9 --- /dev/null +++ b/src/vapi/types/invite_user_dto.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .invite_user_dto_role import InviteUserDtoRole +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class InviteUserDto(UniversalBaseModel): + email: str + role: InviteUserDtoRole + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/invite_user_dto_role.py b/src/vapi/types/invite_user_dto_role.py new file mode 100644 index 0000000..c76259c --- /dev/null +++ b/src/vapi/types/invite_user_dto_role.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +InviteUserDtoRole = typing.Union[typing.Literal["admin", "editor", "viewer"], typing.Any] diff --git a/src/vapi/types/json_schema.py b/src/vapi/types/json_schema.py new file mode 100644 index 0000000..ad2b3ba --- /dev/null +++ b/src/vapi/types/json_schema.py @@ -0,0 +1,57 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .json_schema_type import JsonSchemaType +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class JsonSchema(UniversalBaseModel): + type: JsonSchemaType = pydantic.Field() + """ + This is the type of output you'd like. + + `string`, `number`, `integer`, `boolean` are the primitive types and should be obvious. + + `array` and `object` are more interesting and quite powerful. They allow you to define nested structures. + + For `array`, you can define the schema of the items in the array using the `items` property. + + For `object`, you can define the properties of the object using the `properties` property. + """ + + items: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + This is required if the type is "array". This is the schema of the items in the array. + + This is of type JsonSchema. However, Swagger doesn't support circular references. + """ + + properties: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + This is required if the type is "object". This specifies the properties of the object. + + This is a map of string to JsonSchema. However, Swagger doesn't support circular references. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the description to help the model understand what it needs to output. + """ + + required: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + This is a list of properties that are required. + + This only makes sense if the type is "object". + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/json_schema_type.py b/src/vapi/types/json_schema_type.py new file mode 100644 index 0000000..1024c27 --- /dev/null +++ b/src/vapi/types/json_schema_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +JsonSchemaType = typing.Union[typing.Literal["string", "number", "integer", "boolean", "array", "object"], typing.Any] diff --git a/src/vapi/types/knowledge_base.py b/src/vapi/types/knowledge_base.py new file mode 100644 index 0000000..e258bf2 --- /dev/null +++ b/src/vapi/types/knowledge_base.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class KnowledgeBase(UniversalBaseModel): + provider: typing.Literal["canonical"] = "canonical" + top_k: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="topK")] = None + file_ids: typing_extensions.Annotated[typing.List[str], FieldMetadata(alias="fileIds")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/lmnt_credential.py b/src/vapi/types/lmnt_credential.py new file mode 100644 index 0000000..16b158a --- /dev/null +++ b/src/vapi/types/lmnt_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class LmntCredential(UniversalBaseModel): + provider: typing.Literal["lmnt"] = "lmnt" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/lmnt_voice.py b/src/vapi/types/lmnt_voice.py new file mode 100644 index 0000000..28dea80 --- /dev/null +++ b/src/vapi/types/lmnt_voice.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .lmnt_voice_voice_id import LmntVoiceVoiceId +from .chunk_plan import ChunkPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class LmntVoice(UniversalBaseModel): + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether fillers are injected into the model output before inputting it into the voice provider. + + Default `false` because you can achieve better results with prompting the model. + """ + + voice_id: typing_extensions.Annotated[LmntVoiceVoiceId, FieldMetadata(alias="voiceId")] = pydantic.Field() + """ + This is the provider-specific ID that will be used. + """ + + speed: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the speed multiplier that will be used. + """ + + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for chunking the model output before it is sent to the voice provider. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/lmnt_voice_voice_id.py b/src/vapi/types/lmnt_voice_voice_id.py new file mode 100644 index 0000000..f7c5969 --- /dev/null +++ b/src/vapi/types/lmnt_voice_voice_id.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +LmntVoiceVoiceId = typing.Union[typing.Literal["lily"], typing.Literal["daniel"], str] diff --git a/src/vapi/types/log.py b/src/vapi/types/log.py new file mode 100644 index 0000000..aeca7ec --- /dev/null +++ b/src/vapi/types/log.py @@ -0,0 +1,164 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from .log_type import LogType +import typing +from .log_resource import LogResource +from .log_request_http_method import LogRequestHttpMethod +from .error import Error +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class Log(UniversalBaseModel): + time: float = pydantic.Field() + """ + This is the timestamp at which the log was written. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this log belongs to. + """ + + type: LogType = pydantic.Field() + """ + This is the type of the log. + """ + + resource: typing.Optional[LogResource] = pydantic.Field(default=None) + """ + This is the specific resource, relevant only to API logs. + """ + + request_duration_seconds: typing_extensions.Annotated[float, FieldMetadata(alias="requestDurationSeconds")] = ( + pydantic.Field() + ) + """ + 'This is how long the request took. + """ + + request_started_at: typing_extensions.Annotated[str, FieldMetadata(alias="requestStartedAt")] = pydantic.Field() + """ + This is the timestamp at which the request began. + """ + + request_finished_at: typing_extensions.Annotated[str, FieldMetadata(alias="requestFinishedAt")] = pydantic.Field() + """ + This is the timestamp at which the request finished. + """ + + request_body: typing_extensions.Annotated[ + typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="requestBody") + ] = pydantic.Field() + """ + This is the body of the request. + """ + + request_http_method: typing_extensions.Annotated[LogRequestHttpMethod, FieldMetadata(alias="requestHttpMethod")] = ( + pydantic.Field() + ) + """ + This is the request method. + """ + + request_url: typing_extensions.Annotated[str, FieldMetadata(alias="requestUrl")] = pydantic.Field() + """ + This is the request URL. + """ + + request_path: typing_extensions.Annotated[str, FieldMetadata(alias="requestPath")] = pydantic.Field() + """ + This is the request path. + """ + + request_query: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="requestQuery")] = ( + pydantic.Field(default=None) + ) + """ + This is the request query. + """ + + response_http_code: typing_extensions.Annotated[float, FieldMetadata(alias="responseHttpCode")] = pydantic.Field() + """ + This the HTTP status code of the response. + """ + + request_ip_address: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="requestIpAddress")] = ( + pydantic.Field(default=None) + ) + """ + This is the request IP address. + """ + + request_origin: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="requestOrigin")] = ( + pydantic.Field(default=None) + ) + """ + This is the origin of the request + """ + + response_body: typing_extensions.Annotated[ + typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="responseBody") + ] = pydantic.Field(default=None) + """ + This is the body of the response. + """ + + request_headers: typing_extensions.Annotated[ + typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="requestHeaders") + ] = pydantic.Field(default=None) + """ + These are the headers of the request. + """ + + error: typing.Optional[Error] = pydantic.Field(default=None) + """ + This is the error, if one occurred. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the ID of the assistant. + """ + + phone_number_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="phoneNumberId")] = ( + pydantic.Field(default=None) + ) + """ + This is the ID of the phone number. + """ + + customer_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customerId")] = pydantic.Field( + default=None + ) + """ + This is the ID of the customer. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the ID of the squad. + """ + + call_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callId")] = pydantic.Field( + default=None + ) + """ + This is the ID of the call. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/log_request_http_method.py b/src/vapi/types/log_request_http_method.py new file mode 100644 index 0000000..f473488 --- /dev/null +++ b/src/vapi/types/log_request_http_method.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +LogRequestHttpMethod = typing.Union[typing.Literal["POST", "GET", "PUT", "PATCH", "DELETE"], typing.Any] diff --git a/src/vapi/types/log_resource.py b/src/vapi/types/log_resource.py new file mode 100644 index 0000000..7e35ea0 --- /dev/null +++ b/src/vapi/types/log_resource.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +LogResource = typing.Union[ + typing.Literal["assistant", "phone-number", "tool", "squad", "call", "file", "metric", "log"], typing.Any +] diff --git a/src/vapi/types/log_type.py b/src/vapi/types/log_type.py new file mode 100644 index 0000000..d18d5af --- /dev/null +++ b/src/vapi/types/log_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +LogType = typing.Union[typing.Literal["API", "Webhook", "Call", "Provider"], typing.Any] diff --git a/src/vapi/types/logs_paginated_response.py b/src/vapi/types/logs_paginated_response.py new file mode 100644 index 0000000..c6562a5 --- /dev/null +++ b/src/vapi/types/logs_paginated_response.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .log import Log +from .pagination_meta import PaginationMeta +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class LogsPaginatedResponse(UniversalBaseModel): + results: typing.List[Log] + metadata: PaginationMeta + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/make_credential.py b/src/vapi/types/make_credential.py new file mode 100644 index 0000000..609725c --- /dev/null +++ b/src/vapi/types/make_credential.py @@ -0,0 +1,56 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class MakeCredential(UniversalBaseModel): + provider: typing.Literal["make"] = "make" + team_id: typing_extensions.Annotated[str, FieldMetadata(alias="teamId")] = pydantic.Field() + """ + Team ID + """ + + region: str = pydantic.Field() + """ + Region of your application. For example: eu1, eu2, us1, us2 + """ + + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/make_tool.py b/src/vapi/types/make_tool.py new file mode 100644 index 0000000..71beaeb --- /dev/null +++ b/src/vapi/types/make_tool.py @@ -0,0 +1,84 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .make_tool_messages_item import MakeToolMessagesItem +import datetime as dt +from .open_ai_function import OpenAiFunction +from .server import Server +from .make_tool_metadata import MakeToolMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class MakeTool(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[MakeToolMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the tool. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the organization that this tool belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was last updated. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + metadata: MakeToolMetadata + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/make_tool_messages_item.py b/src/vapi/types/make_tool_messages_item.py new file mode 100644 index 0000000..eb7b423 --- /dev/null +++ b/src/vapi/types/make_tool_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class MakeToolMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class MakeToolMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class MakeToolMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class MakeToolMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +MakeToolMessagesItem = typing.Union[ + MakeToolMessagesItem_RequestStart, + MakeToolMessagesItem_RequestComplete, + MakeToolMessagesItem_RequestFailed, + MakeToolMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/make_tool_metadata.py b/src/vapi/types/make_tool_metadata.py new file mode 100644 index 0000000..aa6d049 --- /dev/null +++ b/src/vapi/types/make_tool_metadata.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class MakeToolMetadata(UniversalBaseModel): + scenario_id: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="scenarioId")] = None + trigger_hook_id: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="triggerHookId")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/make_tool_provider_details.py b/src/vapi/types/make_tool_provider_details.py new file mode 100644 index 0000000..1274265 --- /dev/null +++ b/src/vapi/types/make_tool_provider_details.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .tool_template_setup import ToolTemplateSetup +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class MakeToolProviderDetails(UniversalBaseModel): + template_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateUrl")] = ( + pydantic.Field(default=None) + ) + """ + This is the Template URL or the Snapshot URL corresponding to the Template. + """ + + setup_instructions: typing_extensions.Annotated[ + typing.Optional[typing.List[ToolTemplateSetup]], FieldMetadata(alias="setupInstructions") + ] = None + scenario_id: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="scenarioId")] = None + scenario_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="scenarioName")] = None + trigger_hook_id: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="triggerHookId")] = None + trigger_hook_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="triggerHookName")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/make_tool_with_tool_call.py b/src/vapi/types/make_tool_with_tool_call.py new file mode 100644 index 0000000..b780e7c --- /dev/null +++ b/src/vapi/types/make_tool_with_tool_call.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .make_tool_with_tool_call_messages_item import MakeToolWithToolCallMessagesItem +from .tool_call import ToolCall +from .make_tool_metadata import MakeToolMetadata +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class MakeToolWithToolCall(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[MakeToolWithToolCallMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/make_tool_with_tool_call_messages_item.py b/src/vapi/types/make_tool_with_tool_call_messages_item.py new file mode 100644 index 0000000..41ff790 --- /dev/null +++ b/src/vapi/types/make_tool_with_tool_call_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class MakeToolWithToolCallMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class MakeToolWithToolCallMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class MakeToolWithToolCallMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class MakeToolWithToolCallMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +MakeToolWithToolCallMessagesItem = typing.Union[ + MakeToolWithToolCallMessagesItem_RequestStart, + MakeToolWithToolCallMessagesItem_RequestComplete, + MakeToolWithToolCallMessagesItem_RequestFailed, + MakeToolWithToolCallMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/message_plan.py b/src/vapi/types/message_plan.py new file mode 100644 index 0000000..651466a --- /dev/null +++ b/src/vapi/types/message_plan.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class MessagePlan(UniversalBaseModel): + idle_messages: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="idleMessages") + ] = pydantic.Field(default=None) + """ + This are the messages that the assistant will speak when the user hasn't responded for `idleTimeoutSeconds`. Each time the timeout is triggered, a random message will be chosen from this array. + + Usage: + + - If user gets distracted and doesn't respond for a while, this can be used to grab their attention. + - If the transcriber doesn't pick up what the user said, this can be used to ask the user to repeat themselves. (From the perspective of the assistant, the conversation is idle since it didn't "hear" any user messages.) + + @default null (no idle message is spoken) + """ + + idle_message_max_spoken_count: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="idleMessageMaxSpokenCount") + ] = pydantic.Field(default=None) + """ + This determines the maximum number of times `idleMessages` can be spoken during the call. + + @default 3 + """ + + idle_timeout_seconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="idleTimeoutSeconds") + ] = pydantic.Field(default=None) + """ + This is the timeout in seconds before a message from `idleMessages` is spoken. The clock starts when the assistant finishes speaking and remains active until the user speaks. + + @default 10 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/metrics.py b/src/vapi/types/metrics.py new file mode 100644 index 0000000..87ac6d5 --- /dev/null +++ b/src/vapi/types/metrics.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +from ..core.serialization import FieldMetadata +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class Metrics(UniversalBaseModel): + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] + range_start: typing_extensions.Annotated[str, FieldMetadata(alias="rangeStart")] + range_end: typing_extensions.Annotated[str, FieldMetadata(alias="rangeEnd")] + bill: float + bill_within_billing_limit: typing_extensions.Annotated[bool, FieldMetadata(alias="billWithinBillingLimit")] + bill_daily_breakdown: typing_extensions.Annotated[ + typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="billDailyBreakdown") + ] + call_active: typing_extensions.Annotated[float, FieldMetadata(alias="callActive")] + call_active_within_concurrency_limit: typing_extensions.Annotated[ + bool, FieldMetadata(alias="callActiveWithinConcurrencyLimit") + ] + call_minutes: typing_extensions.Annotated[float, FieldMetadata(alias="callMinutes")] + call_minutes_daily_breakdown: typing_extensions.Annotated[ + typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="callMinutesDailyBreakdown") + ] + call_minutes_average: typing_extensions.Annotated[float, FieldMetadata(alias="callMinutesAverage")] + call_minutes_average_daily_breakdown: typing_extensions.Annotated[ + typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="callMinutesAverageDailyBreakdown") + ] + call_count: typing_extensions.Annotated[float, FieldMetadata(alias="callCount")] + call_count_daily_breakdown: typing_extensions.Annotated[ + typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="callCountDailyBreakdown") + ] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/model_based_condition.py b/src/vapi/types/model_based_condition.py new file mode 100644 index 0000000..b76e2bc --- /dev/null +++ b/src/vapi/types/model_based_condition.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ModelBasedCondition(UniversalBaseModel): + instruction: str = pydantic.Field() + """ + This is the instruction which should output a boolean value when passed to a model. + + You can reference any variable in the context of the current block execution (step): + + - "{{output.your-property-name}}" for current step's output + - "{{input.your-property-name}}" for current step's input + - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) + - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) + - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) + - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) + - "{{workflow.input.your-property-name}}" for the current workflow's input + - "{{global.your-property-name}}" for the global context + + You can also talk about the current step's output or input directly: + + - "{{output.your-property-name}} is greater than 10" + - "{{input.your-property-name}} is greater than 10" + + Examples: + + - "{{input.age}} is greater than 10" + - "{{input.age}} is greater than {{input.age2}}" + - "{{output.age}} is greater than 10" + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.input/output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.input/output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/model_cost.py b/src/vapi/types/model_cost.py new file mode 100644 index 0000000..05cee11 --- /dev/null +++ b/src/vapi/types/model_cost.py @@ -0,0 +1,48 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ModelCost(UniversalBaseModel): + model: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() + """ + This is the model that was used during the call. + + This matches one of the following: + + - `call.assistant.model`, + - `call.assistantId->model`, + - `call.squad[n].assistant.model`, + - `call.squad[n].assistantId->model`, + - `call.squadId->[n].assistant.model`, + - `call.squadId->[n].assistantId->model`. + """ + + prompt_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="promptTokens")] = pydantic.Field() + """ + This is the number of prompt tokens used in the call. These should be total prompt tokens used in the call for single assistant calls, while squad calls will have multiple model costs one for each assistant that was used. + """ + + completion_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="completionTokens")] = pydantic.Field() + """ + This is the number of completion tokens generated in the call. These should be total completion tokens used in the call for single assistant calls, while squad calls will have multiple model costs one for each assistant that was used. + """ + + cost: float = pydantic.Field() + """ + This is the cost of the component in USD. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/monitor.py b/src/vapi/types/monitor.py new file mode 100644 index 0000000..6c7f696 --- /dev/null +++ b/src/vapi/types/monitor.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class Monitor(UniversalBaseModel): + listen_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="listenUrl")] = pydantic.Field( + default=None + ) + """ + This is the URL where the assistant's calls can be listened to in real-time. To enable, set `assistant.monitorPlan.listenEnabled` to `true`. + """ + + control_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="controlUrl")] = pydantic.Field( + default=None + ) + """ + This is the URL where the assistant's calls can be controlled in real-time. To enable, set `assistant.monitorPlan.controlEnabled` to `true`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/monitor_plan.py b/src/vapi/types/monitor_plan.py new file mode 100644 index 0000000..fb590db --- /dev/null +++ b/src/vapi/types/monitor_plan.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class MonitorPlan(UniversalBaseModel): + listen_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="listenEnabled")] = ( + pydantic.Field(default=None) + ) + """ + This determines whether the assistant's calls allow live listening. Defaults to true. + + Fetch `call.monitor.listenUrl` to get the live listening URL. + + @default true + """ + + control_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="controlEnabled")] = ( + pydantic.Field(default=None) + ) + """ + This determines whether the assistant's calls allow live control. Defaults to true. + + Fetch `call.monitor.controlUrl` to get the live control URL. + + To use, send any control message via a POST request to `call.monitor.controlUrl`. Here are the types of controls supported: https://docs.vapi.ai/api-reference/messages/client-inbound-message + + @default true + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/neets_voice.py b/src/vapi/types/neets_voice.py new file mode 100644 index 0000000..c597ebc --- /dev/null +++ b/src/vapi/types/neets_voice.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .neets_voice_voice_id import NeetsVoiceVoiceId +from .chunk_plan import ChunkPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class NeetsVoice(UniversalBaseModel): + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether fillers are injected into the model output before inputting it into the voice provider. + + Default `false` because you can achieve better results with prompting the model. + """ + + voice_id: typing_extensions.Annotated[NeetsVoiceVoiceId, FieldMetadata(alias="voiceId")] = pydantic.Field() + """ + This is the provider-specific ID that will be used. + """ + + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for chunking the model output before it is sent to the voice provider. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/neets_voice_voice_id.py b/src/vapi/types/neets_voice_voice_id.py new file mode 100644 index 0000000..f9b908f --- /dev/null +++ b/src/vapi/types/neets_voice_voice_id.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +NeetsVoiceVoiceId = typing.Union[typing.Literal["vits"], typing.Literal["vits"], str] diff --git a/src/vapi/types/open_ai_credential.py b/src/vapi/types/open_ai_credential.py new file mode 100644 index 0000000..53a34ca --- /dev/null +++ b/src/vapi/types/open_ai_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class OpenAiCredential(UniversalBaseModel): + provider: typing.Literal["openai"] = "openai" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/open_ai_function.py b/src/vapi/types/open_ai_function.py new file mode 100644 index 0000000..13e9e1b --- /dev/null +++ b/src/vapi/types/open_ai_function.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing +from .open_ai_function_parameters import OpenAiFunctionParameters +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class OpenAiFunction(UniversalBaseModel): + name: str = pydantic.Field() + """ + This is the the name of the function to be called. + + Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + """ + + description: typing.Optional[str] = None + parameters: typing.Optional[OpenAiFunctionParameters] = pydantic.Field(default=None) + """ + These are the parameters the functions accepts, described as a JSON Schema object. + + See the [OpenAI guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema) for documentation about the format. + + Omitting parameters defines a function with an empty parameter list. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/open_ai_function_parameters.py b/src/vapi/types/open_ai_function_parameters.py new file mode 100644 index 0000000..cde1d81 --- /dev/null +++ b/src/vapi/types/open_ai_function_parameters.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +from .json_schema import JsonSchema +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class OpenAiFunctionParameters(UniversalBaseModel): + type: typing.Literal["object"] = pydantic.Field(default="object") + """ + This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties. + """ + + properties: typing.Dict[str, JsonSchema] = pydantic.Field() + """ + This provides a description of the properties required by the function. + JSON Schema can be used to specify expectations for each property. + Refer to [this doc](https://ajv.js.org/json-schema.html#json-data-type) for a comprehensive guide on JSON Schema. + """ + + required: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + This specifies the properties that are required by the function. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/open_ai_message.py b/src/vapi/types/open_ai_message.py new file mode 100644 index 0000000..a32cafe --- /dev/null +++ b/src/vapi/types/open_ai_message.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message_role import OpenAiMessageRole +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class OpenAiMessage(UniversalBaseModel): + content: typing.Optional[str] = None + role: OpenAiMessageRole + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/open_ai_message_role.py b/src/vapi/types/open_ai_message_role.py new file mode 100644 index 0000000..713d643 --- /dev/null +++ b/src/vapi/types/open_ai_message_role.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +OpenAiMessageRole = typing.Union[typing.Literal["assistant", "function", "user", "system", "tool"], typing.Any] diff --git a/src/vapi/types/open_ai_model.py b/src/vapi/types/open_ai_model.py new file mode 100644 index 0000000..2815111 --- /dev/null +++ b/src/vapi/types/open_ai_model.py @@ -0,0 +1,101 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +import pydantic +from .open_ai_model_tools_item import OpenAiModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .open_ai_model_model import OpenAiModelModel +from .open_ai_model_fallback_models_item import OpenAiModelFallbackModelsItem +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class OpenAiModel(UniversalBaseModel): + messages: typing.Optional[typing.List[OpenAiMessage]] = pydantic.Field(default=None) + """ + This is the starting state for the conversation. + """ + + tools: typing.Optional[typing.List[OpenAiModelToolsItem]] = pydantic.Field(default=None) + """ + These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. + + Both `tools` and `toolIds` can be used together. + """ + + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = ( + pydantic.Field(default=None) + ) + """ + These are the tools that the assistant can use during the call. To use transient tools, use `tools`. + + Both `tools` and `toolIds` can be used together. + """ + + model: OpenAiModelModel = pydantic.Field() + """ + This is the OpenAI model that will be used. + """ + + fallback_models: typing_extensions.Annotated[ + typing.Optional[typing.List[OpenAiModelFallbackModelsItem]], FieldMetadata(alias="fallbackModels") + ] = pydantic.Field(default=None) + """ + These are the fallback models that will be used if the primary model fails. This shouldn't be specified unless you have a specific reason to do so. Vapi will automatically find the fastest fallbacks that make sense. + """ + + semantic_caching_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="semanticCachingEnabled") + ] = None + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + """ + + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = pydantic.Field(default=None) + """ + These are the options for the knowledge base. + """ + + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = pydantic.Field( + default=None + ) + """ + This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + """ + + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether we detect user's emotion while they speak and send it as an additional info to model. + + Default `false` because the model is usually are good at understanding the user's emotion from text. + + @default false + """ + + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = ( + pydantic.Field(default=None) + ) + """ + This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + + Default is 0. + + @default 0 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/open_ai_model_fallback_models_item.py b/src/vapi/types/open_ai_model_fallback_models_item.py new file mode 100644 index 0000000..ce6a039 --- /dev/null +++ b/src/vapi/types/open_ai_model_fallback_models_item.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +OpenAiModelFallbackModelsItem = typing.Union[ + typing.Literal[ + "gpt-4o-mini", + "gpt-4o-mini-2024-07-18", + "gpt-4o", + "gpt-4o-2024-05-13", + "gpt-4o-2024-08-06", + "gpt-4-turbo", + "gpt-4-turbo-2024-04-09", + "gpt-4-turbo-preview", + "gpt-4-0125-preview", + "gpt-4-1106-preview", + "gpt-4", + "gpt-4-0613", + "gpt-3.5-turbo", + "gpt-3.5-turbo-0125", + "gpt-3.5-turbo-1106", + "gpt-3.5-turbo-16k", + "gpt-3.5-turbo-0613", + ], + typing.Any, +] diff --git a/src/vapi/types/open_ai_model_model.py b/src/vapi/types/open_ai_model_model.py new file mode 100644 index 0000000..b8d64e5 --- /dev/null +++ b/src/vapi/types/open_ai_model_model.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +OpenAiModelModel = typing.Union[ + typing.Literal[ + "gpt-4o-mini", + "gpt-4o-mini-2024-07-18", + "gpt-4o", + "gpt-4o-2024-05-13", + "gpt-4o-2024-08-06", + "gpt-4-turbo", + "gpt-4-turbo-2024-04-09", + "gpt-4-turbo-preview", + "gpt-4-0125-preview", + "gpt-4-1106-preview", + "gpt-4", + "gpt-4-0613", + "gpt-3.5-turbo", + "gpt-3.5-turbo-0125", + "gpt-3.5-turbo-1106", + "gpt-3.5-turbo-16k", + "gpt-3.5-turbo-0613", + ], + typing.Any, +] diff --git a/src/vapi/types/open_ai_model_tools_item.py b/src/vapi/types/open_ai_model_tools_item.py new file mode 100644 index 0000000..0a99378 --- /dev/null +++ b/src/vapi/types/open_ai_model_tools_item.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class OpenAiModelToolsItem_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OpenAiModelToolsItem_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OpenAiModelToolsItem_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OpenAiModelToolsItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OpenAiModelToolsItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OpenAiModelToolsItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OpenAiModelToolsItem_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +OpenAiModelToolsItem = typing.Union[ + OpenAiModelToolsItem_Dtmf, + OpenAiModelToolsItem_EndCall, + OpenAiModelToolsItem_Voicemail, + OpenAiModelToolsItem_Function, + OpenAiModelToolsItem_Ghl, + OpenAiModelToolsItem_Make, + OpenAiModelToolsItem_TransferCall, +] diff --git a/src/vapi/types/open_ai_voice.py b/src/vapi/types/open_ai_voice.py new file mode 100644 index 0000000..c1173c4 --- /dev/null +++ b/src/vapi/types/open_ai_voice.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .open_ai_voice_voice_id import OpenAiVoiceVoiceId +from .chunk_plan import ChunkPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class OpenAiVoice(UniversalBaseModel): + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether fillers are injected into the model output before inputting it into the voice provider. + + Default `false` because you can achieve better results with prompting the model. + """ + + voice_id: typing_extensions.Annotated[OpenAiVoiceVoiceId, FieldMetadata(alias="voiceId")] = pydantic.Field() + """ + This is the provider-specific ID that will be used. + """ + + speed: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the speed multiplier that will be used. + """ + + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for chunking the model output before it is sent to the voice provider. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/open_ai_voice_voice_id.py b/src/vapi/types/open_ai_voice_voice_id.py new file mode 100644 index 0000000..97b1b8c --- /dev/null +++ b/src/vapi/types/open_ai_voice_voice_id.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +OpenAiVoiceVoiceId = typing.Union[typing.Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer"], typing.Any] diff --git a/src/vapi/types/open_router_credential.py b/src/vapi/types/open_router_credential.py new file mode 100644 index 0000000..fb8650a --- /dev/null +++ b/src/vapi/types/open_router_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class OpenRouterCredential(UniversalBaseModel): + provider: typing.Literal["openrouter"] = "openrouter" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/open_router_model.py b/src/vapi/types/open_router_model.py new file mode 100644 index 0000000..b04e5ad --- /dev/null +++ b/src/vapi/types/open_router_model.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +import pydantic +from .open_router_model_tools_item import OpenRouterModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class OpenRouterModel(UniversalBaseModel): + messages: typing.Optional[typing.List[OpenAiMessage]] = pydantic.Field(default=None) + """ + This is the starting state for the conversation. + """ + + tools: typing.Optional[typing.List[OpenRouterModelToolsItem]] = pydantic.Field(default=None) + """ + These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. + + Both `tools` and `toolIds` can be used together. + """ + + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = ( + pydantic.Field(default=None) + ) + """ + These are the tools that the assistant can use during the call. To use transient tools, use `tools`. + + Both `tools` and `toolIds` can be used together. + """ + + model: str = pydantic.Field() + """ + This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b + """ + + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + """ + + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = pydantic.Field(default=None) + """ + These are the options for the knowledge base. + """ + + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = pydantic.Field( + default=None + ) + """ + This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + """ + + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether we detect user's emotion while they speak and send it as an additional info to model. + + Default `false` because the model is usually are good at understanding the user's emotion from text. + + @default false + """ + + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = ( + pydantic.Field(default=None) + ) + """ + This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + + Default is 0. + + @default 0 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/open_router_model_tools_item.py b/src/vapi/types/open_router_model_tools_item.py new file mode 100644 index 0000000..fe7a432 --- /dev/null +++ b/src/vapi/types/open_router_model_tools_item.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class OpenRouterModelToolsItem_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OpenRouterModelToolsItem_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OpenRouterModelToolsItem_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OpenRouterModelToolsItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OpenRouterModelToolsItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OpenRouterModelToolsItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OpenRouterModelToolsItem_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +OpenRouterModelToolsItem = typing.Union[ + OpenRouterModelToolsItem_Dtmf, + OpenRouterModelToolsItem_EndCall, + OpenRouterModelToolsItem_Voicemail, + OpenRouterModelToolsItem_Function, + OpenRouterModelToolsItem_Ghl, + OpenRouterModelToolsItem_Make, + OpenRouterModelToolsItem_TransferCall, +] diff --git a/src/vapi/types/org.py b/src/vapi/types/org.py new file mode 100644 index 0000000..2b7fc66 --- /dev/null +++ b/src/vapi/types/org.py @@ -0,0 +1,120 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from .org_plan import OrgPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class Org(UniversalBaseModel): + hipaa_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="hipaaEnabled")] = ( + pydantic.Field(default=None) + ) + """ + When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + When HIPAA is enabled, only OpenAI/Custom LLM or Azure Providers will be available for LLM and Voice respectively. + This is due to the compliance requirements of HIPAA. Other providers may not meet these requirements. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the org. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the org was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the org was last updated. + """ + + stripe_customer_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="stripeCustomerId")] = ( + pydantic.Field(default=None) + ) + """ + This is the Stripe customer for the org. + """ + + stripe_subscription_id: typing_extensions.Annotated[ + typing.Optional[str], FieldMetadata(alias="stripeSubscriptionId") + ] = pydantic.Field(default=None) + """ + This is the subscription for the org. + """ + + stripe_subscription_item_id: typing_extensions.Annotated[ + typing.Optional[str], FieldMetadata(alias="stripeSubscriptionItemId") + ] = pydantic.Field(default=None) + """ + This is the subscription's subscription item. + """ + + stripe_subscription_current_period_start: typing_extensions.Annotated[ + typing.Optional[dt.datetime], FieldMetadata(alias="stripeSubscriptionCurrentPeriodStart") + ] = pydantic.Field(default=None) + """ + This is the subscription's current period start. + """ + + stripe_subscription_status: typing_extensions.Annotated[ + typing.Optional[str], FieldMetadata(alias="stripeSubscriptionStatus") + ] = pydantic.Field(default=None) + """ + This is the subscription's status. + """ + + plan: typing.Optional[OrgPlan] = pydantic.Field(default=None) + """ + This is the plan for the org. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the org. This is just for your own reference. + """ + + billing_limit: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="billingLimit")] = ( + pydantic.Field(default=None) + ) + """ + This is the monthly billing limit for the org. To go beyond $1000/mo, please contact us at support@vapi.ai. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + + All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + """ + + concurrency_limit: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="concurrencyLimit")] = ( + pydantic.Field(default=None) + ) + """ + This is the concurrency limit for the org. This is the maximum number of calls that can be active at any given time. To go beyond 10, please contact us at support@vapi.ai. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/org_plan.py b/src/vapi/types/org_plan.py new file mode 100644 index 0000000..ad23d4a --- /dev/null +++ b/src/vapi/types/org_plan.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class OrgPlan(UniversalBaseModel): + included_providers: typing_extensions.Annotated[ + typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]], + FieldMetadata(alias="includedProviders"), + ] = None + included_minutes: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="includedMinutes")] = None + cost_per_overage_minute: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="costPerOverageMinute") + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/output_tool.py b/src/vapi/types/output_tool.py new file mode 100644 index 0000000..9837166 --- /dev/null +++ b/src/vapi/types/output_tool.py @@ -0,0 +1,81 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .output_tool_messages_item import OutputToolMessagesItem +import datetime as dt +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class OutputTool(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[OutputToolMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the tool. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the organization that this tool belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was last updated. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/output_tool_messages_item.py b/src/vapi/types/output_tool_messages_item.py new file mode 100644 index 0000000..9f2f686 --- /dev/null +++ b/src/vapi/types/output_tool_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class OutputToolMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OutputToolMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OutputToolMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OutputToolMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +OutputToolMessagesItem = typing.Union[ + OutputToolMessagesItem_RequestStart, + OutputToolMessagesItem_RequestComplete, + OutputToolMessagesItem_RequestFailed, + OutputToolMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/pagination_meta.py b/src/vapi/types/pagination_meta.py new file mode 100644 index 0000000..77fddf7 --- /dev/null +++ b/src/vapi/types/pagination_meta.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class PaginationMeta(UniversalBaseModel): + items_per_page: typing_extensions.Annotated[float, FieldMetadata(alias="itemsPerPage")] + total_items: typing_extensions.Annotated[float, FieldMetadata(alias="totalItems")] + current_page: typing_extensions.Annotated[float, FieldMetadata(alias="currentPage")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/perplexity_ai_credential.py b/src/vapi/types/perplexity_ai_credential.py new file mode 100644 index 0000000..13963c5 --- /dev/null +++ b/src/vapi/types/perplexity_ai_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class PerplexityAiCredential(UniversalBaseModel): + provider: typing.Literal["perplexity-ai"] = "perplexity-ai" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/perplexity_ai_model.py b/src/vapi/types/perplexity_ai_model.py new file mode 100644 index 0000000..05931d4 --- /dev/null +++ b/src/vapi/types/perplexity_ai_model.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +import pydantic +from .perplexity_ai_model_tools_item import PerplexityAiModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class PerplexityAiModel(UniversalBaseModel): + messages: typing.Optional[typing.List[OpenAiMessage]] = pydantic.Field(default=None) + """ + This is the starting state for the conversation. + """ + + tools: typing.Optional[typing.List[PerplexityAiModelToolsItem]] = pydantic.Field(default=None) + """ + These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. + + Both `tools` and `toolIds` can be used together. + """ + + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = ( + pydantic.Field(default=None) + ) + """ + These are the tools that the assistant can use during the call. To use transient tools, use `tools`. + + Both `tools` and `toolIds` can be used together. + """ + + model: str = pydantic.Field() + """ + This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b + """ + + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + """ + + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = pydantic.Field(default=None) + """ + These are the options for the knowledge base. + """ + + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = pydantic.Field( + default=None + ) + """ + This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + """ + + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether we detect user's emotion while they speak and send it as an additional info to model. + + Default `false` because the model is usually are good at understanding the user's emotion from text. + + @default false + """ + + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = ( + pydantic.Field(default=None) + ) + """ + This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + + Default is 0. + + @default 0 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/perplexity_ai_model_tools_item.py b/src/vapi/types/perplexity_ai_model_tools_item.py new file mode 100644 index 0000000..047bd9a --- /dev/null +++ b/src/vapi/types/perplexity_ai_model_tools_item.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class PerplexityAiModelToolsItem_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PerplexityAiModelToolsItem_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PerplexityAiModelToolsItem_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PerplexityAiModelToolsItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PerplexityAiModelToolsItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PerplexityAiModelToolsItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PerplexityAiModelToolsItem_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +PerplexityAiModelToolsItem = typing.Union[ + PerplexityAiModelToolsItem_Dtmf, + PerplexityAiModelToolsItem_EndCall, + PerplexityAiModelToolsItem_Voicemail, + PerplexityAiModelToolsItem_Function, + PerplexityAiModelToolsItem_Ghl, + PerplexityAiModelToolsItem_Make, + PerplexityAiModelToolsItem_TransferCall, +] diff --git a/src/vapi/types/play_ht_credential.py b/src/vapi/types/play_ht_credential.py new file mode 100644 index 0000000..dbf01f1 --- /dev/null +++ b/src/vapi/types/play_ht_credential.py @@ -0,0 +1,48 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class PlayHtCredential(UniversalBaseModel): + provider: typing.Literal["playht"] = "playht" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + user_id: typing_extensions.Annotated[str, FieldMetadata(alias="userId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/play_ht_voice.py b/src/vapi/types/play_ht_voice.py new file mode 100644 index 0000000..a0f7e55 --- /dev/null +++ b/src/vapi/types/play_ht_voice.py @@ -0,0 +1,79 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .play_ht_voice_voice_id import PlayHtVoiceVoiceId +from .play_ht_voice_emotion import PlayHtVoiceEmotion +from .chunk_plan import ChunkPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class PlayHtVoice(UniversalBaseModel): + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether fillers are injected into the model output before inputting it into the voice provider. + + Default `false` because you can achieve better results with prompting the model. + """ + + voice_id: typing_extensions.Annotated[PlayHtVoiceVoiceId, FieldMetadata(alias="voiceId")] = pydantic.Field() + """ + This is the provider-specific ID that will be used. + """ + + speed: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the speed multiplier that will be used. + """ + + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + A floating point number between 0, exclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature will be used. The temperature parameter controls variance. Lower temperatures result in more predictable results, higher temperatures allow each run to vary more, so the voice may sound less like the baseline voice. + """ + + emotion: typing.Optional[PlayHtVoiceEmotion] = pydantic.Field(default=None) + """ + An emotion to be applied to the speech. + """ + + voice_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="voiceGuidance")] = ( + pydantic.Field(default=None) + ) + """ + A number between 1 and 6. Use lower numbers to reduce how unique your chosen voice will be compared to other voices. + """ + + style_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="styleGuidance")] = ( + pydantic.Field(default=None) + ) + """ + A number between 1 and 30. Use lower numbers to to reduce how strong your chosen emotion will be. Higher numbers will create a very emotional performance. + """ + + text_guidance: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="textGuidance")] = ( + pydantic.Field(default=None) + ) + """ + A number between 1 and 2. This number influences how closely the generated speech adheres to the input text. Use lower values to create more fluid speech, but with a higher chance of deviating from the input text. Higher numbers will make the generated speech more accurate to the input text, ensuring that the words spoken align closely with the provided text. + """ + + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for chunking the model output before it is sent to the voice provider. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/play_ht_voice_emotion.py b/src/vapi/types/play_ht_voice_emotion.py new file mode 100644 index 0000000..90ae5ea --- /dev/null +++ b/src/vapi/types/play_ht_voice_emotion.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PlayHtVoiceEmotion = typing.Union[ + typing.Literal[ + "female_happy", + "female_sad", + "female_angry", + "female_fearful", + "female_disgust", + "female_surprised", + "male_happy", + "male_sad", + "male_angry", + "male_fearful", + "male_disgust", + "male_surprised", + ], + typing.Any, +] diff --git a/src/vapi/types/play_ht_voice_voice_id.py b/src/vapi/types/play_ht_voice_voice_id.py new file mode 100644 index 0000000..07162b5 --- /dev/null +++ b/src/vapi/types/play_ht_voice_voice_id.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PlayHtVoiceVoiceId = typing.Union[ + typing.Literal["jennifer"], + typing.Literal["melissa"], + typing.Literal["will"], + typing.Literal["chris"], + typing.Literal["matt"], + typing.Literal["jack"], + typing.Literal["ruby"], + typing.Literal["davis"], + typing.Literal["donna"], + typing.Literal["michael"], + str, +] diff --git a/src/vapi/types/regex_option.py b/src/vapi/types/regex_option.py new file mode 100644 index 0000000..d47d751 --- /dev/null +++ b/src/vapi/types/regex_option.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .regex_option_type import RegexOptionType +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class RegexOption(UniversalBaseModel): + type: RegexOptionType = pydantic.Field() + """ + This is the type of the regex option. Options are: + + - `ignore-case`: Ignores the case of the text being matched. + - `whole-word`: Matches whole words only. + - `multi-line`: Matches across multiple lines. + """ + + enabled: bool = pydantic.Field() + """ + This is whether to enable the option. + + @default false + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/regex_option_type.py b/src/vapi/types/regex_option_type.py new file mode 100644 index 0000000..cf5408e --- /dev/null +++ b/src/vapi/types/regex_option_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RegexOptionType = typing.Union[typing.Literal["ignore-case", "whole-word", "multi-line"], typing.Any] diff --git a/src/vapi/types/regex_replacement.py b/src/vapi/types/regex_replacement.py new file mode 100644 index 0000000..c92d2d9 --- /dev/null +++ b/src/vapi/types/regex_replacement.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing +from .regex_option import RegexOption +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class RegexReplacement(UniversalBaseModel): + regex: str = pydantic.Field() + """ + This is the regex pattern to replace. + """ + + options: typing.Optional[typing.List[RegexOption]] = pydantic.Field(default=None) + """ + These are the options for the regex replacement. Default all options are disabled. + + @default [] + """ + + value: str = pydantic.Field() + """ + This is the value that will replace the match. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/rime_ai_credential.py b/src/vapi/types/rime_ai_credential.py new file mode 100644 index 0000000..bb8acd7 --- /dev/null +++ b/src/vapi/types/rime_ai_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class RimeAiCredential(UniversalBaseModel): + provider: typing.Literal["rime-ai"] = "rime-ai" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/rime_ai_voice.py b/src/vapi/types/rime_ai_voice.py new file mode 100644 index 0000000..00a5a22 --- /dev/null +++ b/src/vapi/types/rime_ai_voice.py @@ -0,0 +1,53 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .rime_ai_voice_voice_id import RimeAiVoiceVoiceId +from .rime_ai_voice_model import RimeAiVoiceModel +from .chunk_plan import ChunkPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class RimeAiVoice(UniversalBaseModel): + filler_injection_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="fillerInjectionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether fillers are injected into the model output before inputting it into the voice provider. + + Default `false` because you can achieve better results with prompting the model. + """ + + voice_id: typing_extensions.Annotated[RimeAiVoiceVoiceId, FieldMetadata(alias="voiceId")] = pydantic.Field() + """ + This is the provider-specific ID that will be used. + """ + + model: typing.Optional[RimeAiVoiceModel] = pydantic.Field(default=None) + """ + This is the model that will be used. Defaults to 'v1' when not specified. + """ + + speed: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the speed multiplier that will be used. + """ + + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for chunking the model output before it is sent to the voice provider. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/rime_ai_voice_model.py b/src/vapi/types/rime_ai_voice_model.py new file mode 100644 index 0000000..d96bc4a --- /dev/null +++ b/src/vapi/types/rime_ai_voice_model.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RimeAiVoiceModel = typing.Union[typing.Literal["v1", "mist"], typing.Any] diff --git a/src/vapi/types/rime_ai_voice_voice_id.py b/src/vapi/types/rime_ai_voice_voice_id.py new file mode 100644 index 0000000..ff718ea --- /dev/null +++ b/src/vapi/types/rime_ai_voice_voice_id.py @@ -0,0 +1,88 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RimeAiVoiceVoiceId = typing.Union[ + typing.Literal["marsh"], + typing.Literal["bayou"], + typing.Literal["creek"], + typing.Literal["brook"], + typing.Literal["flower"], + typing.Literal["spore"], + typing.Literal["glacier"], + typing.Literal["gulch"], + typing.Literal["alpine"], + typing.Literal["cove"], + typing.Literal["lagoon"], + typing.Literal["tundra"], + typing.Literal["steppe"], + typing.Literal["mesa"], + typing.Literal["grove"], + typing.Literal["rainforest"], + typing.Literal["moraine"], + typing.Literal["wildflower"], + typing.Literal["peak"], + typing.Literal["boulder"], + typing.Literal["abbie"], + typing.Literal["allison"], + typing.Literal["ally"], + typing.Literal["alona"], + typing.Literal["amber"], + typing.Literal["ana"], + typing.Literal["antoine"], + typing.Literal["armon"], + typing.Literal["brenda"], + typing.Literal["brittany"], + typing.Literal["carol"], + typing.Literal["colin"], + typing.Literal["courtney"], + typing.Literal["elena"], + typing.Literal["elliot"], + typing.Literal["eva"], + typing.Literal["geoff"], + typing.Literal["gerald"], + typing.Literal["hank"], + typing.Literal["helen"], + typing.Literal["hera"], + typing.Literal["jen"], + typing.Literal["joe"], + typing.Literal["joy"], + typing.Literal["juan"], + typing.Literal["kendra"], + typing.Literal["kendrick"], + typing.Literal["kenneth"], + typing.Literal["kevin"], + typing.Literal["kris"], + typing.Literal["linda"], + typing.Literal["madison"], + typing.Literal["marge"], + typing.Literal["marina"], + typing.Literal["marissa"], + typing.Literal["marta"], + typing.Literal["maya"], + typing.Literal["nicholas"], + typing.Literal["nyles"], + typing.Literal["phil"], + typing.Literal["reba"], + typing.Literal["rex"], + typing.Literal["rick"], + typing.Literal["ritu"], + typing.Literal["rob"], + typing.Literal["rodney"], + typing.Literal["rohan"], + typing.Literal["rosco"], + typing.Literal["samantha"], + typing.Literal["sandy"], + typing.Literal["selena"], + typing.Literal["seth"], + typing.Literal["sharon"], + typing.Literal["stan"], + typing.Literal["tamra"], + typing.Literal["tanya"], + typing.Literal["tibur"], + typing.Literal["tj"], + typing.Literal["tyler"], + typing.Literal["viv"], + typing.Literal["yadira"], + str, +] diff --git a/src/vapi/types/rule_based_condition.py b/src/vapi/types/rule_based_condition.py new file mode 100644 index 0000000..b275f02 --- /dev/null +++ b/src/vapi/types/rule_based_condition.py @@ -0,0 +1,91 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from .rule_based_condition_operator import RuleBasedConditionOperator +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class RuleBasedCondition(UniversalBaseModel): + operator: RuleBasedConditionOperator = pydantic.Field() + """ + This is the operator you want to use to compare the left side and right side. + + The operation becomes `(leftSide) operator (rightSide)`. + """ + + left_side: typing_extensions.Annotated[str, FieldMetadata(alias="leftSide")] = pydantic.Field() + """ + This is the left side of the operation. + + You can reference any variable in the context of the current block execution (step): + + - "{{output.your-property-name}}" for current step's output + - "{{input.your-property-name}}" for current step's input + - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) + - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) + - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) + - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) + - "{{workflow.input.your-property-name}}" for the current workflow's input + - "{{global.your-property-name}}" for the global context + + Or, you can use a constant: + + - "1" + - "text" + - "true" + - "false" + + Or, you can mix and match with string interpolation: + + - "{{your-property-name}}-{{input.your-property-name-2}}-1" + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.input/output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.input/output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + """ + + right_side: typing_extensions.Annotated[str, FieldMetadata(alias="rightSide")] = pydantic.Field() + """ + This is the right side of the operation. + + You can reference any variable in the context of the current block execution (step): + + - "{{output.your-property-name}}" for current step's output + - "{{input.your-property-name}}" for current step's input + - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) + - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) + - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) + - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) + - "{{workflow.input.your-property-name}}" for the current workflow's input + - "{{global.your-property-name}}" for the global context + + Or, you can use a constant: + + - "1" + - "text" + - "true" + - "false" + + Or, you can mix and match with string interpolation: + + - "{{your-property-name}}-{{input.your-property-name-2}}-1" + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.input/output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.input/output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/rule_based_condition_operator.py b/src/vapi/types/rule_based_condition_operator.py new file mode 100644 index 0000000..470a3af --- /dev/null +++ b/src/vapi/types/rule_based_condition_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RuleBasedConditionOperator = typing.Union[typing.Literal["eq", "neq", "gt", "gte", "lt", "lte"], typing.Any] diff --git a/src/vapi/types/runpod_credential.py b/src/vapi/types/runpod_credential.py new file mode 100644 index 0000000..3a163e7 --- /dev/null +++ b/src/vapi/types/runpod_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class RunpodCredential(UniversalBaseModel): + provider: typing.Literal["runpod"] = "runpod" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/s_3_credential.py b/src/vapi/types/s_3_credential.py new file mode 100644 index 0000000..44f22cc --- /dev/null +++ b/src/vapi/types/s_3_credential.py @@ -0,0 +1,72 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class S3Credential(UniversalBaseModel): + provider: typing.Literal["s3"] = pydantic.Field(default="s3") + """ + Credential provider. Only allowed value is s3 + """ + + aws_access_key_id: typing_extensions.Annotated[str, FieldMetadata(alias="awsAccessKeyId")] = pydantic.Field() + """ + AWS access key ID. + """ + + aws_secret_access_key: typing_extensions.Annotated[str, FieldMetadata(alias="awsSecretAccessKey")] = ( + pydantic.Field() + ) + """ + AWS access key secret. This is not returned in the API. + """ + + region: str = pydantic.Field() + """ + AWS region in which the S3 bucket is located. + """ + + s_3_bucket_name: typing_extensions.Annotated[str, FieldMetadata(alias="s3BucketName")] = pydantic.Field() + """ + AWS S3 bucket name. + """ + + s_3_path_prefix: typing_extensions.Annotated[str, FieldMetadata(alias="s3PathPrefix")] = pydantic.Field() + """ + The path prefix for the uploaded recording. Ex. "recordings/" + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/sbc_configuration.py b/src/vapi/types/sbc_configuration.py new file mode 100644 index 0000000..0e188ee --- /dev/null +++ b/src/vapi/types/sbc_configuration.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class SbcConfiguration(UniversalBaseModel): + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/server.py b/src/vapi/types/server.py new file mode 100644 index 0000000..4492e1c --- /dev/null +++ b/src/vapi/types/server.py @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class Server(UniversalBaseModel): + timeout_seconds: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="timeoutSeconds")] = ( + pydantic.Field(default=None) + ) + """ + This is the timeout in seconds for the request to your server. Defaults to 20 seconds. + + @default 20 + """ + + url: str = pydantic.Field() + """ + API endpoint to send requests to. + """ + + secret: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + + Same precedence logic as server. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/server_message.py b/src/vapi/types/server_message.py new file mode 100644 index 0000000..19522dc --- /dev/null +++ b/src/vapi/types/server_message.py @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +from .server_message_message import ServerMessageMessage +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessage(UniversalBaseModel): + message: ServerMessageMessage = pydantic.Field() + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessage=ServerMessage) +update_forward_refs(CreateWorkflowBlockDto, ServerMessage=ServerMessage) +update_forward_refs(HandoffStep, ServerMessage=ServerMessage) diff --git a/src/vapi/types/server_message_assistant_request.py b/src/vapi/types/server_message_assistant_request.py new file mode 100644 index 0000000..255ffe1 --- /dev/null +++ b/src/vapi/types/server_message_assistant_request.py @@ -0,0 +1,91 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_assistant_request_phone_number import ServerMessageAssistantRequestPhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageAssistantRequest(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageAssistantRequestPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageAssistantRequest=ServerMessageAssistantRequest) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageAssistantRequest=ServerMessageAssistantRequest) +update_forward_refs(HandoffStep, ServerMessageAssistantRequest=ServerMessageAssistantRequest) diff --git a/src/vapi/types/server_message_assistant_request_phone_number.py b/src/vapi/types/server_message_assistant_request_phone_number.py new file mode 100644 index 0000000..ac3f7e0 --- /dev/null +++ b/src/vapi/types/server_message_assistant_request_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageAssistantRequestPhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageAssistantRequestPhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageAssistantRequestPhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageAssistantRequestPhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageAssistantRequestPhoneNumber = typing.Union[ + ServerMessageAssistantRequestPhoneNumber_ByoPhoneNumber, + ServerMessageAssistantRequestPhoneNumber_Twilio, + ServerMessageAssistantRequestPhoneNumber_Vonage, + ServerMessageAssistantRequestPhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_conversation_update.py b/src/vapi/types/server_message_conversation_update.py new file mode 100644 index 0000000..2489bff --- /dev/null +++ b/src/vapi/types/server_message_conversation_update.py @@ -0,0 +1,105 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_conversation_update_phone_number import ServerMessageConversationUpdatePhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .server_message_conversation_update_messages_item import ServerMessageConversationUpdateMessagesItem +from .open_ai_message import OpenAiMessage +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageConversationUpdate(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageConversationUpdatePhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + messages: typing.Optional[typing.List[ServerMessageConversationUpdateMessagesItem]] = pydantic.Field(default=None) + """ + This is the most up-to-date conversation history at the time the message is sent. + """ + + messages_open_ai_formatted: typing_extensions.Annotated[ + typing.List[OpenAiMessage], FieldMetadata(alias="messagesOpenAIFormatted") + ] = pydantic.Field() + """ + This is the most up-to-date conversation history at the time the message is sent, formatted for OpenAI. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageConversationUpdate=ServerMessageConversationUpdate) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageConversationUpdate=ServerMessageConversationUpdate) +update_forward_refs(HandoffStep, ServerMessageConversationUpdate=ServerMessageConversationUpdate) diff --git a/src/vapi/types/server_message_conversation_update_messages_item.py b/src/vapi/types/server_message_conversation_update_messages_item.py new file mode 100644 index 0000000..b9a54ab --- /dev/null +++ b/src/vapi/types/server_message_conversation_update_messages_item.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from .user_message import UserMessage +from .system_message import SystemMessage +from .bot_message import BotMessage +from .tool_call_message import ToolCallMessage +from .tool_call_result_message import ToolCallResultMessage + +ServerMessageConversationUpdateMessagesItem = typing.Union[ + UserMessage, SystemMessage, BotMessage, ToolCallMessage, ToolCallResultMessage +] diff --git a/src/vapi/types/server_message_conversation_update_phone_number.py b/src/vapi/types/server_message_conversation_update_phone_number.py new file mode 100644 index 0000000..8647933 --- /dev/null +++ b/src/vapi/types/server_message_conversation_update_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageConversationUpdatePhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageConversationUpdatePhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageConversationUpdatePhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageConversationUpdatePhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageConversationUpdatePhoneNumber = typing.Union[ + ServerMessageConversationUpdatePhoneNumber_ByoPhoneNumber, + ServerMessageConversationUpdatePhoneNumber_Twilio, + ServerMessageConversationUpdatePhoneNumber_Vonage, + ServerMessageConversationUpdatePhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_end_of_call_report.py b/src/vapi/types/server_message_end_of_call_report.py new file mode 100644 index 0000000..7a95b19 --- /dev/null +++ b/src/vapi/types/server_message_end_of_call_report.py @@ -0,0 +1,129 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_end_of_call_report_phone_number import ServerMessageEndOfCallReportPhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .server_message_end_of_call_report_ended_reason import ServerMessageEndOfCallReportEndedReason +from .server_message_end_of_call_report_costs_item import ServerMessageEndOfCallReportCostsItem +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from .analysis import Analysis +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageEndOfCallReport(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageEndOfCallReportPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + ended_reason: typing_extensions.Annotated[ + ServerMessageEndOfCallReportEndedReason, FieldMetadata(alias="endedReason") + ] = pydantic.Field() + """ + This is the reason the call ended. This can also be found at `call.endedReason` on GET /call/:id. + """ + + cost: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the cost of the call in USD. This can also be found at `call.cost` on GET /call/:id. + """ + + costs: typing.Optional[typing.List[ServerMessageEndOfCallReportCostsItem]] = pydantic.Field(default=None) + """ + These are the costs of individual components of the call in USD. This can also be found at `call.costs` on GET /call/:id. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: Artifact = pydantic.Field() + """ + These are the artifacts from the call. This can also be found at `call.artifact` on GET /call/:id. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + analysis: Analysis = pydantic.Field() + """ + This is the analysis of the call. This can also be found at `call.analysis` on GET /call/:id. + """ + + started_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="startedAt")] = ( + pydantic.Field(default=None) + ) + """ + This is the ISO 8601 date-time string of when the call started. This can also be found at `call.startedAt` on GET /call/:id. + """ + + ended_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="endedAt")] = ( + pydantic.Field(default=None) + ) + """ + This is the ISO 8601 date-time string of when the call ended. This can also be found at `call.endedAt` on GET /call/:id. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageEndOfCallReport=ServerMessageEndOfCallReport) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageEndOfCallReport=ServerMessageEndOfCallReport) +update_forward_refs(HandoffStep, ServerMessageEndOfCallReport=ServerMessageEndOfCallReport) diff --git a/src/vapi/types/server_message_end_of_call_report_costs_item.py b/src/vapi/types/server_message_end_of_call_report_costs_item.py new file mode 100644 index 0000000..391ba63 --- /dev/null +++ b/src/vapi/types/server_message_end_of_call_report_costs_item.py @@ -0,0 +1,117 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from .analysis_cost_analysis_type import AnalysisCostAnalysisType + + +class ServerMessageEndOfCallReportCostsItem_Transport(UniversalBaseModel): + type: typing.Literal["transport"] = "transport" + minutes: float + cost: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageEndOfCallReportCostsItem_Transcriber(UniversalBaseModel): + type: typing.Literal["transcriber"] = "transcriber" + transcriber: typing.Dict[str, typing.Optional[typing.Any]] + minutes: float + cost: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageEndOfCallReportCostsItem_Model(UniversalBaseModel): + type: typing.Literal["model"] = "model" + model: typing.Dict[str, typing.Optional[typing.Any]] + prompt_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="promptTokens")] + completion_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="completionTokens")] + cost: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageEndOfCallReportCostsItem_Voice(UniversalBaseModel): + type: typing.Literal["voice"] = "voice" + voice: typing.Dict[str, typing.Optional[typing.Any]] + characters: float + cost: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageEndOfCallReportCostsItem_Vapi(UniversalBaseModel): + type: typing.Literal["vapi"] = "vapi" + minutes: float + cost: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageEndOfCallReportCostsItem_Analysis(UniversalBaseModel): + type: typing.Literal["analysis"] = "analysis" + analysis_type: typing_extensions.Annotated[AnalysisCostAnalysisType, FieldMetadata(alias="analysisType")] + model: typing.Dict[str, typing.Optional[typing.Any]] + prompt_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="promptTokens")] + completion_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="completionTokens")] + cost: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageEndOfCallReportCostsItem = typing.Union[ + ServerMessageEndOfCallReportCostsItem_Transport, + ServerMessageEndOfCallReportCostsItem_Transcriber, + ServerMessageEndOfCallReportCostsItem_Model, + ServerMessageEndOfCallReportCostsItem_Voice, + ServerMessageEndOfCallReportCostsItem_Vapi, + ServerMessageEndOfCallReportCostsItem_Analysis, +] diff --git a/src/vapi/types/server_message_end_of_call_report_ended_reason.py b/src/vapi/types/server_message_end_of_call_report_ended_reason.py new file mode 100644 index 0000000..970a625 --- /dev/null +++ b/src/vapi/types/server_message_end_of_call_report_ended_reason.py @@ -0,0 +1,177 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ServerMessageEndOfCallReportEndedReason = typing.Union[ + typing.Literal[ + "assistant-error", + "assistant-not-found", + "db-error", + "no-server-available", + "license-check-failed", + "pipeline-error-openai-llm-failed", + "pipeline-error-azure-openai-llm-failed", + "pipeline-error-groq-llm-failed", + "pipeline-error-anthropic-llm-failed", + "pipeline-error-vapi-llm-failed", + "pipeline-error-vapi-400-bad-request-validation-failed", + "pipeline-error-vapi-401-unauthorized", + "pipeline-error-vapi-403-model-access-denied", + "pipeline-error-vapi-429-exceeded-quota", + "pipeline-error-vapi-500-server-error", + "pipeline-error-openai-voice-failed", + "pipeline-error-cartesia-voice-failed", + "pipeline-error-deepgram-transcriber-failed", + "pipeline-error-deepgram-voice-failed", + "pipeline-error-gladia-transcriber-failed", + "pipeline-error-eleven-labs-voice-failed", + "pipeline-error-playht-voice-failed", + "pipeline-error-lmnt-voice-failed", + "pipeline-error-azure-voice-failed", + "pipeline-error-rime-ai-voice-failed", + "pipeline-error-neets-voice-failed", + "pipeline-no-available-model", + "worker-shutdown", + "unknown-error", + "vonage-disconnected", + "vonage-failed-to-connect-call", + "phone-call-provider-bypass-enabled-but-no-call-received", + "vapifault-phone-call-worker-setup-socket-error", + "vapifault-phone-call-worker-worker-setup-socket-timeout", + "vapifault-phone-call-worker-could-not-find-call", + "vapifault-transport-never-connected", + "vapifault-web-call-worker-setup-failed", + "vapifault-transport-connected-but-call-not-active", + "assistant-not-invalid", + "assistant-not-provided", + "call-start-error-neither-assistant-nor-server-set", + "assistant-request-failed", + "assistant-request-returned-error", + "assistant-request-returned-unspeakable-error", + "assistant-request-returned-invalid-assistant", + "assistant-request-returned-no-assistant", + "assistant-request-returned-forwarding-phone-number", + "assistant-ended-call", + "assistant-said-end-call-phrase", + "assistant-forwarded-call", + "assistant-join-timed-out", + "customer-busy", + "customer-ended-call", + "customer-did-not-answer", + "customer-did-not-give-microphone-permission", + "assistant-said-message-with-end-call-enabled", + "exceeded-max-duration", + "manually-canceled", + "phone-call-provider-closed-websocket", + "pipeline-error-openai-400-bad-request-validation-failed", + "pipeline-error-openai-401-unauthorized", + "pipeline-error-openai-403-model-access-denied", + "pipeline-error-openai-429-exceeded-quota", + "pipeline-error-openai-500-server-error", + "pipeline-error-azure-openai-400-bad-request-validation-failed", + "pipeline-error-azure-openai-401-unauthorized", + "pipeline-error-azure-openai-403-model-access-denied", + "pipeline-error-azure-openai-429-exceeded-quota", + "pipeline-error-azure-openai-500-server-error", + "pipeline-error-groq-400-bad-request-validation-failed", + "pipeline-error-groq-401-unauthorized", + "pipeline-error-groq-403-model-access-denied", + "pipeline-error-groq-429-exceeded-quota", + "pipeline-error-groq-500-server-error", + "pipeline-error-anthropic-400-bad-request-validation-failed", + "pipeline-error-anthropic-401-unauthorized", + "pipeline-error-anthropic-403-model-access-denied", + "pipeline-error-anthropic-429-exceeded-quota", + "pipeline-error-anthropic-500-server-error", + "pipeline-error-together-ai-400-bad-request-validation-failed", + "pipeline-error-together-ai-401-unauthorized", + "pipeline-error-together-ai-403-model-access-denied", + "pipeline-error-together-ai-429-exceeded-quota", + "pipeline-error-together-ai-500-server-error", + "pipeline-error-together-ai-llm-failed", + "pipeline-error-anyscale-400-bad-request-validation-failed", + "pipeline-error-anyscale-401-unauthorized", + "pipeline-error-anyscale-403-model-access-denied", + "pipeline-error-anyscale-429-exceeded-quota", + "pipeline-error-anyscale-500-server-error", + "pipeline-error-anyscale-llm-failed", + "pipeline-error-openrouter-400-bad-request-validation-failed", + "pipeline-error-openrouter-401-unauthorized", + "pipeline-error-openrouter-403-model-access-denied", + "pipeline-error-openrouter-429-exceeded-quota", + "pipeline-error-openrouter-500-server-error", + "pipeline-error-openrouter-llm-failed", + "pipeline-error-perplexity-ai-400-bad-request-validation-failed", + "pipeline-error-perplexity-ai-401-unauthorized", + "pipeline-error-perplexity-ai-403-model-access-denied", + "pipeline-error-perplexity-ai-429-exceeded-quota", + "pipeline-error-perplexity-ai-500-server-error", + "pipeline-error-perplexity-ai-llm-failed", + "pipeline-error-deepinfra-400-bad-request-validation-failed", + "pipeline-error-deepinfra-401-unauthorized", + "pipeline-error-deepinfra-403-model-access-denied", + "pipeline-error-deepinfra-429-exceeded-quota", + "pipeline-error-deepinfra-500-server-error", + "pipeline-error-deepinfra-llm-failed", + "pipeline-error-runpod-400-bad-request-validation-failed", + "pipeline-error-runpod-401-unauthorized", + "pipeline-error-runpod-403-model-access-denied", + "pipeline-error-runpod-429-exceeded-quota", + "pipeline-error-runpod-500-server-error", + "pipeline-error-runpod-llm-failed", + "pipeline-error-custom-llm-400-bad-request-validation-failed", + "pipeline-error-custom-llm-401-unauthorized", + "pipeline-error-custom-llm-403-model-access-denied", + "pipeline-error-custom-llm-429-exceeded-quota", + "pipeline-error-custom-llm-500-server-error", + "pipeline-error-custom-llm-llm-failed", + "pipeline-error-cartesia-socket-hang-up", + "pipeline-error-cartesia-requested-payment", + "pipeline-error-cartesia-500-server-error", + "pipeline-error-cartesia-503-server-error", + "pipeline-error-cartesia-522-server-error", + "pipeline-error-custom-voice-failed", + "pipeline-error-eleven-labs-voice-not-found", + "pipeline-error-eleven-labs-quota-exceeded", + "pipeline-error-eleven-labs-unauthorized-access", + "pipeline-error-eleven-labs-unauthorized-to-access-model", + "pipeline-error-eleven-labs-professional-voices-only-for-creator-plus", + "pipeline-error-eleven-labs-blocked-free-plan-and-requested-upgrade", + "pipeline-error-eleven-labs-blocked-concurrent-requests-and-requested-upgrade", + "pipeline-error-eleven-labs-blocked-using-instant-voice-clone-and-requested-upgrade", + "pipeline-error-eleven-labs-system-busy-and-requested-upgrade", + "pipeline-error-eleven-labs-voice-not-fine-tuned", + "pipeline-error-eleven-labs-invalid-api-key", + "pipeline-error-eleven-labs-invalid-voice-samples", + "pipeline-error-eleven-labs-voice-disabled-by-owner", + "pipeline-error-eleven-labs-blocked-account-in-probation", + "pipeline-error-eleven-labs-blocked-content-against-their-policy", + "pipeline-error-eleven-labs-missing-samples-for-voice-clone", + "pipeline-error-eleven-labs-voice-not-fine-tuned-and-cannot-be-used", + "pipeline-error-eleven-labs-voice-not-allowed-for-free-users", + "pipeline-error-eleven-labs-500-server-error", + "pipeline-error-eleven-labs-max-character-limit-exceeded", + "pipeline-error-playht-request-timed-out", + "pipeline-error-playht-invalid-voice", + "pipeline-error-playht-unexpected-error", + "pipeline-error-playht-out-of-credits", + "pipeline-error-playht-voice-must-be-a-valid-voice-manifest-uri", + "pipeline-error-playht-401-unauthorized", + "pipeline-error-playht-403-forbidden-out-of-characters", + "pipeline-error-playht-403-forbidden-api-access-not-available", + "pipeline-error-playht-429-exceeded-quota", + "pipeline-error-playht-502-gateway-error", + "pipeline-error-playht-504-gateway-error", + "pipeline-error-deepgram-403-model-access-denied", + "pipeline-error-deepgram-404-not-found", + "pipeline-error-deepgram-400-no-such-model-language-tier-combination", + "pipeline-error-deepgram-500-returning-invalid-json", + "sip-gateway-failed-to-connect-call", + "silence-timed-out", + "twilio-failed-to-connect-call", + "twilio-reported-customer-misdialed", + "voicemail", + "vonage-rejected", + ], + typing.Any, +] diff --git a/src/vapi/types/server_message_end_of_call_report_phone_number.py b/src/vapi/types/server_message_end_of_call_report_phone_number.py new file mode 100644 index 0000000..e458adf --- /dev/null +++ b/src/vapi/types/server_message_end_of_call_report_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageEndOfCallReportPhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageEndOfCallReportPhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageEndOfCallReportPhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageEndOfCallReportPhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageEndOfCallReportPhoneNumber = typing.Union[ + ServerMessageEndOfCallReportPhoneNumber_ByoPhoneNumber, + ServerMessageEndOfCallReportPhoneNumber_Twilio, + ServerMessageEndOfCallReportPhoneNumber_Vonage, + ServerMessageEndOfCallReportPhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_hang.py b/src/vapi/types/server_message_hang.py new file mode 100644 index 0000000..cfa9bb6 --- /dev/null +++ b/src/vapi/types/server_message_hang.py @@ -0,0 +1,91 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_hang_phone_number import ServerMessageHangPhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageHang(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageHangPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageHang=ServerMessageHang) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageHang=ServerMessageHang) +update_forward_refs(HandoffStep, ServerMessageHang=ServerMessageHang) diff --git a/src/vapi/types/server_message_hang_phone_number.py b/src/vapi/types/server_message_hang_phone_number.py new file mode 100644 index 0000000..d0fce76 --- /dev/null +++ b/src/vapi/types/server_message_hang_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageHangPhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageHangPhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageHangPhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageHangPhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageHangPhoneNumber = typing.Union[ + ServerMessageHangPhoneNumber_ByoPhoneNumber, + ServerMessageHangPhoneNumber_Twilio, + ServerMessageHangPhoneNumber_Vonage, + ServerMessageHangPhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_language_changed.py b/src/vapi/types/server_message_language_changed.py new file mode 100644 index 0000000..a3c8d82 --- /dev/null +++ b/src/vapi/types/server_message_language_changed.py @@ -0,0 +1,96 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_language_changed_phone_number import ServerMessageLanguageChangedPhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageLanguageChanged(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageLanguageChangedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + language: str = pydantic.Field() + """ + This is the language the transcriber is switched to. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageLanguageChanged=ServerMessageLanguageChanged) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageLanguageChanged=ServerMessageLanguageChanged) +update_forward_refs(HandoffStep, ServerMessageLanguageChanged=ServerMessageLanguageChanged) diff --git a/src/vapi/types/server_message_language_changed_phone_number.py b/src/vapi/types/server_message_language_changed_phone_number.py new file mode 100644 index 0000000..7d9336c --- /dev/null +++ b/src/vapi/types/server_message_language_changed_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageLanguageChangedPhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageLanguageChangedPhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageLanguageChangedPhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageLanguageChangedPhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageLanguageChangedPhoneNumber = typing.Union[ + ServerMessageLanguageChangedPhoneNumber_ByoPhoneNumber, + ServerMessageLanguageChangedPhoneNumber_Twilio, + ServerMessageLanguageChangedPhoneNumber_Vonage, + ServerMessageLanguageChangedPhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_message.py b/src/vapi/types/server_message_message.py new file mode 100644 index 0000000..b4c65af --- /dev/null +++ b/src/vapi/types/server_message_message.py @@ -0,0 +1,692 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing +import typing_extensions +from .server_message_assistant_request_phone_number import ServerMessageAssistantRequestPhoneNumber +from ..core.serialization import FieldMetadata +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .server_message_conversation_update_phone_number import ServerMessageConversationUpdatePhoneNumber +from .server_message_conversation_update_messages_item import ServerMessageConversationUpdateMessagesItem +from .open_ai_message import OpenAiMessage +from .server_message_end_of_call_report_phone_number import ServerMessageEndOfCallReportPhoneNumber +from .server_message_end_of_call_report_ended_reason import ServerMessageEndOfCallReportEndedReason +from .server_message_end_of_call_report_costs_item import ServerMessageEndOfCallReportCostsItem +from .analysis import Analysis +import datetime as dt +from .server_message_hang_phone_number import ServerMessageHangPhoneNumber +from .server_message_model_output_phone_number import ServerMessageModelOutputPhoneNumber +from .server_message_phone_call_control_phone_number import ServerMessagePhoneCallControlPhoneNumber +from .server_message_phone_call_control_request import ServerMessagePhoneCallControlRequest +from .server_message_phone_call_control_destination import ServerMessagePhoneCallControlDestination +from .server_message_speech_update_phone_number import ServerMessageSpeechUpdatePhoneNumber +from .server_message_speech_update_status import ServerMessageSpeechUpdateStatus +from .server_message_speech_update_role import ServerMessageSpeechUpdateRole +from .server_message_status_update_phone_number import ServerMessageStatusUpdatePhoneNumber +from .server_message_status_update_status import ServerMessageStatusUpdateStatus +from .server_message_status_update_ended_reason import ServerMessageStatusUpdateEndedReason +from .server_message_status_update_messages_item import ServerMessageStatusUpdateMessagesItem +from .server_message_status_update_destination import ServerMessageStatusUpdateDestination +from .server_message_tool_calls_phone_number import ServerMessageToolCallsPhoneNumber +from .server_message_tool_calls_tool_with_tool_call_list_item import ServerMessageToolCallsToolWithToolCallListItem +from .tool_call import ToolCall +from .server_message_transfer_destination_request_phone_number import ServerMessageTransferDestinationRequestPhoneNumber +from .server_message_transfer_update_phone_number import ServerMessageTransferUpdatePhoneNumber +from .server_message_transfer_update_destination import ServerMessageTransferUpdateDestination +from .server_message_transcript_phone_number import ServerMessageTranscriptPhoneNumber +from .server_message_transcript_role import ServerMessageTranscriptRole +from .server_message_transcript_transcript_type import ServerMessageTranscriptTranscriptType +from .server_message_user_interrupted_phone_number import ServerMessageUserInterruptedPhoneNumber +from .server_message_language_changed_phone_number import ServerMessageLanguageChangedPhoneNumber +from .server_message_voice_input_phone_number import ServerMessageVoiceInputPhoneNumber +from .server_message_voice_request_phone_number import ServerMessageVoiceRequestPhoneNumber +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageMessage_AssistantRequest(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["assistant-request"] = "assistant-request" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageAssistantRequestPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_ConversationUpdate(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["conversation-update"] = "conversation-update" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageConversationUpdatePhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + messages: typing.Optional[typing.List[ServerMessageConversationUpdateMessagesItem]] = None + messages_open_ai_formatted: typing_extensions.Annotated[ + typing.List[OpenAiMessage], FieldMetadata(alias="messagesOpenAIFormatted") + ] + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_EndOfCallReport(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["end-of-call-report"] = "end-of-call-report" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageEndOfCallReportPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + ended_reason: typing_extensions.Annotated[ + ServerMessageEndOfCallReportEndedReason, FieldMetadata(alias="endedReason") + ] + cost: typing.Optional[float] = None + costs: typing.Optional[typing.List[ServerMessageEndOfCallReportCostsItem]] = None + timestamp: typing.Optional[str] = None + artifact: Artifact + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + analysis: Analysis + started_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="startedAt")] = None + ended_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="endedAt")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_Hang(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["hang"] = "hang" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageHangPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_ModelOutput(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["model-output"] = "model-output" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageModelOutputPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + output: typing.Dict[str, typing.Optional[typing.Any]] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_PhoneCallControl(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["phone-call-control"] = "phone-call-control" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessagePhoneCallControlPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + request: ServerMessagePhoneCallControlRequest + destination: typing.Optional[ServerMessagePhoneCallControlDestination] = None + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_SpeechUpdate(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["speech-update"] = "speech-update" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageSpeechUpdatePhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + status: ServerMessageSpeechUpdateStatus + role: ServerMessageSpeechUpdateRole + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_StatusUpdate(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["status-update"] = "status-update" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageStatusUpdatePhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + status: ServerMessageStatusUpdateStatus + ended_reason: typing_extensions.Annotated[ + typing.Optional[ServerMessageStatusUpdateEndedReason], FieldMetadata(alias="endedReason") + ] = None + messages: typing.Optional[typing.List[ServerMessageStatusUpdateMessagesItem]] = None + messages_open_ai_formatted: typing_extensions.Annotated[ + typing.Optional[typing.List[OpenAiMessage]], FieldMetadata(alias="messagesOpenAIFormatted") + ] = None + destination: typing.Optional[ServerMessageStatusUpdateDestination] = None + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + transcript: typing.Optional[str] = None + inbound_phone_call_debugging_artifacts: typing_extensions.Annotated[ + typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], + FieldMetadata(alias="inboundPhoneCallDebuggingArtifacts"), + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_ToolCalls(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["tool-calls"] = "tool-calls" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageToolCallsPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + tool_with_tool_call_list: typing_extensions.Annotated[ + typing.List[ServerMessageToolCallsToolWithToolCallListItem], FieldMetadata(alias="toolWithToolCallList") + ] + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + tool_call_list: typing_extensions.Annotated[typing.List[ToolCall], FieldMetadata(alias="toolCallList")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_TransferDestinationRequest(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["transfer-destination-request"] = "transfer-destination-request" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageTransferDestinationRequestPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_TransferUpdate(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["transfer-update"] = "transfer-update" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageTransferUpdatePhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + destination: typing.Optional[ServerMessageTransferUpdateDestination] = None + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + to_assistant: typing_extensions.Annotated[ + typing.Optional[CreateAssistantDto], FieldMetadata(alias="toAssistant") + ] = None + from_assistant: typing_extensions.Annotated[ + typing.Optional[CreateAssistantDto], FieldMetadata(alias="fromAssistant") + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_Transcript(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["transcript"] = "transcript" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageTranscriptPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + role: ServerMessageTranscriptRole + transcript_type: typing_extensions.Annotated[ + ServerMessageTranscriptTranscriptType, FieldMetadata(alias="transcriptType") + ] + transcript: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_UserInterrupted(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["user-interrupted"] = "user-interrupted" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageUserInterruptedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_LanguageChanged(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["language-changed"] = "language-changed" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageLanguageChangedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + language: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_VoiceInput(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["voice-input"] = "voice-input" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageVoiceInputPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + input: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageMessage_VoiceRequest(UniversalBaseModel): + """ + These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.serverMessages`. + + The server where the message is sent is determined by the following precedence order: + + 1. `tool.server.url` (if configured, and only for "tool-calls" message) + 2. `assistant.serverUrl` (if configure) + 3. `phoneNumber.serverUrl` (if configured) + 4. `org.serverUrl` (if configured) + """ + + type: typing.Literal["voice-request"] = "voice-request" + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageVoiceRequestPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = None + timestamp: typing.Optional[str] = None + artifact: typing.Optional[Artifact] = None + assistant: typing.Optional[CreateAssistantDto] = None + customer: typing.Optional[CreateCustomerDto] = None + call: typing.Optional[Call] = None + text: str + sample_rate: typing_extensions.Annotated[float, FieldMetadata(alias="sampleRate")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageMessage = typing.Union[ + ServerMessageMessage_AssistantRequest, + ServerMessageMessage_ConversationUpdate, + ServerMessageMessage_EndOfCallReport, + ServerMessageMessage_Hang, + ServerMessageMessage_ModelOutput, + ServerMessageMessage_PhoneCallControl, + ServerMessageMessage_SpeechUpdate, + ServerMessageMessage_StatusUpdate, + ServerMessageMessage_ToolCalls, + ServerMessageMessage_TransferDestinationRequest, + ServerMessageMessage_TransferUpdate, + ServerMessageMessage_Transcript, + ServerMessageMessage_UserInterrupted, + ServerMessageMessage_LanguageChanged, + ServerMessageMessage_VoiceInput, + ServerMessageMessage_VoiceRequest, +] +update_forward_refs(CallbackStep, ServerMessageMessage_AssistantRequest=ServerMessageMessage_AssistantRequest) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_AssistantRequest=ServerMessageMessage_AssistantRequest) +update_forward_refs(HandoffStep, ServerMessageMessage_AssistantRequest=ServerMessageMessage_AssistantRequest) +update_forward_refs(CallbackStep, ServerMessageMessage_ConversationUpdate=ServerMessageMessage_ConversationUpdate) +update_forward_refs( + CreateWorkflowBlockDto, ServerMessageMessage_ConversationUpdate=ServerMessageMessage_ConversationUpdate +) +update_forward_refs(HandoffStep, ServerMessageMessage_ConversationUpdate=ServerMessageMessage_ConversationUpdate) +update_forward_refs(CallbackStep, ServerMessageMessage_EndOfCallReport=ServerMessageMessage_EndOfCallReport) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_EndOfCallReport=ServerMessageMessage_EndOfCallReport) +update_forward_refs(HandoffStep, ServerMessageMessage_EndOfCallReport=ServerMessageMessage_EndOfCallReport) +update_forward_refs(CallbackStep, ServerMessageMessage_Hang=ServerMessageMessage_Hang) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_Hang=ServerMessageMessage_Hang) +update_forward_refs(HandoffStep, ServerMessageMessage_Hang=ServerMessageMessage_Hang) +update_forward_refs(CallbackStep, ServerMessageMessage_ModelOutput=ServerMessageMessage_ModelOutput) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_ModelOutput=ServerMessageMessage_ModelOutput) +update_forward_refs(HandoffStep, ServerMessageMessage_ModelOutput=ServerMessageMessage_ModelOutput) +update_forward_refs(CallbackStep, ServerMessageMessage_PhoneCallControl=ServerMessageMessage_PhoneCallControl) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_PhoneCallControl=ServerMessageMessage_PhoneCallControl) +update_forward_refs(HandoffStep, ServerMessageMessage_PhoneCallControl=ServerMessageMessage_PhoneCallControl) +update_forward_refs(CallbackStep, ServerMessageMessage_SpeechUpdate=ServerMessageMessage_SpeechUpdate) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_SpeechUpdate=ServerMessageMessage_SpeechUpdate) +update_forward_refs(HandoffStep, ServerMessageMessage_SpeechUpdate=ServerMessageMessage_SpeechUpdate) +update_forward_refs(CallbackStep, ServerMessageMessage_StatusUpdate=ServerMessageMessage_StatusUpdate) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_StatusUpdate=ServerMessageMessage_StatusUpdate) +update_forward_refs(HandoffStep, ServerMessageMessage_StatusUpdate=ServerMessageMessage_StatusUpdate) +update_forward_refs(CallbackStep, ServerMessageMessage_ToolCalls=ServerMessageMessage_ToolCalls) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_ToolCalls=ServerMessageMessage_ToolCalls) +update_forward_refs(HandoffStep, ServerMessageMessage_ToolCalls=ServerMessageMessage_ToolCalls) +update_forward_refs( + CallbackStep, ServerMessageMessage_TransferDestinationRequest=ServerMessageMessage_TransferDestinationRequest +) +update_forward_refs( + CreateWorkflowBlockDto, + ServerMessageMessage_TransferDestinationRequest=ServerMessageMessage_TransferDestinationRequest, +) +update_forward_refs( + HandoffStep, ServerMessageMessage_TransferDestinationRequest=ServerMessageMessage_TransferDestinationRequest +) +update_forward_refs(CallbackStep, ServerMessageMessage_TransferUpdate=ServerMessageMessage_TransferUpdate) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_TransferUpdate=ServerMessageMessage_TransferUpdate) +update_forward_refs(HandoffStep, ServerMessageMessage_TransferUpdate=ServerMessageMessage_TransferUpdate) +update_forward_refs(CallbackStep, ServerMessageMessage_Transcript=ServerMessageMessage_Transcript) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_Transcript=ServerMessageMessage_Transcript) +update_forward_refs(HandoffStep, ServerMessageMessage_Transcript=ServerMessageMessage_Transcript) +update_forward_refs(CallbackStep, ServerMessageMessage_UserInterrupted=ServerMessageMessage_UserInterrupted) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_UserInterrupted=ServerMessageMessage_UserInterrupted) +update_forward_refs(HandoffStep, ServerMessageMessage_UserInterrupted=ServerMessageMessage_UserInterrupted) +update_forward_refs(CallbackStep, ServerMessageMessage_LanguageChanged=ServerMessageMessage_LanguageChanged) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_LanguageChanged=ServerMessageMessage_LanguageChanged) +update_forward_refs(HandoffStep, ServerMessageMessage_LanguageChanged=ServerMessageMessage_LanguageChanged) +update_forward_refs(CallbackStep, ServerMessageMessage_VoiceInput=ServerMessageMessage_VoiceInput) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_VoiceInput=ServerMessageMessage_VoiceInput) +update_forward_refs(HandoffStep, ServerMessageMessage_VoiceInput=ServerMessageMessage_VoiceInput) +update_forward_refs(CallbackStep, ServerMessageMessage_VoiceRequest=ServerMessageMessage_VoiceRequest) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageMessage_VoiceRequest=ServerMessageMessage_VoiceRequest) +update_forward_refs(HandoffStep, ServerMessageMessage_VoiceRequest=ServerMessageMessage_VoiceRequest) diff --git a/src/vapi/types/server_message_model_output.py b/src/vapi/types/server_message_model_output.py new file mode 100644 index 0000000..c466ef7 --- /dev/null +++ b/src/vapi/types/server_message_model_output.py @@ -0,0 +1,96 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_model_output_phone_number import ServerMessageModelOutputPhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageModelOutput(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageModelOutputPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + output: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() + """ + This is the output of the model. It can be a token or tool call. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageModelOutput=ServerMessageModelOutput) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageModelOutput=ServerMessageModelOutput) +update_forward_refs(HandoffStep, ServerMessageModelOutput=ServerMessageModelOutput) diff --git a/src/vapi/types/server_message_model_output_phone_number.py b/src/vapi/types/server_message_model_output_phone_number.py new file mode 100644 index 0000000..f7b0297 --- /dev/null +++ b/src/vapi/types/server_message_model_output_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageModelOutputPhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageModelOutputPhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageModelOutputPhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageModelOutputPhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageModelOutputPhoneNumber = typing.Union[ + ServerMessageModelOutputPhoneNumber_ByoPhoneNumber, + ServerMessageModelOutputPhoneNumber_Twilio, + ServerMessageModelOutputPhoneNumber_Vonage, + ServerMessageModelOutputPhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_phone_call_control.py b/src/vapi/types/server_message_phone_call_control.py new file mode 100644 index 0000000..0749a75 --- /dev/null +++ b/src/vapi/types/server_message_phone_call_control.py @@ -0,0 +1,103 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_phone_call_control_phone_number import ServerMessagePhoneCallControlPhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .server_message_phone_call_control_request import ServerMessagePhoneCallControlRequest +from .server_message_phone_call_control_destination import ServerMessagePhoneCallControlDestination +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessagePhoneCallControl(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessagePhoneCallControlPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + request: ServerMessagePhoneCallControlRequest = pydantic.Field() + """ + This is the request to control the phone call. + """ + + destination: typing.Optional[ServerMessagePhoneCallControlDestination] = pydantic.Field(default=None) + """ + This is the destination to forward the call to if the request is "forward". + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessagePhoneCallControl=ServerMessagePhoneCallControl) +update_forward_refs(CreateWorkflowBlockDto, ServerMessagePhoneCallControl=ServerMessagePhoneCallControl) +update_forward_refs(HandoffStep, ServerMessagePhoneCallControl=ServerMessagePhoneCallControl) diff --git a/src/vapi/types/server_message_phone_call_control_destination.py b/src/vapi/types/server_message_phone_call_control_destination.py new file mode 100644 index 0000000..700743f --- /dev/null +++ b/src/vapi/types/server_message_phone_call_control_destination.py @@ -0,0 +1,59 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ServerMessagePhoneCallControlDestination_Number(UniversalBaseModel): + """ + This is the destination to forward the call to if the request is "forward". + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessagePhoneCallControlDestination_Sip(UniversalBaseModel): + """ + This is the destination to forward the call to if the request is "forward". + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessagePhoneCallControlDestination = typing.Union[ + ServerMessagePhoneCallControlDestination_Number, ServerMessagePhoneCallControlDestination_Sip +] diff --git a/src/vapi/types/server_message_phone_call_control_phone_number.py b/src/vapi/types/server_message_phone_call_control_phone_number.py new file mode 100644 index 0000000..ed25e78 --- /dev/null +++ b/src/vapi/types/server_message_phone_call_control_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessagePhoneCallControlPhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessagePhoneCallControlPhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessagePhoneCallControlPhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessagePhoneCallControlPhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessagePhoneCallControlPhoneNumber = typing.Union[ + ServerMessagePhoneCallControlPhoneNumber_ByoPhoneNumber, + ServerMessagePhoneCallControlPhoneNumber_Twilio, + ServerMessagePhoneCallControlPhoneNumber_Vonage, + ServerMessagePhoneCallControlPhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_phone_call_control_request.py b/src/vapi/types/server_message_phone_call_control_request.py new file mode 100644 index 0000000..e57f93b --- /dev/null +++ b/src/vapi/types/server_message_phone_call_control_request.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ServerMessagePhoneCallControlRequest = typing.Union[typing.Literal["forward", "hang-up"], typing.Any] diff --git a/src/vapi/types/server_message_response.py b/src/vapi/types/server_message_response.py new file mode 100644 index 0000000..27e2826 --- /dev/null +++ b/src/vapi/types/server_message_response.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +from .server_message_response_message_response import ServerMessageResponseMessageResponse +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageResponse(UniversalBaseModel): + message_response: typing_extensions.Annotated[ + ServerMessageResponseMessageResponse, FieldMetadata(alias="messageResponse") + ] = pydantic.Field() + """ + This is the response that is expected from the server to the message. + + Note: Most messages don't expect a response. Only "assistant-request", "tool-calls" and "transfer-destination-request" do. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageResponse=ServerMessageResponse) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageResponse=ServerMessageResponse) +update_forward_refs(HandoffStep, ServerMessageResponse=ServerMessageResponse) diff --git a/src/vapi/types/server_message_response_assistant_request.py b/src/vapi/types/server_message_response_assistant_request.py new file mode 100644 index 0000000..4948cb2 --- /dev/null +++ b/src/vapi/types/server_message_response_assistant_request.py @@ -0,0 +1,80 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing +from .server_message_response_assistant_request_destination import ServerMessageResponseAssistantRequestDestination +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_assistant_dto import CreateAssistantDto +from .assistant_overrides import AssistantOverrides +from .create_squad_dto import CreateSquadDto +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageResponseAssistantRequest(UniversalBaseModel): + destination: typing.Optional[ServerMessageResponseAssistantRequestDestination] = pydantic.Field(default=None) + """ + This is the destination to transfer the inbound call to. This will immediately transfer without using any assistants. + + If this is sent, `assistantId`, `assistant`, `squadId`, and `squad` are ignored. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. + + If you're unsure why you're getting an invalid assistant, try logging your response and send the JSON blob to POST /assistant which will return the validation errors. + """ + + assistant_overrides: typing_extensions.Annotated[ + typing.Optional[AssistantOverrides], FieldMetadata(alias="assistantOverrides") + ] = pydantic.Field(default=None) + """ + These are the overrides for the `assistant` or `assistantId`'s settings and template variables. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + """ + + squad: typing.Optional[CreateSquadDto] = pydantic.Field(default=None) + """ + This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + """ + + error: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the error if the call shouldn't be accepted. This is spoken to the customer. + + If this is sent, `assistantId`, `assistant`, `squadId`, `squad`, and `destination` are ignored. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageResponseAssistantRequest=ServerMessageResponseAssistantRequest) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageResponseAssistantRequest=ServerMessageResponseAssistantRequest) +update_forward_refs(HandoffStep, ServerMessageResponseAssistantRequest=ServerMessageResponseAssistantRequest) diff --git a/src/vapi/types/server_message_response_assistant_request_destination.py b/src/vapi/types/server_message_response_assistant_request_destination.py new file mode 100644 index 0000000..5cc4f33 --- /dev/null +++ b/src/vapi/types/server_message_response_assistant_request_destination.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ServerMessageResponseAssistantRequestDestination_Number(UniversalBaseModel): + """ + This is the destination to transfer the inbound call to. This will immediately transfer without using any assistants. + + If this is sent, `assistantId`, `assistant`, `squadId`, and `squad` are ignored. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageResponseAssistantRequestDestination_Sip(UniversalBaseModel): + """ + This is the destination to transfer the inbound call to. This will immediately transfer without using any assistants. + + If this is sent, `assistantId`, `assistant`, `squadId`, and `squad` are ignored. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageResponseAssistantRequestDestination = typing.Union[ + ServerMessageResponseAssistantRequestDestination_Number, ServerMessageResponseAssistantRequestDestination_Sip +] diff --git a/src/vapi/types/server_message_response_message_response.py b/src/vapi/types/server_message_response_message_response.py new file mode 100644 index 0000000..3196d2f --- /dev/null +++ b/src/vapi/types/server_message_response_message_response.py @@ -0,0 +1,14 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from .server_message_response_assistant_request import ServerMessageResponseAssistantRequest +from .server_message_response_tool_calls import ServerMessageResponseToolCalls +from .server_message_response_transfer_destination_request import ServerMessageResponseTransferDestinationRequest +from .server_message_response_voice_request import ServerMessageResponseVoiceRequest + +ServerMessageResponseMessageResponse = typing.Union[ + ServerMessageResponseAssistantRequest, + ServerMessageResponseToolCalls, + ServerMessageResponseTransferDestinationRequest, + ServerMessageResponseVoiceRequest, +] diff --git a/src/vapi/types/server_message_response_tool_calls.py b/src/vapi/types/server_message_response_tool_calls.py new file mode 100644 index 0000000..689dbca --- /dev/null +++ b/src/vapi/types/server_message_response_tool_calls.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .tool_call_result import ToolCallResult +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ServerMessageResponseToolCalls(UniversalBaseModel): + results: typing.Optional[typing.List[ToolCallResult]] = pydantic.Field(default=None) + """ + These are the results of the "tool-calls" message. + """ + + error: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the error message if the tool call was not successful. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/server_message_response_transfer_destination_request.py b/src/vapi/types/server_message_response_transfer_destination_request.py new file mode 100644 index 0000000..e066d3f --- /dev/null +++ b/src/vapi/types/server_message_response_transfer_destination_request.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .server_message_response_transfer_destination_request_destination import ( + ServerMessageResponseTransferDestinationRequestDestination, +) +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ServerMessageResponseTransferDestinationRequest(UniversalBaseModel): + destination: typing.Optional[ServerMessageResponseTransferDestinationRequestDestination] = pydantic.Field( + default=None + ) + """ + This is the destination you'd like the call to be transferred to. + """ + + error: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the error message if the transfer should not be made. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/server_message_response_transfer_destination_request_destination.py b/src/vapi/types/server_message_response_transfer_destination_request_destination.py new file mode 100644 index 0000000..d83fab0 --- /dev/null +++ b/src/vapi/types/server_message_response_transfer_destination_request_destination.py @@ -0,0 +1,106 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .transfer_destination_assistant_transfer_mode import TransferDestinationAssistantTransferMode +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ServerMessageResponseTransferDestinationRequestDestination_Assistant(UniversalBaseModel): + """ + This is the destination you'd like the call to be transferred to. + """ + + type: typing.Literal["assistant"] = "assistant" + transfer_mode: typing_extensions.Annotated[ + typing.Optional[TransferDestinationAssistantTransferMode], FieldMetadata(alias="transferMode") + ] = None + assistant_name: typing_extensions.Annotated[str, FieldMetadata(alias="assistantName")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageResponseTransferDestinationRequestDestination_Step(UniversalBaseModel): + """ + This is the destination you'd like the call to be transferred to. + """ + + type: typing.Literal["step"] = "step" + step_name: typing_extensions.Annotated[str, FieldMetadata(alias="stepName")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageResponseTransferDestinationRequestDestination_Number(UniversalBaseModel): + """ + This is the destination you'd like the call to be transferred to. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageResponseTransferDestinationRequestDestination_Sip(UniversalBaseModel): + """ + This is the destination you'd like the call to be transferred to. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageResponseTransferDestinationRequestDestination = typing.Union[ + ServerMessageResponseTransferDestinationRequestDestination_Assistant, + ServerMessageResponseTransferDestinationRequestDestination_Step, + ServerMessageResponseTransferDestinationRequestDestination_Number, + ServerMessageResponseTransferDestinationRequestDestination_Sip, +] diff --git a/src/vapi/types/server_message_response_voice_request.py b/src/vapi/types/server_message_response_voice_request.py new file mode 100644 index 0000000..e6ccf31 --- /dev/null +++ b/src/vapi/types/server_message_response_voice_request.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ServerMessageResponseVoiceRequest(UniversalBaseModel): + data: str = pydantic.Field() + """ + DO NOT respond to a `voice-request` webhook with this schema of { data }. This schema just exists to document what the response should look like. Follow these instructions: + + Here is what the request will look like: + + POST https://{assistant.voice.server.url} + Content-Type: application/json + + { + "messsage": { + "type": "voice-request", + "text": "Hello, world!", + "sampleRate": 24000, + ...other metadata about the call... + } + } + + The expected response is 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport: + + ``` + response.on('data', (chunk: Buffer) => { + outputStream.write(chunk); + }); + ``` + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/server_message_speech_update.py b/src/vapi/types/server_message_speech_update.py new file mode 100644 index 0000000..28cc604 --- /dev/null +++ b/src/vapi/types/server_message_speech_update.py @@ -0,0 +1,103 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_speech_update_phone_number import ServerMessageSpeechUpdatePhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .server_message_speech_update_status import ServerMessageSpeechUpdateStatus +from .server_message_speech_update_role import ServerMessageSpeechUpdateRole +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageSpeechUpdate(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageSpeechUpdatePhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + status: ServerMessageSpeechUpdateStatus = pydantic.Field() + """ + This is the status of the speech update. + """ + + role: ServerMessageSpeechUpdateRole = pydantic.Field() + """ + This is the role which the speech update is for. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageSpeechUpdate=ServerMessageSpeechUpdate) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageSpeechUpdate=ServerMessageSpeechUpdate) +update_forward_refs(HandoffStep, ServerMessageSpeechUpdate=ServerMessageSpeechUpdate) diff --git a/src/vapi/types/server_message_speech_update_phone_number.py b/src/vapi/types/server_message_speech_update_phone_number.py new file mode 100644 index 0000000..5d0a948 --- /dev/null +++ b/src/vapi/types/server_message_speech_update_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageSpeechUpdatePhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageSpeechUpdatePhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageSpeechUpdatePhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageSpeechUpdatePhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageSpeechUpdatePhoneNumber = typing.Union[ + ServerMessageSpeechUpdatePhoneNumber_ByoPhoneNumber, + ServerMessageSpeechUpdatePhoneNumber_Twilio, + ServerMessageSpeechUpdatePhoneNumber_Vonage, + ServerMessageSpeechUpdatePhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_speech_update_role.py b/src/vapi/types/server_message_speech_update_role.py new file mode 100644 index 0000000..fceee9f --- /dev/null +++ b/src/vapi/types/server_message_speech_update_role.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ServerMessageSpeechUpdateRole = typing.Union[typing.Literal["assistant", "user"], typing.Any] diff --git a/src/vapi/types/server_message_speech_update_status.py b/src/vapi/types/server_message_speech_update_status.py new file mode 100644 index 0000000..39e6f62 --- /dev/null +++ b/src/vapi/types/server_message_speech_update_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ServerMessageSpeechUpdateStatus = typing.Union[typing.Literal["started", "stopped"], typing.Any] diff --git a/src/vapi/types/server_message_status_update.py b/src/vapi/types/server_message_status_update.py new file mode 100644 index 0000000..a32b506 --- /dev/null +++ b/src/vapi/types/server_message_status_update.py @@ -0,0 +1,140 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_status_update_phone_number import ServerMessageStatusUpdatePhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .server_message_status_update_status import ServerMessageStatusUpdateStatus +from .server_message_status_update_ended_reason import ServerMessageStatusUpdateEndedReason +from .server_message_status_update_messages_item import ServerMessageStatusUpdateMessagesItem +from .open_ai_message import OpenAiMessage +from .server_message_status_update_destination import ServerMessageStatusUpdateDestination +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageStatusUpdate(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageStatusUpdatePhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + status: ServerMessageStatusUpdateStatus = pydantic.Field() + """ + This is the status of the call. + """ + + ended_reason: typing_extensions.Annotated[ + typing.Optional[ServerMessageStatusUpdateEndedReason], FieldMetadata(alias="endedReason") + ] = pydantic.Field(default=None) + """ + This is the reason the call ended. This is only sent if the status is "ended". + """ + + messages: typing.Optional[typing.List[ServerMessageStatusUpdateMessagesItem]] = pydantic.Field(default=None) + """ + These are the conversation messages of the call. This is only sent if the status is "forwarding". + """ + + messages_open_ai_formatted: typing_extensions.Annotated[ + typing.Optional[typing.List[OpenAiMessage]], FieldMetadata(alias="messagesOpenAIFormatted") + ] = pydantic.Field(default=None) + """ + These are the conversation messages of the call. This is only sent if the status is "forwarding". + """ + + destination: typing.Optional[ServerMessageStatusUpdateDestination] = pydantic.Field(default=None) + """ + This is the destination the call is being transferred to. This is only sent if the status is "forwarding". + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + transcript: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the transcript of the call. This is only sent if the status is "forwarding". + """ + + inbound_phone_call_debugging_artifacts: typing_extensions.Annotated[ + typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], + FieldMetadata(alias="inboundPhoneCallDebuggingArtifacts"), + ] = pydantic.Field(default=None) + """ + This is the inbound phone call debugging artifacts. This is only sent if the status is "ended" and there was an error accepting the inbound phone call. + + This will include any errors related to the "assistant-request" if one was made. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageStatusUpdate=ServerMessageStatusUpdate) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageStatusUpdate=ServerMessageStatusUpdate) +update_forward_refs(HandoffStep, ServerMessageStatusUpdate=ServerMessageStatusUpdate) diff --git a/src/vapi/types/server_message_status_update_destination.py b/src/vapi/types/server_message_status_update_destination.py new file mode 100644 index 0000000..be380b0 --- /dev/null +++ b/src/vapi/types/server_message_status_update_destination.py @@ -0,0 +1,59 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ServerMessageStatusUpdateDestination_Number(UniversalBaseModel): + """ + This is the destination the call is being transferred to. This is only sent if the status is "forwarding". + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageStatusUpdateDestination_Sip(UniversalBaseModel): + """ + This is the destination the call is being transferred to. This is only sent if the status is "forwarding". + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageStatusUpdateDestination = typing.Union[ + ServerMessageStatusUpdateDestination_Number, ServerMessageStatusUpdateDestination_Sip +] diff --git a/src/vapi/types/server_message_status_update_ended_reason.py b/src/vapi/types/server_message_status_update_ended_reason.py new file mode 100644 index 0000000..c1df2f6 --- /dev/null +++ b/src/vapi/types/server_message_status_update_ended_reason.py @@ -0,0 +1,177 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ServerMessageStatusUpdateEndedReason = typing.Union[ + typing.Literal[ + "assistant-error", + "assistant-not-found", + "db-error", + "no-server-available", + "license-check-failed", + "pipeline-error-openai-llm-failed", + "pipeline-error-azure-openai-llm-failed", + "pipeline-error-groq-llm-failed", + "pipeline-error-anthropic-llm-failed", + "pipeline-error-vapi-llm-failed", + "pipeline-error-vapi-400-bad-request-validation-failed", + "pipeline-error-vapi-401-unauthorized", + "pipeline-error-vapi-403-model-access-denied", + "pipeline-error-vapi-429-exceeded-quota", + "pipeline-error-vapi-500-server-error", + "pipeline-error-openai-voice-failed", + "pipeline-error-cartesia-voice-failed", + "pipeline-error-deepgram-transcriber-failed", + "pipeline-error-deepgram-voice-failed", + "pipeline-error-gladia-transcriber-failed", + "pipeline-error-eleven-labs-voice-failed", + "pipeline-error-playht-voice-failed", + "pipeline-error-lmnt-voice-failed", + "pipeline-error-azure-voice-failed", + "pipeline-error-rime-ai-voice-failed", + "pipeline-error-neets-voice-failed", + "pipeline-no-available-model", + "worker-shutdown", + "unknown-error", + "vonage-disconnected", + "vonage-failed-to-connect-call", + "phone-call-provider-bypass-enabled-but-no-call-received", + "vapifault-phone-call-worker-setup-socket-error", + "vapifault-phone-call-worker-worker-setup-socket-timeout", + "vapifault-phone-call-worker-could-not-find-call", + "vapifault-transport-never-connected", + "vapifault-web-call-worker-setup-failed", + "vapifault-transport-connected-but-call-not-active", + "assistant-not-invalid", + "assistant-not-provided", + "call-start-error-neither-assistant-nor-server-set", + "assistant-request-failed", + "assistant-request-returned-error", + "assistant-request-returned-unspeakable-error", + "assistant-request-returned-invalid-assistant", + "assistant-request-returned-no-assistant", + "assistant-request-returned-forwarding-phone-number", + "assistant-ended-call", + "assistant-said-end-call-phrase", + "assistant-forwarded-call", + "assistant-join-timed-out", + "customer-busy", + "customer-ended-call", + "customer-did-not-answer", + "customer-did-not-give-microphone-permission", + "assistant-said-message-with-end-call-enabled", + "exceeded-max-duration", + "manually-canceled", + "phone-call-provider-closed-websocket", + "pipeline-error-openai-400-bad-request-validation-failed", + "pipeline-error-openai-401-unauthorized", + "pipeline-error-openai-403-model-access-denied", + "pipeline-error-openai-429-exceeded-quota", + "pipeline-error-openai-500-server-error", + "pipeline-error-azure-openai-400-bad-request-validation-failed", + "pipeline-error-azure-openai-401-unauthorized", + "pipeline-error-azure-openai-403-model-access-denied", + "pipeline-error-azure-openai-429-exceeded-quota", + "pipeline-error-azure-openai-500-server-error", + "pipeline-error-groq-400-bad-request-validation-failed", + "pipeline-error-groq-401-unauthorized", + "pipeline-error-groq-403-model-access-denied", + "pipeline-error-groq-429-exceeded-quota", + "pipeline-error-groq-500-server-error", + "pipeline-error-anthropic-400-bad-request-validation-failed", + "pipeline-error-anthropic-401-unauthorized", + "pipeline-error-anthropic-403-model-access-denied", + "pipeline-error-anthropic-429-exceeded-quota", + "pipeline-error-anthropic-500-server-error", + "pipeline-error-together-ai-400-bad-request-validation-failed", + "pipeline-error-together-ai-401-unauthorized", + "pipeline-error-together-ai-403-model-access-denied", + "pipeline-error-together-ai-429-exceeded-quota", + "pipeline-error-together-ai-500-server-error", + "pipeline-error-together-ai-llm-failed", + "pipeline-error-anyscale-400-bad-request-validation-failed", + "pipeline-error-anyscale-401-unauthorized", + "pipeline-error-anyscale-403-model-access-denied", + "pipeline-error-anyscale-429-exceeded-quota", + "pipeline-error-anyscale-500-server-error", + "pipeline-error-anyscale-llm-failed", + "pipeline-error-openrouter-400-bad-request-validation-failed", + "pipeline-error-openrouter-401-unauthorized", + "pipeline-error-openrouter-403-model-access-denied", + "pipeline-error-openrouter-429-exceeded-quota", + "pipeline-error-openrouter-500-server-error", + "pipeline-error-openrouter-llm-failed", + "pipeline-error-perplexity-ai-400-bad-request-validation-failed", + "pipeline-error-perplexity-ai-401-unauthorized", + "pipeline-error-perplexity-ai-403-model-access-denied", + "pipeline-error-perplexity-ai-429-exceeded-quota", + "pipeline-error-perplexity-ai-500-server-error", + "pipeline-error-perplexity-ai-llm-failed", + "pipeline-error-deepinfra-400-bad-request-validation-failed", + "pipeline-error-deepinfra-401-unauthorized", + "pipeline-error-deepinfra-403-model-access-denied", + "pipeline-error-deepinfra-429-exceeded-quota", + "pipeline-error-deepinfra-500-server-error", + "pipeline-error-deepinfra-llm-failed", + "pipeline-error-runpod-400-bad-request-validation-failed", + "pipeline-error-runpod-401-unauthorized", + "pipeline-error-runpod-403-model-access-denied", + "pipeline-error-runpod-429-exceeded-quota", + "pipeline-error-runpod-500-server-error", + "pipeline-error-runpod-llm-failed", + "pipeline-error-custom-llm-400-bad-request-validation-failed", + "pipeline-error-custom-llm-401-unauthorized", + "pipeline-error-custom-llm-403-model-access-denied", + "pipeline-error-custom-llm-429-exceeded-quota", + "pipeline-error-custom-llm-500-server-error", + "pipeline-error-custom-llm-llm-failed", + "pipeline-error-cartesia-socket-hang-up", + "pipeline-error-cartesia-requested-payment", + "pipeline-error-cartesia-500-server-error", + "pipeline-error-cartesia-503-server-error", + "pipeline-error-cartesia-522-server-error", + "pipeline-error-custom-voice-failed", + "pipeline-error-eleven-labs-voice-not-found", + "pipeline-error-eleven-labs-quota-exceeded", + "pipeline-error-eleven-labs-unauthorized-access", + "pipeline-error-eleven-labs-unauthorized-to-access-model", + "pipeline-error-eleven-labs-professional-voices-only-for-creator-plus", + "pipeline-error-eleven-labs-blocked-free-plan-and-requested-upgrade", + "pipeline-error-eleven-labs-blocked-concurrent-requests-and-requested-upgrade", + "pipeline-error-eleven-labs-blocked-using-instant-voice-clone-and-requested-upgrade", + "pipeline-error-eleven-labs-system-busy-and-requested-upgrade", + "pipeline-error-eleven-labs-voice-not-fine-tuned", + "pipeline-error-eleven-labs-invalid-api-key", + "pipeline-error-eleven-labs-invalid-voice-samples", + "pipeline-error-eleven-labs-voice-disabled-by-owner", + "pipeline-error-eleven-labs-blocked-account-in-probation", + "pipeline-error-eleven-labs-blocked-content-against-their-policy", + "pipeline-error-eleven-labs-missing-samples-for-voice-clone", + "pipeline-error-eleven-labs-voice-not-fine-tuned-and-cannot-be-used", + "pipeline-error-eleven-labs-voice-not-allowed-for-free-users", + "pipeline-error-eleven-labs-500-server-error", + "pipeline-error-eleven-labs-max-character-limit-exceeded", + "pipeline-error-playht-request-timed-out", + "pipeline-error-playht-invalid-voice", + "pipeline-error-playht-unexpected-error", + "pipeline-error-playht-out-of-credits", + "pipeline-error-playht-voice-must-be-a-valid-voice-manifest-uri", + "pipeline-error-playht-401-unauthorized", + "pipeline-error-playht-403-forbidden-out-of-characters", + "pipeline-error-playht-403-forbidden-api-access-not-available", + "pipeline-error-playht-429-exceeded-quota", + "pipeline-error-playht-502-gateway-error", + "pipeline-error-playht-504-gateway-error", + "pipeline-error-deepgram-403-model-access-denied", + "pipeline-error-deepgram-404-not-found", + "pipeline-error-deepgram-400-no-such-model-language-tier-combination", + "pipeline-error-deepgram-500-returning-invalid-json", + "sip-gateway-failed-to-connect-call", + "silence-timed-out", + "twilio-failed-to-connect-call", + "twilio-reported-customer-misdialed", + "voicemail", + "vonage-rejected", + ], + typing.Any, +] diff --git a/src/vapi/types/server_message_status_update_messages_item.py b/src/vapi/types/server_message_status_update_messages_item.py new file mode 100644 index 0000000..5982d0d --- /dev/null +++ b/src/vapi/types/server_message_status_update_messages_item.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from .user_message import UserMessage +from .system_message import SystemMessage +from .bot_message import BotMessage +from .tool_call_message import ToolCallMessage +from .tool_call_result_message import ToolCallResultMessage + +ServerMessageStatusUpdateMessagesItem = typing.Union[ + UserMessage, SystemMessage, BotMessage, ToolCallMessage, ToolCallResultMessage +] diff --git a/src/vapi/types/server_message_status_update_phone_number.py b/src/vapi/types/server_message_status_update_phone_number.py new file mode 100644 index 0000000..fc296b7 --- /dev/null +++ b/src/vapi/types/server_message_status_update_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageStatusUpdatePhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageStatusUpdatePhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageStatusUpdatePhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageStatusUpdatePhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageStatusUpdatePhoneNumber = typing.Union[ + ServerMessageStatusUpdatePhoneNumber_ByoPhoneNumber, + ServerMessageStatusUpdatePhoneNumber_Twilio, + ServerMessageStatusUpdatePhoneNumber_Vonage, + ServerMessageStatusUpdatePhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_status_update_status.py b/src/vapi/types/server_message_status_update_status.py new file mode 100644 index 0000000..b9f6a9e --- /dev/null +++ b/src/vapi/types/server_message_status_update_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ServerMessageStatusUpdateStatus = typing.Union[ + typing.Literal["queued", "ringing", "in-progress", "forwarding", "ended"], typing.Any +] diff --git a/src/vapi/types/server_message_tool_calls.py b/src/vapi/types/server_message_tool_calls.py new file mode 100644 index 0000000..0298338 --- /dev/null +++ b/src/vapi/types/server_message_tool_calls.py @@ -0,0 +1,107 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_tool_calls_phone_number import ServerMessageToolCallsPhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .server_message_tool_calls_tool_with_tool_call_list_item import ServerMessageToolCallsToolWithToolCallListItem +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from .tool_call import ToolCall +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageToolCalls(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageToolCallsPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + tool_with_tool_call_list: typing_extensions.Annotated[ + typing.List[ServerMessageToolCallsToolWithToolCallListItem], FieldMetadata(alias="toolWithToolCallList") + ] = pydantic.Field() + """ + This is the list of tools calls that the model is requesting along with the original tool configuration. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + tool_call_list: typing_extensions.Annotated[typing.List[ToolCall], FieldMetadata(alias="toolCallList")] = ( + pydantic.Field() + ) + """ + This is the list of tool calls that the model is requesting. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageToolCalls=ServerMessageToolCalls) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageToolCalls=ServerMessageToolCalls) +update_forward_refs(HandoffStep, ServerMessageToolCalls=ServerMessageToolCalls) diff --git a/src/vapi/types/server_message_tool_calls_phone_number.py b/src/vapi/types/server_message_tool_calls_phone_number.py new file mode 100644 index 0000000..f1cda88 --- /dev/null +++ b/src/vapi/types/server_message_tool_calls_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageToolCallsPhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageToolCallsPhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageToolCallsPhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageToolCallsPhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageToolCallsPhoneNumber = typing.Union[ + ServerMessageToolCallsPhoneNumber_ByoPhoneNumber, + ServerMessageToolCallsPhoneNumber_Twilio, + ServerMessageToolCallsPhoneNumber_Vonage, + ServerMessageToolCallsPhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_tool_calls_tool_with_tool_call_list_item.py b/src/vapi/types/server_message_tool_calls_tool_with_tool_call_list_item.py new file mode 100644 index 0000000..e1962b3 --- /dev/null +++ b/src/vapi/types/server_message_tool_calls_tool_with_tool_call_list_item.py @@ -0,0 +1,80 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .function_tool_with_tool_call_messages_item import FunctionToolWithToolCallMessagesItem +from .tool_call import ToolCall +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .ghl_tool_with_tool_call_messages_item import GhlToolWithToolCallMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .make_tool_with_tool_call_messages_item import MakeToolWithToolCallMessagesItem +from .make_tool_metadata import MakeToolMetadata + + +class ServerMessageToolCallsToolWithToolCallListItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[FunctionToolWithToolCallMessagesItem]] = None + tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageToolCallsToolWithToolCallListItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[GhlToolWithToolCallMessagesItem]] = None + tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageToolCallsToolWithToolCallListItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[MakeToolWithToolCallMessagesItem]] = None + tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageToolCallsToolWithToolCallListItem = typing.Union[ + ServerMessageToolCallsToolWithToolCallListItem_Function, + ServerMessageToolCallsToolWithToolCallListItem_Ghl, + ServerMessageToolCallsToolWithToolCallListItem_Make, +] diff --git a/src/vapi/types/server_message_transcript.py b/src/vapi/types/server_message_transcript.py new file mode 100644 index 0000000..254f997 --- /dev/null +++ b/src/vapi/types/server_message_transcript.py @@ -0,0 +1,110 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_transcript_phone_number import ServerMessageTranscriptPhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from .server_message_transcript_role import ServerMessageTranscriptRole +from .server_message_transcript_transcript_type import ServerMessageTranscriptTranscriptType +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageTranscript(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageTranscriptPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + role: ServerMessageTranscriptRole = pydantic.Field() + """ + This is the role for which the transcript is for. + """ + + transcript_type: typing_extensions.Annotated[ + ServerMessageTranscriptTranscriptType, FieldMetadata(alias="transcriptType") + ] = pydantic.Field() + """ + This is the type of the transcript. + """ + + transcript: str = pydantic.Field() + """ + This is the transcript content. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageTranscript=ServerMessageTranscript) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageTranscript=ServerMessageTranscript) +update_forward_refs(HandoffStep, ServerMessageTranscript=ServerMessageTranscript) diff --git a/src/vapi/types/server_message_transcript_phone_number.py b/src/vapi/types/server_message_transcript_phone_number.py new file mode 100644 index 0000000..92b6478 --- /dev/null +++ b/src/vapi/types/server_message_transcript_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageTranscriptPhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageTranscriptPhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageTranscriptPhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageTranscriptPhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageTranscriptPhoneNumber = typing.Union[ + ServerMessageTranscriptPhoneNumber_ByoPhoneNumber, + ServerMessageTranscriptPhoneNumber_Twilio, + ServerMessageTranscriptPhoneNumber_Vonage, + ServerMessageTranscriptPhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_transcript_role.py b/src/vapi/types/server_message_transcript_role.py new file mode 100644 index 0000000..5ce912b --- /dev/null +++ b/src/vapi/types/server_message_transcript_role.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ServerMessageTranscriptRole = typing.Union[typing.Literal["assistant", "user"], typing.Any] diff --git a/src/vapi/types/server_message_transcript_transcript_type.py b/src/vapi/types/server_message_transcript_transcript_type.py new file mode 100644 index 0000000..50c1a7b --- /dev/null +++ b/src/vapi/types/server_message_transcript_transcript_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ServerMessageTranscriptTranscriptType = typing.Union[typing.Literal["partial", "final"], typing.Any] diff --git a/src/vapi/types/server_message_transfer_destination_request.py b/src/vapi/types/server_message_transfer_destination_request.py new file mode 100644 index 0000000..2ed21e8 --- /dev/null +++ b/src/vapi/types/server_message_transfer_destination_request.py @@ -0,0 +1,93 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_transfer_destination_request_phone_number import ServerMessageTransferDestinationRequestPhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageTransferDestinationRequest(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageTransferDestinationRequestPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageTransferDestinationRequest=ServerMessageTransferDestinationRequest) +update_forward_refs( + CreateWorkflowBlockDto, ServerMessageTransferDestinationRequest=ServerMessageTransferDestinationRequest +) +update_forward_refs(HandoffStep, ServerMessageTransferDestinationRequest=ServerMessageTransferDestinationRequest) diff --git a/src/vapi/types/server_message_transfer_destination_request_phone_number.py b/src/vapi/types/server_message_transfer_destination_request_phone_number.py new file mode 100644 index 0000000..eaa1564 --- /dev/null +++ b/src/vapi/types/server_message_transfer_destination_request_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageTransferDestinationRequestPhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageTransferDestinationRequestPhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageTransferDestinationRequestPhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageTransferDestinationRequestPhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageTransferDestinationRequestPhoneNumber = typing.Union[ + ServerMessageTransferDestinationRequestPhoneNumber_ByoPhoneNumber, + ServerMessageTransferDestinationRequestPhoneNumber_Twilio, + ServerMessageTransferDestinationRequestPhoneNumber_Vonage, + ServerMessageTransferDestinationRequestPhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_transfer_update.py b/src/vapi/types/server_message_transfer_update.py new file mode 100644 index 0000000..aaf0c5d --- /dev/null +++ b/src/vapi/types/server_message_transfer_update.py @@ -0,0 +1,111 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_transfer_update_phone_number import ServerMessageTransferUpdatePhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .server_message_transfer_update_destination import ServerMessageTransferUpdateDestination +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageTransferUpdate(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageTransferUpdatePhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + destination: typing.Optional[ServerMessageTransferUpdateDestination] = pydantic.Field(default=None) + """ + This is the destination of the transfer. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + to_assistant: typing_extensions.Annotated[ + typing.Optional[CreateAssistantDto], FieldMetadata(alias="toAssistant") + ] = pydantic.Field(default=None) + """ + This is the assistant that the call is being transferred to. This is only sent if `destination.type` is "assistant". + """ + + from_assistant: typing_extensions.Annotated[ + typing.Optional[CreateAssistantDto], FieldMetadata(alias="fromAssistant") + ] = pydantic.Field(default=None) + """ + This is the assistant that the call is being transferred from. This is only sent if `destination.type` is "assistant". + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageTransferUpdate=ServerMessageTransferUpdate) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageTransferUpdate=ServerMessageTransferUpdate) +update_forward_refs(HandoffStep, ServerMessageTransferUpdate=ServerMessageTransferUpdate) diff --git a/src/vapi/types/server_message_transfer_update_destination.py b/src/vapi/types/server_message_transfer_update_destination.py new file mode 100644 index 0000000..62e1980 --- /dev/null +++ b/src/vapi/types/server_message_transfer_update_destination.py @@ -0,0 +1,106 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .transfer_destination_assistant_transfer_mode import TransferDestinationAssistantTransferMode +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ServerMessageTransferUpdateDestination_Assistant(UniversalBaseModel): + """ + This is the destination of the transfer. + """ + + type: typing.Literal["assistant"] = "assistant" + transfer_mode: typing_extensions.Annotated[ + typing.Optional[TransferDestinationAssistantTransferMode], FieldMetadata(alias="transferMode") + ] = None + assistant_name: typing_extensions.Annotated[str, FieldMetadata(alias="assistantName")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageTransferUpdateDestination_Step(UniversalBaseModel): + """ + This is the destination of the transfer. + """ + + type: typing.Literal["step"] = "step" + step_name: typing_extensions.Annotated[str, FieldMetadata(alias="stepName")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageTransferUpdateDestination_Number(UniversalBaseModel): + """ + This is the destination of the transfer. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageTransferUpdateDestination_Sip(UniversalBaseModel): + """ + This is the destination of the transfer. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageTransferUpdateDestination = typing.Union[ + ServerMessageTransferUpdateDestination_Assistant, + ServerMessageTransferUpdateDestination_Step, + ServerMessageTransferUpdateDestination_Number, + ServerMessageTransferUpdateDestination_Sip, +] diff --git a/src/vapi/types/server_message_transfer_update_phone_number.py b/src/vapi/types/server_message_transfer_update_phone_number.py new file mode 100644 index 0000000..9382cb9 --- /dev/null +++ b/src/vapi/types/server_message_transfer_update_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageTransferUpdatePhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageTransferUpdatePhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageTransferUpdatePhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageTransferUpdatePhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageTransferUpdatePhoneNumber = typing.Union[ + ServerMessageTransferUpdatePhoneNumber_ByoPhoneNumber, + ServerMessageTransferUpdatePhoneNumber_Twilio, + ServerMessageTransferUpdatePhoneNumber_Vonage, + ServerMessageTransferUpdatePhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_user_interrupted.py b/src/vapi/types/server_message_user_interrupted.py new file mode 100644 index 0000000..44ea262 --- /dev/null +++ b/src/vapi/types/server_message_user_interrupted.py @@ -0,0 +1,91 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_user_interrupted_phone_number import ServerMessageUserInterruptedPhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageUserInterrupted(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageUserInterruptedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageUserInterrupted=ServerMessageUserInterrupted) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageUserInterrupted=ServerMessageUserInterrupted) +update_forward_refs(HandoffStep, ServerMessageUserInterrupted=ServerMessageUserInterrupted) diff --git a/src/vapi/types/server_message_user_interrupted_phone_number.py b/src/vapi/types/server_message_user_interrupted_phone_number.py new file mode 100644 index 0000000..07440e3 --- /dev/null +++ b/src/vapi/types/server_message_user_interrupted_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageUserInterruptedPhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageUserInterruptedPhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageUserInterruptedPhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageUserInterruptedPhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageUserInterruptedPhoneNumber = typing.Union[ + ServerMessageUserInterruptedPhoneNumber_ByoPhoneNumber, + ServerMessageUserInterruptedPhoneNumber_Twilio, + ServerMessageUserInterruptedPhoneNumber_Vonage, + ServerMessageUserInterruptedPhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_voice_input.py b/src/vapi/types/server_message_voice_input.py new file mode 100644 index 0000000..faaf902 --- /dev/null +++ b/src/vapi/types/server_message_voice_input.py @@ -0,0 +1,96 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_voice_input_phone_number import ServerMessageVoiceInputPhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageVoiceInput(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageVoiceInputPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + input: str = pydantic.Field() + """ + This is the voice input content + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageVoiceInput=ServerMessageVoiceInput) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageVoiceInput=ServerMessageVoiceInput) +update_forward_refs(HandoffStep, ServerMessageVoiceInput=ServerMessageVoiceInput) diff --git a/src/vapi/types/server_message_voice_input_phone_number.py b/src/vapi/types/server_message_voice_input_phone_number.py new file mode 100644 index 0000000..ed3bfe3 --- /dev/null +++ b/src/vapi/types/server_message_voice_input_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageVoiceInputPhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageVoiceInputPhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageVoiceInputPhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageVoiceInputPhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageVoiceInputPhoneNumber = typing.Union[ + ServerMessageVoiceInputPhoneNumber_ByoPhoneNumber, + ServerMessageVoiceInputPhoneNumber_Twilio, + ServerMessageVoiceInputPhoneNumber_Vonage, + ServerMessageVoiceInputPhoneNumber_Vapi, +] diff --git a/src/vapi/types/server_message_voice_request.py b/src/vapi/types/server_message_voice_request.py new file mode 100644 index 0000000..6c6a005 --- /dev/null +++ b/src/vapi/types/server_message_voice_request.py @@ -0,0 +1,101 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from .server_message_voice_request_phone_number import ServerMessageVoiceRequestPhoneNumber +from ..core.serialization import FieldMetadata +import pydantic +from .artifact import Artifact +from .create_assistant_dto import CreateAssistantDto +from .create_customer_dto import CreateCustomerDto +from .call import Call +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class ServerMessageVoiceRequest(UniversalBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageVoiceRequestPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + timestamp: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the ISO-8601 formatted timestamp of when the message was sent. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that is currently active. This is provided for convenience. + + This matches one of the following: + + - `call.assistant`, + - `call.assistantId`, + - `call.squad[n].assistant`, + - `call.squad[n].assistantId`, + - `call.squadId->[n].assistant`, + - `call.squadId->[n].assistantId`. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer associated with the call. + + This matches one of the following: + + - `call.customer`, + - `call.customerId`. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call object. + + This matches what was returned in POST /call. + + Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + """ + + text: str = pydantic.Field() + """ + This is the text to be synthesized. + """ + + sample_rate: typing_extensions.Annotated[float, FieldMetadata(alias="sampleRate")] = pydantic.Field() + """ + This is the sample rate to be synthesized. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, ServerMessageVoiceRequest=ServerMessageVoiceRequest) +update_forward_refs(CreateWorkflowBlockDto, ServerMessageVoiceRequest=ServerMessageVoiceRequest) +update_forward_refs(HandoffStep, ServerMessageVoiceRequest=ServerMessageVoiceRequest) diff --git a/src/vapi/types/server_message_voice_request_phone_number.py b/src/vapi/types/server_message_voice_request_phone_number.py new file mode 100644 index 0000000..3287ca8 --- /dev/null +++ b/src/vapi/types/server_message_voice_request_phone_number.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination +from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination +from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + + +class ServerMessageVoiceRequestPhoneNumber_ByoPhoneNumber(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["byo-phone-number"] = "byo-phone-number" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateByoPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: typing.Optional[str] = None + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageVoiceRequestPhoneNumber_Twilio(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["twilio"] = "twilio" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateTwilioPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageVoiceRequestPhoneNumber_Vonage(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vonage"] = "vonage" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVonagePhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + number: str + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ServerMessageVoiceRequestPhoneNumber_Vapi(UniversalBaseModel): + """ + This is the phone number associated with the call. + + This matches one of the following: + + - `call.phoneNumber`, + - `call.phoneNumberId`. + """ + + provider: typing.Literal["vapi"] = "vapi" + fallback_destination: typing_extensions.Annotated[ + typing.Optional[CreateVapiPhoneNumberDtoFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = None + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + name: typing.Optional[str] = None + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = None + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = None + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = None + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ServerMessageVoiceRequestPhoneNumber = typing.Union[ + ServerMessageVoiceRequestPhoneNumber_ByoPhoneNumber, + ServerMessageVoiceRequestPhoneNumber_Twilio, + ServerMessageVoiceRequestPhoneNumber_Vonage, + ServerMessageVoiceRequestPhoneNumber_Vapi, +] diff --git a/src/vapi/types/sip_trunk_gateway.py b/src/vapi/types/sip_trunk_gateway.py new file mode 100644 index 0000000..5b76c03 --- /dev/null +++ b/src/vapi/types/sip_trunk_gateway.py @@ -0,0 +1,79 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .sip_trunk_gateway_outbound_protocol import SipTrunkGatewayOutboundProtocol +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class SipTrunkGateway(UniversalBaseModel): + ip: str = pydantic.Field() + """ + This is the address of the gateway. It can be an IPv4 address like 1.1.1.1 or a fully qualified domain name like my-sip-trunk.pstn.twilio.com. + """ + + port: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the port number of the gateway. Default is 5060. + + @default 5060 + """ + + netmask: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the netmask of the gateway. Defaults to 32. + + @default 32 + """ + + inbound_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="inboundEnabled")] = ( + pydantic.Field(default=None) + ) + """ + This is whether inbound calls are allowed from this gateway. Default is true. + + @default true + """ + + outbound_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="outboundEnabled")] = ( + pydantic.Field(default=None) + ) + """ + This is whether outbound calls should be sent to this gateway. Default is true. + + Note, if netmask is less than 32, it doesn't affect the outbound IPs that are tried. 1 attempt is made to `ip:port`. + + @default true + """ + + outbound_protocol: typing_extensions.Annotated[ + typing.Optional[SipTrunkGatewayOutboundProtocol], FieldMetadata(alias="outboundProtocol") + ] = pydantic.Field(default=None) + """ + This is the protocol to use for SIP signaling outbound calls. Default is udp. + + @default udp + """ + + options_ping_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="optionsPingEnabled") + ] = pydantic.Field(default=None) + """ + This is whether to send options ping to the gateway. This can be used to check if the gateway is reachable. Default is false. + + This is useful for high availability setups where you want to check if the gateway is reachable before routing calls to it. Note, if no gateway for a trunk is reachable, outbound calls will be rejected. + + @default false + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/sip_trunk_gateway_outbound_protocol.py b/src/vapi/types/sip_trunk_gateway_outbound_protocol.py new file mode 100644 index 0000000..b1f8224 --- /dev/null +++ b/src/vapi/types/sip_trunk_gateway_outbound_protocol.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SipTrunkGatewayOutboundProtocol = typing.Union[typing.Literal["tls/srtp", "tcp", "tls", "udp"], typing.Any] diff --git a/src/vapi/types/sip_trunk_outbound_authentication_plan.py b/src/vapi/types/sip_trunk_outbound_authentication_plan.py new file mode 100644 index 0000000..63c7acd --- /dev/null +++ b/src/vapi/types/sip_trunk_outbound_authentication_plan.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .sip_trunk_outbound_sip_register_plan import SipTrunkOutboundSipRegisterPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class SipTrunkOutboundAuthenticationPlan(UniversalBaseModel): + auth_password: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="authPassword")] = ( + pydantic.Field(default=None) + ) + """ + This is not returned in the API. + """ + + auth_username: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="authUsername")] = None + sip_register_plan: typing_extensions.Annotated[ + typing.Optional[SipTrunkOutboundSipRegisterPlan], FieldMetadata(alias="sipRegisterPlan") + ] = pydantic.Field(default=None) + """ + This can be used to configure if SIP register is required by the SIP trunk. If not provided, no SIP registration will be attempted. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/sip_trunk_outbound_sip_register_plan.py b/src/vapi/types/sip_trunk_outbound_sip_register_plan.py new file mode 100644 index 0000000..25536fe --- /dev/null +++ b/src/vapi/types/sip_trunk_outbound_sip_register_plan.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class SipTrunkOutboundSipRegisterPlan(UniversalBaseModel): + domain: typing.Optional[str] = None + username: typing.Optional[str] = None + realm: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/squad.py b/src/vapi/types/squad.py new file mode 100644 index 0000000..ff6da73 --- /dev/null +++ b/src/vapi/types/squad.py @@ -0,0 +1,73 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing +import pydantic +from .squad_member_dto import SquadMemberDto +import typing_extensions +from .assistant_overrides import AssistantOverrides +from ..core.serialization import FieldMetadata +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class Squad(UniversalBaseModel): + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the squad. + """ + + members: typing.List[SquadMemberDto] = pydantic.Field() + """ + This is the list of assistants that make up the squad. + + The call will start with the first assistant in the list. + """ + + members_overrides: typing_extensions.Annotated[ + typing.Optional[AssistantOverrides], FieldMetadata(alias="membersOverrides") + ] = pydantic.Field(default=None) + """ + This can be used to override all the assistants' settings and provide values for their template variables. + + Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the squad. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this squad belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the squad was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the squad was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, Squad=Squad) +update_forward_refs(CreateWorkflowBlockDto, Squad=Squad) +update_forward_refs(HandoffStep, Squad=Squad) diff --git a/src/vapi/types/squad_member_dto.py b/src/vapi/types/squad_member_dto.py new file mode 100644 index 0000000..ee6a85e --- /dev/null +++ b/src/vapi/types/squad_member_dto.py @@ -0,0 +1,60 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .create_assistant_dto import CreateAssistantDto +from .assistant_overrides import AssistantOverrides +from .transfer_destination_assistant import TransferDestinationAssistant +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class SquadMemberDto(UniversalBaseModel): + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + """ + + assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + """ + This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. + """ + + assistant_overrides: typing_extensions.Annotated[ + typing.Optional[AssistantOverrides], FieldMetadata(alias="assistantOverrides") + ] = pydantic.Field(default=None) + """ + This can be used to override the assistant's settings and provide values for it's template variables. + """ + + assistant_destinations: typing_extensions.Annotated[ + typing.Optional[typing.List[TransferDestinationAssistant]], FieldMetadata(alias="assistantDestinations") + ] = pydantic.Field(default=None) + """ + These are the others assistants that this assistant can transfer to. + + If the assistant already has transfer call tool, these destinations are just appended to existing ones. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, SquadMemberDto=SquadMemberDto) +update_forward_refs(CreateWorkflowBlockDto, SquadMemberDto=SquadMemberDto) +update_forward_refs(HandoffStep, SquadMemberDto=SquadMemberDto) diff --git a/src/vapi/types/start_speaking_plan.py b/src/vapi/types/start_speaking_plan.py new file mode 100644 index 0000000..280eb8d --- /dev/null +++ b/src/vapi/types/start_speaking_plan.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .transcription_endpointing_plan import TranscriptionEndpointingPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class StartSpeakingPlan(UniversalBaseModel): + wait_seconds: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="waitSeconds")] = ( + pydantic.Field(default=None) + ) + """ + This is how long assistant waits before speaking. Defaults to 0.4. + + This is the minimum it will wait but if there is latency is the pipeline, this minimum will be exceeded. This is really a stopgap in case the pipeline is moving too fast. + + Example: + + - If model generates tokens and voice generates bytes within 100ms, the pipeline still waits 300ms before outputting speech. + + Usage: + + - If the customer is taking long pauses, set this to a higher value. + - If the assistant is accidentally jumping in too much, set this to a higher value. + + @default 0.4 + """ + + smart_endpointing_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="smartEndpointingEnabled") + ] = pydantic.Field(default=None) + """ + This determines if a customer speech is considered done (endpointing) using the VAP model on customer's speech. This is good for middle-of-thought detection. + + Once an endpoint is triggered, the request is sent to `assistant.model`. + + Default `false` since experimental. + + @default false + """ + + transcription_endpointing_plan: typing_extensions.Annotated[ + typing.Optional[TranscriptionEndpointingPlan], FieldMetadata(alias="transcriptionEndpointingPlan") + ] = pydantic.Field(default=None) + """ + This determines how a customer speech is considered done (endpointing) using the transcription of customer's speech. + + Once an endpoint is triggered, the request is sent to `assistant.model`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/step_destination.py b/src/vapi/types/step_destination.py new file mode 100644 index 0000000..b05bee5 --- /dev/null +++ b/src/vapi/types/step_destination.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .step_destination_conditions_item import StepDestinationConditionsItem +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class StepDestination(UniversalBaseModel): + type: typing.Literal["step"] = "step" + conditions: typing.Optional[typing.List[StepDestinationConditionsItem]] = pydantic.Field(default=None) + """ + This is an optional array of conditions that must be met for this destination to be triggered. If empty, this is the default destination that the step transfers to. + """ + + step_name: typing_extensions.Annotated[str, FieldMetadata(alias="stepName")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/step_destination_conditions_item.py b/src/vapi/types/step_destination_conditions_item.py new file mode 100644 index 0000000..dd848ad --- /dev/null +++ b/src/vapi/types/step_destination_conditions_item.py @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .rule_based_condition_operator import RuleBasedConditionOperator +import typing_extensions +from ..core.serialization import FieldMetadata + + +class StepDestinationConditionsItem_ModelBased(UniversalBaseModel): + type: typing.Literal["model-based"] = "model-based" + instruction: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class StepDestinationConditionsItem_RuleBased(UniversalBaseModel): + type: typing.Literal["rule-based"] = "rule-based" + operator: RuleBasedConditionOperator + left_side: typing_extensions.Annotated[str, FieldMetadata(alias="leftSide")] + right_side: typing_extensions.Annotated[str, FieldMetadata(alias="rightSide")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +StepDestinationConditionsItem = typing.Union[ + StepDestinationConditionsItem_ModelBased, StepDestinationConditionsItem_RuleBased +] diff --git a/src/vapi/types/stop_speaking_plan.py b/src/vapi/types/stop_speaking_plan.py new file mode 100644 index 0000000..4d22a7e --- /dev/null +++ b/src/vapi/types/stop_speaking_plan.py @@ -0,0 +1,65 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class StopSpeakingPlan(UniversalBaseModel): + num_words: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numWords")] = pydantic.Field( + default=None + ) + """ + This is the number of words that the customer has to say before the assistant will stop talking. + + Words like "stop", "actually", "no", etc. will always interrupt immediately regardless of this value. + + Words like "okay", "yeah", "right" will never interrupt. + + When set to 0, `voiceSeconds` is used in addition to the transcriptions to determine the customer has started speaking. + + Defaults to 0. + + @default 0 + """ + + voice_seconds: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="voiceSeconds")] = ( + pydantic.Field(default=None) + ) + """ + This is the seconds customer has to speak before the assistant stops talking. This uses the VAD (Voice Activity Detection) spike to determine if the customer has started speaking. + + Considerations: + + - A lower value might be more responsive but could potentially pick up non-speech sounds. + - A higher value reduces false positives but might slightly delay the detection of speech onset. + + This is only used if `numWords` is set to 0. + + Defaults to 0.2 + + @default 0.2 + """ + + backoff_seconds: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="backoffSeconds")] = ( + pydantic.Field(default=None) + ) + """ + This is the seconds to wait before the assistant will start talking again after being interrupted. + + Defaults to 1. + + @default 1 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/structured_data_plan.py b/src/vapi/types/structured_data_plan.py new file mode 100644 index 0000000..cf5a06a --- /dev/null +++ b/src/vapi/types/structured_data_plan.py @@ -0,0 +1,66 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from .json_schema import JsonSchema +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class StructuredDataPlan(UniversalBaseModel): + messages: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(default=None) + """ + These are the messages used to generate the structured data. + + @default: ` [ { "role": "system", "content": "You are an expert data extractor. You will be given a transcript of a call. Extract structured data per the JSON Schema. DO NOT return anything except the structured data.\n\nJson Schema:\\n{{schema}}\n\nOnly respond with the JSON." }, { "role": "user", "content": "Here is the transcript:\n\n{{transcript}}\n\n" } ]` + + You can customize by providing any messages you want. + + Here are the template variables available: + + - {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{schema}}: the schema of the structured data from `structuredDataPlan.schema` + """ + + enabled: typing.Optional[bool] = pydantic.Field(default=None) + """ + This determines whether structured data is generated and stored in `call.analysis.structuredData`. Defaults to false. + + Usage: + + - If you want to extract structured data, set this to true and provide a `schema`. + + @default false + """ + + schema_: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="schema")] = pydantic.Field( + default=None + ) + """ + This is the schema of the structured data. The output is stored in `call.analysis.structuredData`. + + Complete guide on JSON Schema can be found [here](https://ajv.js.org/json-schema.html#json-data-type). + """ + + timeout_seconds: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="timeoutSeconds")] = ( + pydantic.Field(default=None) + ) + """ + This is how long the request is tried before giving up. When request times out, `call.analysis.structuredData` will be empty. + + Usage: + + - To guarantee the structured data is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond. + + @default 5 seconds + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/success_evaluation_plan.py b/src/vapi/types/success_evaluation_plan.py new file mode 100644 index 0000000..d2b428b --- /dev/null +++ b/src/vapi/types/success_evaluation_plan.py @@ -0,0 +1,75 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .success_evaluation_plan_rubric import SuccessEvaluationPlanRubric +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class SuccessEvaluationPlan(UniversalBaseModel): + rubric: typing.Optional[SuccessEvaluationPlanRubric] = pydantic.Field(default=None) + """ + This enforces the rubric of the evaluation. The output is stored in `call.analysis.successEvaluation`. + + Options include: + + - 'NumericScale': A scale of 1 to 10. + - 'DescriptiveScale': A scale of Excellent, Good, Fair, Poor. + - 'Checklist': A checklist of criteria and their status. + - 'Matrix': A grid that evaluates multiple criteria across different performance levels. + - 'PercentageScale': A scale of 0% to 100%. + - 'LikertScale': A scale of Strongly Agree, Agree, Neutral, Disagree, Strongly Disagree. + - 'AutomaticRubric': Automatically break down evaluation into several criteria, each with its own score. + - 'PassFail': A simple 'true' if call passed, 'false' if not. + + Default is 'PassFail'. + """ + + messages: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(default=None) + """ + These are the messages used to generate the success evaluation. + + @default: ` [ { "role": "system", "content": "You are an expert call evaluator. You will be given a transcript of a call and the system prompt of the AI participant. Determine if the call was successful based on the objectives inferred from the system prompt. DO NOT return anything except the result.\n\nRubric:\\n{{rubric}}\n\nOnly respond with the result." }, { "role": "user", "content": "Here is the transcript:\n\n{{transcript}}\n\n" }, { "role": "user", "content": "Here was the system prompt of the call:\n\n{{systemPrompt}}\n\n" } ]` + + You can customize by providing any messages you want. + + Here are the template variables available: + + - {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{rubric}}: the rubric of the success evaluation from `successEvaluationPlan.rubric` + """ + + enabled: typing.Optional[bool] = pydantic.Field(default=None) + """ + This determines whether a success evaluation is generated and stored in `call.analysis.successEvaluation`. Defaults to true. + + Usage: + + - If you want to disable the success evaluation, set this to false. + + @default true + """ + + timeout_seconds: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="timeoutSeconds")] = ( + pydantic.Field(default=None) + ) + """ + This is how long the request is tried before giving up. When request times out, `call.analysis.successEvaluation` will be empty. + + Usage: + + - To guarantee the success evaluation is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond. + + @default 5 seconds + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/success_evaluation_plan_rubric.py b/src/vapi/types/success_evaluation_plan_rubric.py new file mode 100644 index 0000000..a49ab5d --- /dev/null +++ b/src/vapi/types/success_evaluation_plan_rubric.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SuccessEvaluationPlanRubric = typing.Union[ + typing.Literal[ + "NumericScale", + "DescriptiveScale", + "Checklist", + "Matrix", + "PercentageScale", + "LikertScale", + "AutomaticRubric", + "PassFail", + ], + typing.Any, +] diff --git a/src/vapi/types/summary_plan.py b/src/vapi/types/summary_plan.py new file mode 100644 index 0000000..9d1c222 --- /dev/null +++ b/src/vapi/types/summary_plan.py @@ -0,0 +1,56 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class SummaryPlan(UniversalBaseModel): + messages: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = pydantic.Field(default=None) + """ + These are the messages used to generate the summary. + + @default: ` [ { "role": "system", "content": "You are an expert note-taker. You will be given a transcript of a call. Summarize the call in 2-3 sentences. DO NOT return anything except the summary." }, { "role": "user", "content": "Here is the transcript:\n\n{{transcript}}\n\n" } ]` + + You can customize by providing any messages you want. + + Here are the template variables available: + + - {{transcript}}: The transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: The system prompt of the call from `assistant.model.messages[type=system].content` + """ + + enabled: typing.Optional[bool] = pydantic.Field(default=None) + """ + This determines whether a summary is generated and stored in `call.analysis.summary`. Defaults to true. + + Usage: + + - If you want to disable the summary, set this to false. + + @default true + """ + + timeout_seconds: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="timeoutSeconds")] = ( + pydantic.Field(default=None) + ) + """ + This is how long the request is tried before giving up. When request times out, `call.analysis.summary` will be empty. + + Usage: + + - To guarantee the summary is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond. + + @default 5 seconds + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/sync_voice_library_dto.py b/src/vapi/types/sync_voice_library_dto.py new file mode 100644 index 0000000..a31bf6e --- /dev/null +++ b/src/vapi/types/sync_voice_library_dto.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .sync_voice_library_dto_providers_item import SyncVoiceLibraryDtoProvidersItem +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class SyncVoiceLibraryDto(UniversalBaseModel): + providers: typing.Optional[typing.List[SyncVoiceLibraryDtoProvidersItem]] = pydantic.Field(default=None) + """ + List of providers you want to sync. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/sync_voice_library_dto_providers_item.py b/src/vapi/types/sync_voice_library_dto_providers_item.py new file mode 100644 index 0000000..76b8a08 --- /dev/null +++ b/src/vapi/types/sync_voice_library_dto_providers_item.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SyncVoiceLibraryDtoProvidersItem = typing.Union[ + typing.Literal[ + "11labs", "azure", "cartesia", "custom-voice", "deepgram", "lmnt", "neets", "openai", "playht", "rime-ai" + ], + typing.Any, +] diff --git a/src/vapi/types/system_message.py b/src/vapi/types/system_message.py new file mode 100644 index 0000000..3855e82 --- /dev/null +++ b/src/vapi/types/system_message.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class SystemMessage(UniversalBaseModel): + role: str = pydantic.Field() + """ + The role of the system in the conversation. + """ + + message: str = pydantic.Field() + """ + The message content from the system. + """ + + time: float = pydantic.Field() + """ + The timestamp when the message was sent. + """ + + seconds_from_start: typing_extensions.Annotated[float, FieldMetadata(alias="secondsFromStart")] = pydantic.Field() + """ + The number of seconds from the start of the conversation. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/talkscriber_transcriber.py b/src/vapi/types/talkscriber_transcriber.py new file mode 100644 index 0000000..e5dcbe3 --- /dev/null +++ b/src/vapi/types/talkscriber_transcriber.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +from .talkscriber_transcriber_language import TalkscriberTranscriberLanguage +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TalkscriberTranscriber(UniversalBaseModel): + model: typing.Optional[typing.Literal["whisper"]] = pydantic.Field(default=None) + """ + This is the model that will be used for the transcription. + """ + + language: typing.Optional[TalkscriberTranscriberLanguage] = pydantic.Field(default=None) + """ + This is the language that will be set for the transcription. The list of languages Whisper supports can be found here: https://github.com/openai/whisper/blob/main/whisper/tokenizer.py + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/talkscriber_transcriber_language.py b/src/vapi/types/talkscriber_transcriber_language.py new file mode 100644 index 0000000..f000012 --- /dev/null +++ b/src/vapi/types/talkscriber_transcriber_language.py @@ -0,0 +1,109 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TalkscriberTranscriberLanguage = typing.Union[ + typing.Literal[ + "en", + "zh", + "de", + "es", + "ru", + "ko", + "fr", + "ja", + "pt", + "tr", + "pl", + "ca", + "nl", + "ar", + "sv", + "it", + "id", + "hi", + "fi", + "vi", + "he", + "uk", + "el", + "ms", + "cs", + "ro", + "da", + "hu", + "ta", + "no", + "th", + "ur", + "hr", + "bg", + "lt", + "la", + "mi", + "ml", + "cy", + "sk", + "te", + "fa", + "lv", + "bn", + "sr", + "az", + "sl", + "kn", + "et", + "mk", + "br", + "eu", + "is", + "hy", + "ne", + "mn", + "bs", + "kk", + "sq", + "sw", + "gl", + "mr", + "pa", + "si", + "km", + "sn", + "yo", + "so", + "af", + "oc", + "ka", + "be", + "tg", + "sd", + "gu", + "am", + "yi", + "lo", + "uz", + "fo", + "ht", + "ps", + "tk", + "nn", + "mt", + "sa", + "lb", + "my", + "bo", + "tl", + "mg", + "as", + "tt", + "haw", + "ln", + "ha", + "ba", + "jw", + "su", + "yue", + ], + typing.Any, +] diff --git a/src/vapi/types/template.py b/src/vapi/types/template.py new file mode 100644 index 0000000..5e396f8 --- /dev/null +++ b/src/vapi/types/template.py @@ -0,0 +1,58 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .template_details import TemplateDetails +import typing_extensions +from .template_provider_details import TemplateProviderDetails +from ..core.serialization import FieldMetadata +from .tool_template_metadata import ToolTemplateMetadata +from .template_visibility import TemplateVisibility +import pydantic +from .template_provider import TemplateProvider +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class Template(UniversalBaseModel): + details: typing.Optional[TemplateDetails] = None + provider_details: typing_extensions.Annotated[ + typing.Optional[TemplateProviderDetails], FieldMetadata(alias="providerDetails") + ] = None + metadata: typing.Optional[ToolTemplateMetadata] = None + visibility: typing.Optional[TemplateVisibility] = None + type: typing.Literal["tool"] = "tool" + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The name of the template. This is just for your own reference. + """ + + provider: typing.Optional[TemplateProvider] = None + id: str = pydantic.Field() + """ + The unique identifier for the template. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + The unique identifier for the organization that this template belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + The ISO 8601 date-time string of when the template was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + The ISO 8601 date-time string of when the template was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/template_details.py b/src/vapi/types/template_details.py new file mode 100644 index 0000000..139c891 --- /dev/null +++ b/src/vapi/types/template_details.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class TemplateDetails_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TemplateDetails_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TemplateDetails_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TemplateDetails_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TemplateDetails_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TemplateDetails_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TemplateDetails_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +TemplateDetails = typing.Union[ + TemplateDetails_Dtmf, + TemplateDetails_EndCall, + TemplateDetails_Voicemail, + TemplateDetails_Function, + TemplateDetails_Ghl, + TemplateDetails_Make, + TemplateDetails_TransferCall, +] diff --git a/src/vapi/types/template_provider.py b/src/vapi/types/template_provider.py new file mode 100644 index 0000000..7b9b0a1 --- /dev/null +++ b/src/vapi/types/template_provider.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TemplateProvider = typing.Union[typing.Literal["make", "gohighlevel", "function"], typing.Any] diff --git a/src/vapi/types/template_provider_details.py b/src/vapi/types/template_provider_details.py new file mode 100644 index 0000000..8ea8bbf --- /dev/null +++ b/src/vapi/types/template_provider_details.py @@ -0,0 +1,75 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .tool_template_setup import ToolTemplateSetup +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class TemplateProviderDetails_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + template_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateUrl")] = None + setup_instructions: typing_extensions.Annotated[ + typing.Optional[typing.List[ToolTemplateSetup]], FieldMetadata(alias="setupInstructions") + ] = None + scenario_id: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="scenarioId")] = None + scenario_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="scenarioName")] = None + trigger_hook_id: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="triggerHookId")] = None + trigger_hook_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="triggerHookName")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TemplateProviderDetails_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + template_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateUrl")] = None + setup_instructions: typing_extensions.Annotated[ + typing.Optional[typing.List[ToolTemplateSetup]], FieldMetadata(alias="setupInstructions") + ] = None + workflow_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="workflowId")] = None + workflow_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="workflowName")] = None + webhook_hook_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="webhookHookId")] = None + webhook_hook_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="webhookHookName")] = None + location_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="locationId")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TemplateProviderDetails_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + template_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateUrl")] = None + setup_instructions: typing_extensions.Annotated[ + typing.Optional[typing.List[ToolTemplateSetup]], FieldMetadata(alias="setupInstructions") + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +TemplateProviderDetails = typing.Union[ + TemplateProviderDetails_Make, TemplateProviderDetails_Ghl, TemplateProviderDetails_Function +] diff --git a/src/vapi/types/template_visibility.py b/src/vapi/types/template_visibility.py new file mode 100644 index 0000000..283e3a0 --- /dev/null +++ b/src/vapi/types/template_visibility.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TemplateVisibility = typing.Union[typing.Literal["public", "private"], typing.Any] diff --git a/src/vapi/types/time_range.py b/src/vapi/types/time_range.py new file mode 100644 index 0000000..3b7026a --- /dev/null +++ b/src/vapi/types/time_range.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .time_range_step import TimeRangeStep +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TimeRange(UniversalBaseModel): + step: typing.Optional[TimeRangeStep] = pydantic.Field(default=None) + """ + This is the time step for aggregations. + + If not provided, defaults to returning for the entire time range. + """ + + start: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + This is the start date for the time range. + + If not provided, defaults to the 7 days ago. + """ + + end: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + This is the end date for the time range. + + If not provided, defaults to now. + """ + + timezone: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the timezone you want to set for the query. + + If not provided, defaults to UTC. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/time_range_step.py b/src/vapi/types/time_range_step.py new file mode 100644 index 0000000..822ed42 --- /dev/null +++ b/src/vapi/types/time_range_step.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TimeRangeStep = typing.Union[ + typing.Literal["minute", "hour", "day", "week", "month", "quarter", "year", "decade", "century", "millennium"], + typing.Any, +] diff --git a/src/vapi/types/together_ai_credential.py b/src/vapi/types/together_ai_credential.py new file mode 100644 index 0000000..eded171 --- /dev/null +++ b/src/vapi/types/together_ai_credential.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TogetherAiCredential(UniversalBaseModel): + provider: typing.Literal["together-ai"] = "together-ai" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/together_ai_model.py b/src/vapi/types/together_ai_model.py new file mode 100644 index 0000000..4135ee5 --- /dev/null +++ b/src/vapi/types/together_ai_model.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .open_ai_message import OpenAiMessage +import pydantic +from .together_ai_model_tools_item import TogetherAiModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TogetherAiModel(UniversalBaseModel): + messages: typing.Optional[typing.List[OpenAiMessage]] = pydantic.Field(default=None) + """ + This is the starting state for the conversation. + """ + + tools: typing.Optional[typing.List[TogetherAiModelToolsItem]] = pydantic.Field(default=None) + """ + These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. + + Both `tools` and `toolIds` can be used together. + """ + + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = ( + pydantic.Field(default=None) + ) + """ + These are the tools that the assistant can use during the call. To use transient tools, use `tools`. + + Both `tools` and `toolIds` can be used together. + """ + + model: str = pydantic.Field() + """ + This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b + """ + + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + """ + + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = pydantic.Field(default=None) + """ + These are the options for the knowledge base. + """ + + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = pydantic.Field( + default=None + ) + """ + This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + """ + + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether we detect user's emotion while they speak and send it as an additional info to model. + + Default `false` because the model is usually are good at understanding the user's emotion from text. + + @default false + """ + + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = ( + pydantic.Field(default=None) + ) + """ + This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + + Default is 0. + + @default 0 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/together_ai_model_tools_item.py b/src/vapi/types/together_ai_model_tools_item.py new file mode 100644 index 0000000..e25b096 --- /dev/null +++ b/src/vapi/types/together_ai_model_tools_item.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class TogetherAiModelToolsItem_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TogetherAiModelToolsItem_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TogetherAiModelToolsItem_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TogetherAiModelToolsItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TogetherAiModelToolsItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TogetherAiModelToolsItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TogetherAiModelToolsItem_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +TogetherAiModelToolsItem = typing.Union[ + TogetherAiModelToolsItem_Dtmf, + TogetherAiModelToolsItem_EndCall, + TogetherAiModelToolsItem_Voicemail, + TogetherAiModelToolsItem_Function, + TogetherAiModelToolsItem_Ghl, + TogetherAiModelToolsItem_Make, + TogetherAiModelToolsItem_TransferCall, +] diff --git a/src/vapi/types/token.py b/src/vapi/types/token.py new file mode 100644 index 0000000..7125095 --- /dev/null +++ b/src/vapi/types/token.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .token_tag import TokenTag +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +import datetime as dt +from .token_restrictions import TokenRestrictions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class Token(UniversalBaseModel): + tag: typing.Optional[TokenTag] = pydantic.Field(default=None) + """ + This is the tag for the token. It represents its scope. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the token. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is unique identifier for the org that this token belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the token was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the token was last updated. + """ + + value: str = pydantic.Field() + """ + This is the token key. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the token. This is just for your own reference. + """ + + restrictions: typing.Optional[TokenRestrictions] = pydantic.Field(default=None) + """ + This are the restrictions for the token. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/token_restrictions.py b/src/vapi/types/token_restrictions.py new file mode 100644 index 0000000..745130b --- /dev/null +++ b/src/vapi/types/token_restrictions.py @@ -0,0 +1,53 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TokenRestrictions(UniversalBaseModel): + enabled: typing.Optional[bool] = pydantic.Field(default=None) + """ + This determines whether the token is enabled or disabled. Default is true, it's enabled. + """ + + allowed_origins: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="allowedOrigins") + ] = pydantic.Field(default=None) + """ + This determines the allowed origins for this token. Validates the `Origin` header. Default is any origin. + + Only relevant for `public` tokens. + """ + + allowed_assistant_ids: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="allowedAssistantIds") + ] = pydantic.Field(default=None) + """ + This determines which assistantIds can be used when creating a call. Default is any assistantId. + + Only relevant for `public` tokens. + """ + + allow_transient_assistant: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="allowTransientAssistant") + ] = pydantic.Field(default=None) + """ + This determines whether transient assistants can be used when creating a call. Default is true. + + If `allowedAssistantIds` is provided, this is automatically false. + + Only relevant for `public` tokens. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/token_tag.py b/src/vapi/types/token_tag.py new file mode 100644 index 0000000..45979d3 --- /dev/null +++ b/src/vapi/types/token_tag.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TokenTag = typing.Union[typing.Literal["private", "public"], typing.Any] diff --git a/src/vapi/types/tool_call.py b/src/vapi/types/tool_call.py new file mode 100644 index 0000000..069fe42 --- /dev/null +++ b/src/vapi/types/tool_call.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +from .tool_call_function import ToolCallFunction +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ToolCall(UniversalBaseModel): + type: typing.Literal["function"] = pydantic.Field(default="function") + """ + This is the type of tool the model called. + """ + + function: ToolCallFunction = pydantic.Field() + """ + This is the function the model called. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the tool call. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/tool_call_block.py b/src/vapi/types/tool_call_block.py new file mode 100644 index 0000000..aaf5be0 --- /dev/null +++ b/src/vapi/types/tool_call_block.py @@ -0,0 +1,95 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .tool_call_block_messages_item import ToolCallBlockMessagesItem +import pydantic +import typing_extensions +from .json_schema import JsonSchema +from ..core.serialization import FieldMetadata +from .tool_call_block_tool import ToolCallBlockTool +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ToolCallBlock(UniversalBaseModel): + messages: typing.Optional[typing.List[ToolCallBlockMessagesItem]] = pydantic.Field(default=None) + """ + These are the pre-configured messages that will be spoken to the user while the block is running. + """ + + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = ( + pydantic.Field(default=None) + ) + """ + This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` + + These are accessible as variables: + + - ({{input.propertyName}}) in context of the block execution (step) + - ({{stepName.input.propertyName}}) in context of the workflow + """ + + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = ( + pydantic.Field(default=None) + ) + """ + This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). + + These are accessible as variables: + + - ({{output.propertyName}}) in context of the block execution (step) + - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) + - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + """ + + tool: typing.Optional[ToolCallBlockTool] = pydantic.Field(default=None) + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the block. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the organization that this block belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the block was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the block was last updated. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the block. This is just for your reference. + """ + + tool_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="toolId")] = pydantic.Field( + default=None + ) + """ + This is the id of the tool that the block will call. To use a transient tool, use `tool`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/tool_call_block_messages_item.py b/src/vapi/types/tool_call_block_messages_item.py new file mode 100644 index 0000000..4396680 --- /dev/null +++ b/src/vapi/types/tool_call_block_messages_item.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .block_start_message_conditions_item import BlockStartMessageConditionsItem +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .block_complete_message_conditions_item import BlockCompleteMessageConditionsItem + + +class ToolCallBlockMessagesItem_BlockStart(UniversalBaseModel): + type: typing.Literal["block-start"] = "block-start" + conditions: typing.Optional[typing.List[BlockStartMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolCallBlockMessagesItem_BlockComplete(UniversalBaseModel): + type: typing.Literal["block-complete"] = "block-complete" + conditions: typing.Optional[typing.List[BlockCompleteMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ToolCallBlockMessagesItem = typing.Union[ToolCallBlockMessagesItem_BlockStart, ToolCallBlockMessagesItem_BlockComplete] diff --git a/src/vapi/types/tool_call_block_tool.py b/src/vapi/types/tool_call_block_tool.py new file mode 100644 index 0000000..29dac3f --- /dev/null +++ b/src/vapi/types/tool_call_block_tool.py @@ -0,0 +1,182 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class ToolCallBlockTool_Dtmf(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolCallBlockTool_EndCall(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolCallBlockTool_Voicemail(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolCallBlockTool_Function(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolCallBlockTool_Ghl(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolCallBlockTool_Make(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolCallBlockTool_TransferCall(UniversalBaseModel): + """ + This is the tool that the block will call. To use an existing tool, use `toolId`. + """ + + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ToolCallBlockTool = typing.Union[ + ToolCallBlockTool_Dtmf, + ToolCallBlockTool_EndCall, + ToolCallBlockTool_Voicemail, + ToolCallBlockTool_Function, + ToolCallBlockTool_Ghl, + ToolCallBlockTool_Make, + ToolCallBlockTool_TransferCall, +] diff --git a/src/vapi/types/tool_call_function.py b/src/vapi/types/tool_call_function.py new file mode 100644 index 0000000..a9932ef --- /dev/null +++ b/src/vapi/types/tool_call_function.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ToolCallFunction(UniversalBaseModel): + name: str = pydantic.Field() + """ + This is the name of the function the model called. + """ + + arguments: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() + """ + These are the arguments that the function was called with. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/tool_call_message.py b/src/vapi/types/tool_call_message.py new file mode 100644 index 0000000..bf5b2b0 --- /dev/null +++ b/src/vapi/types/tool_call_message.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ToolCallMessage(UniversalBaseModel): + role: str = pydantic.Field() + """ + The role of the tool call in the conversation. + """ + + tool_calls: typing_extensions.Annotated[ + typing.List[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="toolCalls") + ] = pydantic.Field() + """ + The list of tool calls made during the conversation. + """ + + message: str = pydantic.Field() + """ + The message content for the tool call. + """ + + time: float = pydantic.Field() + """ + The timestamp when the message was sent. + """ + + seconds_from_start: typing_extensions.Annotated[float, FieldMetadata(alias="secondsFromStart")] = pydantic.Field() + """ + The number of seconds from the start of the conversation. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/tool_call_result.py b/src/vapi/types/tool_call_result.py new file mode 100644 index 0000000..ddabef7 --- /dev/null +++ b/src/vapi/types/tool_call_result.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .tool_call_result_message_item import ToolCallResultMessageItem +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ToolCallResult(UniversalBaseModel): + message: typing.Optional[typing.List[ToolCallResultMessageItem]] = pydantic.Field(default=None) + """ + This is the message that will be spoken to the user. + + If this is not returned, assistant will speak: + + 1. a `request-complete` or `request-failed` message from `tool.messages`, if it exists + 2. a response generated by the model, if not + """ + + name: str = pydantic.Field() + """ + This is the name of the function the model called. + """ + + tool_call_id: typing_extensions.Annotated[str, FieldMetadata(alias="toolCallId")] = pydantic.Field() + """ + This is the unique identifier for the tool call. + """ + + result: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the result if the tool call was successful. This is added to the conversation history. + + Further, if this is returned, assistant will speak: + + 1. the `message`, if it exists and is of type `request-complete` + 2. a `request-complete` message from `tool.messages`, if it exists + 3. a response generated by the model, if neither exist + """ + + error: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the error if the tool call was not successful. This is added to the conversation history. + + Further, if this is returned, assistant will speak: + + 1. the `message`, if it exists and is of type `request-failed` + 2. a `request-failed` message from `tool.messages`, if it exists + 3. a response generated by the model, if neither exist + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/tool_call_result_message.py b/src/vapi/types/tool_call_result_message.py new file mode 100644 index 0000000..3bda89c --- /dev/null +++ b/src/vapi/types/tool_call_result_message.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class ToolCallResultMessage(UniversalBaseModel): + role: str = pydantic.Field() + """ + The role of the tool call result in the conversation. + """ + + tool_call_id: typing_extensions.Annotated[str, FieldMetadata(alias="toolCallId")] = pydantic.Field() + """ + The ID of the tool call. + """ + + name: str = pydantic.Field() + """ + The name of the tool that returned the result. + """ + + result: str = pydantic.Field() + """ + The result of the tool call in JSON format. + """ + + time: float = pydantic.Field() + """ + The timestamp when the message was sent. + """ + + seconds_from_start: typing_extensions.Annotated[float, FieldMetadata(alias="secondsFromStart")] = pydantic.Field() + """ + The number of seconds from the start of the conversation. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/tool_call_result_message_item.py b/src/vapi/types/tool_call_result_message_item.py new file mode 100644 index 0000000..280680e --- /dev/null +++ b/src/vapi/types/tool_call_result_message_item.py @@ -0,0 +1,53 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ToolCallResultMessageItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ToolCallResultMessageItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ToolCallResultMessageItem = typing.Union[ + ToolCallResultMessageItem_RequestComplete, ToolCallResultMessageItem_RequestFailed +] diff --git a/src/vapi/types/tool_message_complete.py b/src/vapi/types/tool_message_complete.py new file mode 100644 index 0000000..bc30e15 --- /dev/null +++ b/src/vapi/types/tool_message_complete.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .tool_message_complete_role import ToolMessageCompleteRole +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ToolMessageComplete(UniversalBaseModel): + role: typing.Optional[ToolMessageCompleteRole] = pydantic.Field(default=None) + """ + This is optional and defaults to "assistant". + + When role=assistant, `content` is said out loud. + + When role=system, `content` is passed to the model in a system message. Example: + system: default one + assistant: + user: + assistant: + user: + assistant: + user: + assistant: tool called + tool: your server response + <--- system prompt as hint + ---> model generates response which is spoken + This is useful when you want to provide a hint to the model about what to say next. + """ + + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = pydantic.Field(default=None) + """ + This is an optional boolean that if true, the call will end after the message is spoken. Default is false. + + This is ignored if `role` is set to `system`. + + @default false + """ + + content: str = pydantic.Field() + """ + This is the content that the assistant says when this message is triggered. + """ + + conditions: typing.Optional[typing.List[Condition]] = pydantic.Field(default=None) + """ + This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/tool_message_complete_role.py b/src/vapi/types/tool_message_complete_role.py new file mode 100644 index 0000000..d15c64d --- /dev/null +++ b/src/vapi/types/tool_message_complete_role.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ToolMessageCompleteRole = typing.Union[typing.Literal["assistant", "system"], typing.Any] diff --git a/src/vapi/types/tool_message_delayed.py b/src/vapi/types/tool_message_delayed.py new file mode 100644 index 0000000..7692b1e --- /dev/null +++ b/src/vapi/types/tool_message_delayed.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ToolMessageDelayed(UniversalBaseModel): + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = pydantic.Field(default=None) + """ + The number of milliseconds to wait for the server response before saying this message. + """ + + content: str = pydantic.Field() + """ + This is the content that the assistant says when this message is triggered. + """ + + conditions: typing.Optional[typing.List[Condition]] = pydantic.Field(default=None) + """ + This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/tool_message_failed.py b/src/vapi/types/tool_message_failed.py new file mode 100644 index 0000000..22bdb9d --- /dev/null +++ b/src/vapi/types/tool_message_failed.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ToolMessageFailed(UniversalBaseModel): + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = pydantic.Field(default=None) + """ + This is an optional boolean that if true, the call will end after the message is spoken. Default is false. + + @default false + """ + + content: str = pydantic.Field() + """ + This is the content that the assistant says when this message is triggered. + """ + + conditions: typing.Optional[typing.List[Condition]] = pydantic.Field(default=None) + """ + This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/tool_message_start.py b/src/vapi/types/tool_message_start.py new file mode 100644 index 0000000..c0ce45f --- /dev/null +++ b/src/vapi/types/tool_message_start.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ToolMessageStart(UniversalBaseModel): + content: str = pydantic.Field() + """ + This is the content that the assistant says when this message is triggered. + """ + + conditions: typing.Optional[typing.List[Condition]] = pydantic.Field(default=None) + """ + This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/tool_template_metadata.py b/src/vapi/types/tool_template_metadata.py new file mode 100644 index 0000000..5a8d314 --- /dev/null +++ b/src/vapi/types/tool_template_metadata.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ToolTemplateMetadata(UniversalBaseModel): + collection_type: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="collectionType")] = None + collection_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="collectionId")] = None + collection_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="collectionName")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/tool_template_setup.py b/src/vapi/types/tool_template_setup.py new file mode 100644 index 0000000..2c538fc --- /dev/null +++ b/src/vapi/types/tool_template_setup.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ToolTemplateSetup(UniversalBaseModel): + title: str + description: typing.Optional[str] = None + video_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="videoUrl")] = None + docs_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="docsUrl")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transcriber_cost.py b/src/vapi/types/transcriber_cost.py new file mode 100644 index 0000000..1919bf6 --- /dev/null +++ b/src/vapi/types/transcriber_cost.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TranscriberCost(UniversalBaseModel): + transcriber: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() + """ + This is the transcriber that was used during the call. + + This matches one of the below: + + - `call.assistant.transcriber`, + - `call.assistantId->transcriber`, + - `call.squad[n].assistant.transcriber`, + - `call.squad[n].assistantId->transcriber`, + - `call.squadId->[n].assistant.transcriber`, + - `call.squadId->[n].assistantId->transcriber`. + """ + + minutes: float = pydantic.Field() + """ + This is the minutes of `transcriber` usage. This should match `call.endedAt` - `call.startedAt` for single assistant calls, while squad calls will have multiple transcriber costs one for each assistant that was used. + """ + + cost: float = pydantic.Field() + """ + This is the cost of the component in USD. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transcript_plan.py b/src/vapi/types/transcript_plan.py new file mode 100644 index 0000000..09746cd --- /dev/null +++ b/src/vapi/types/transcript_plan.py @@ -0,0 +1,66 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TranscriptPlan(UniversalBaseModel): + enabled: typing.Optional[bool] = pydantic.Field(default=None) + """ + This determines whether the transcript is stored in `call.artifact.transcript`. Defaults to true. + + @default true + """ + + assistant_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantName")] = ( + pydantic.Field(default=None) + ) + """ + This is the name of the assistant in the transcript. Defaults to 'AI'. + + Usage: + + - If you want to change the name of the assistant in the transcript, set this. Example, here is what the transcript would look like with `assistantName` set to 'Buyer': + + ``` + User: Hello, how are you? + Buyer: I'm fine. + User: Do you want to buy a car? + Buyer: No. + ``` + + @default 'AI' + """ + + user_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="userName")] = pydantic.Field( + default=None + ) + """ + This is the name of the user in the transcript. Defaults to 'User'. + + Usage: + + - If you want to change the name of the user in the transcript, set this. Example, here is what the transcript would look like with `userName` set to 'Seller': + + ``` + Seller: Hello, how are you? + AI: I'm fine. + Seller: Do you want to buy a car? + AI: No. + ``` + + @default 'User' + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transcription_endpointing_plan.py b/src/vapi/types/transcription_endpointing_plan.py new file mode 100644 index 0000000..d5fc148 --- /dev/null +++ b/src/vapi/types/transcription_endpointing_plan.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TranscriptionEndpointingPlan(UniversalBaseModel): + on_punctuation_seconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="onPunctuationSeconds") + ] = pydantic.Field(default=None) + """ + The minimum number of seconds to wait after transcription ending with punctuation before sending a request to the model. Defaults to 0.1. + + This setting exists because the transcriber punctuates the transcription when it's more confident that customer has completed a thought. + + @default 0.1 + """ + + on_no_punctuation_seconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="onNoPunctuationSeconds") + ] = pydantic.Field(default=None) + """ + The minimum number of seconds to wait after transcription ending without punctuation before sending a request to the model. Defaults to 1.5. + + This setting exists to catch the cases where the transcriber was not confident enough to punctuate the transcription, but the customer is done and has been silent for a long time. + + @default 1.5 + """ + + on_number_seconds: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="onNumberSeconds")] = ( + pydantic.Field(default=None) + ) + """ + The minimum number of seconds to wait after transcription ending with a number before sending a request to the model. Defaults to 0.4. + + This setting exists because the transcriber will sometimes punctuate the transcription ending with a number, even though the customer hasn't uttered the full number. This happens commonly for long numbers when the customer reads the number in chunks. + + @default 0.5 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transfer_call_tool.py b/src/vapi/types/transfer_call_tool.py new file mode 100644 index 0000000..26df634 --- /dev/null +++ b/src/vapi/types/transfer_call_tool.py @@ -0,0 +1,87 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from .transfer_call_tool_messages_item import TransferCallToolMessagesItem +from .transfer_call_tool_destinations_item import TransferCallToolDestinationsItem +import datetime as dt +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TransferCallTool(UniversalBaseModel): + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + messages: typing.Optional[typing.List[TransferCallToolMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + destinations: typing.Optional[typing.List[TransferCallToolDestinationsItem]] = pydantic.Field(default=None) + """ + These are the destinations that the call can be transferred to. If no destinations are provided, server.url will be used to get the transfer destination once the tool is called. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the tool. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the organization that this tool belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was last updated. + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + + For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + + An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is the server that will be hit when this tool is requested by the model. + + All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + + This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transfer_call_tool_destinations_item.py b/src/vapi/types/transfer_call_tool_destinations_item.py new file mode 100644 index 0000000..3639360 --- /dev/null +++ b/src/vapi/types/transfer_call_tool_destinations_item.py @@ -0,0 +1,90 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .transfer_destination_assistant_transfer_mode import TransferDestinationAssistantTransferMode +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class TransferCallToolDestinationsItem_Assistant(UniversalBaseModel): + type: typing.Literal["assistant"] = "assistant" + transfer_mode: typing_extensions.Annotated[ + typing.Optional[TransferDestinationAssistantTransferMode], FieldMetadata(alias="transferMode") + ] = None + assistant_name: typing_extensions.Annotated[str, FieldMetadata(alias="assistantName")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TransferCallToolDestinationsItem_Step(UniversalBaseModel): + type: typing.Literal["step"] = "step" + step_name: typing_extensions.Annotated[str, FieldMetadata(alias="stepName")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TransferCallToolDestinationsItem_Number(UniversalBaseModel): + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TransferCallToolDestinationsItem_Sip(UniversalBaseModel): + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +TransferCallToolDestinationsItem = typing.Union[ + TransferCallToolDestinationsItem_Assistant, + TransferCallToolDestinationsItem_Step, + TransferCallToolDestinationsItem_Number, + TransferCallToolDestinationsItem_Sip, +] diff --git a/src/vapi/types/transfer_call_tool_messages_item.py b/src/vapi/types/transfer_call_tool_messages_item.py new file mode 100644 index 0000000..79e01ca --- /dev/null +++ b/src/vapi/types/transfer_call_tool_messages_item.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .condition import Condition +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .tool_message_complete_role import ToolMessageCompleteRole +import typing_extensions +from ..core.serialization import FieldMetadata + + +class TransferCallToolMessagesItem_RequestStart(UniversalBaseModel): + type: typing.Literal["request-start"] = "request-start" + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TransferCallToolMessagesItem_RequestComplete(UniversalBaseModel): + type: typing.Literal["request-complete"] = "request-complete" + role: typing.Optional[ToolMessageCompleteRole] = None + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TransferCallToolMessagesItem_RequestFailed(UniversalBaseModel): + type: typing.Literal["request-failed"] = "request-failed" + end_call_after_spoken_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="endCallAfterSpokenEnabled") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TransferCallToolMessagesItem_RequestResponseDelayed(UniversalBaseModel): + type: typing.Literal["request-response-delayed"] = "request-response-delayed" + timing_milliseconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="timingMilliseconds") + ] = None + content: str + conditions: typing.Optional[typing.List[Condition]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +TransferCallToolMessagesItem = typing.Union[ + TransferCallToolMessagesItem_RequestStart, + TransferCallToolMessagesItem_RequestComplete, + TransferCallToolMessagesItem_RequestFailed, + TransferCallToolMessagesItem_RequestResponseDelayed, +] diff --git a/src/vapi/types/transfer_destination_assistant.py b/src/vapi/types/transfer_destination_assistant.py new file mode 100644 index 0000000..283bab8 --- /dev/null +++ b/src/vapi/types/transfer_destination_assistant.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .transfer_destination_assistant_transfer_mode import TransferDestinationAssistantTransferMode +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TransferDestinationAssistant(UniversalBaseModel): + transfer_mode: typing_extensions.Annotated[ + typing.Optional[TransferDestinationAssistantTransferMode], FieldMetadata(alias="transferMode") + ] = pydantic.Field(default=None) + """ + This is the mode to use for the transfer. Default is `rolling-history`. + + - `rolling-history`: This is the default mode. It keeps the entire conversation history and appends the new assistant's system message on transfer. + + Example: + + Pre-transfer: + system: assistant1 system message + assistant: assistant1 first message + user: hey, good morning + assistant: how can i help? + user: i need help with my account + assistant: (destination.message) + + Post-transfer: + system: assistant1 system message + assistant: assistant1 first message + user: hey, good morning + assistant: how can i help? + user: i need help with my account + assistant: (destination.message) + system: assistant2 system message + assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`) + + - `swap-system-message-in-history`: This replaces the original system message with the new assistant's system message on transfer. + + Example: + + Pre-transfer: + system: assistant1 system message + assistant: assistant1 first message + user: hey, good morning + assistant: how can i help? + user: i need help with my account + assistant: (destination.message) + + Post-transfer: + system: assistant2 system message + assistant: assistant1 first message + user: hey, good morning + assistant: how can i help? + user: i need help with my account + assistant: (destination.message) + assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`) + """ + + assistant_name: typing_extensions.Annotated[str, FieldMetadata(alias="assistantName")] = pydantic.Field() + """ + This is the assistant to transfer the call to. + """ + + message: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the message to say before transferring the call to the destination. + + If this is not provided and transfer tool messages is not provided, default is "Transferring the call now". + + If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set `assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message` for the destination assistant. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the description of the destination, used by the AI to choose when and how to transfer the call. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transfer_destination_assistant_transfer_mode.py b/src/vapi/types/transfer_destination_assistant_transfer_mode.py new file mode 100644 index 0000000..e76e078 --- /dev/null +++ b/src/vapi/types/transfer_destination_assistant_transfer_mode.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TransferDestinationAssistantTransferMode = typing.Union[ + typing.Literal["rolling-history", "swap-system-message-in-history"], typing.Any +] diff --git a/src/vapi/types/transfer_destination_number.py b/src/vapi/types/transfer_destination_number.py new file mode 100644 index 0000000..6ff7132 --- /dev/null +++ b/src/vapi/types/transfer_destination_number.py @@ -0,0 +1,76 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TransferDestinationNumber(UniversalBaseModel): + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = pydantic.Field(default=None) + """ + This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it. + + Use cases: + + - `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks. + - `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls. + + If `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\+?[a-zA-Z0-9]+$/`). + + @default true (E164 check is enabled) + """ + + number: str = pydantic.Field() + """ + This is the phone number to transfer the call to. + """ + + extension: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the extension to dial after transferring the call to the `number`. + """ + + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = pydantic.Field( + default=None + ) + """ + This is the caller ID to use when transferring the call to the `number`. + + Usage: + + - If not provided, the caller ID will be the number the call is coming from. Example, +14151111111 calls in to and the assistant transfers out to +16470000000. +16470000000 will see +14151111111 as the caller. + - To change this behavior, provide a `callerId`. + - Set to '{{customer.number}}' to always use the customer's number as the caller ID. + - Set to '{{phoneNumber.number}}' to always use the phone number of the assistant as the caller ID. + - Set to any E164 number to always use that number as the caller ID. This needs to be a number that is owned or verified by your Transport provider like Twilio. + + For Twilio, you can read up more here: https://www.twilio.com/docs/voice/twiml/dial#callerid + """ + + message: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the message to say before transferring the call to the destination. + + If this is not provided and transfer tool messages is not provided, default is "Transferring the call now". + + If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set `assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message` for the destination assistant. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the description of the destination, used by the AI to choose when and how to transfer the call. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transfer_destination_sip.py b/src/vapi/types/transfer_destination_sip.py new file mode 100644 index 0000000..401a537 --- /dev/null +++ b/src/vapi/types/transfer_destination_sip.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TransferDestinationSip(UniversalBaseModel): + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] = pydantic.Field() + """ + This is the SIP URI to transfer the call to. + """ + + message: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the message to say before transferring the call to the destination. + + If this is not provided and transfer tool messages is not provided, default is "Transferring the call now". + + If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set `assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message` for the destination assistant. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the description of the destination, used by the AI to choose when and how to transfer the call. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transfer_destination_step.py b/src/vapi/types/transfer_destination_step.py new file mode 100644 index 0000000..9bbb568 --- /dev/null +++ b/src/vapi/types/transfer_destination_step.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TransferDestinationStep(UniversalBaseModel): + step_name: typing_extensions.Annotated[str, FieldMetadata(alias="stepName")] = pydantic.Field() + """ + This is the step to transfer to. + """ + + message: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the message to say before transferring the call to the destination. + + If this is not provided and transfer tool messages is not provided, default is "Transferring the call now". + + If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set `assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message` for the destination assistant. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the description of the destination, used by the AI to choose when and how to transfer the call. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transport_configuration_twilio.py b/src/vapi/types/transport_configuration_twilio.py new file mode 100644 index 0000000..552a81c --- /dev/null +++ b/src/vapi/types/transport_configuration_twilio.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from .transport_configuration_twilio_recording_channels import TransportConfigurationTwilioRecordingChannels +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TransportConfigurationTwilio(UniversalBaseModel): + provider: typing.Literal["twilio"] = "twilio" + timeout: typing.Optional[float] = pydantic.Field(default=None) + """ + The integer number of seconds that we should allow the phone to ring before assuming there is no answer. + The default is `60` seconds and the maximum is `600` seconds. + For some call flows, we will add a 5-second buffer to the timeout value you provide. + For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. + You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. + + @default 60 + """ + + record: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether to record the call. + Can be `true` to record the phone call, or `false` to not. + The default is `false`. + + @default false + """ + + recording_channels: typing_extensions.Annotated[ + typing.Optional[TransportConfigurationTwilioRecordingChannels], FieldMetadata(alias="recordingChannels") + ] = pydantic.Field(default=None) + """ + The number of channels in the final recording. + Can be: `mono` or `dual`. + The default is `mono`. + `mono` records both legs of the call in a single channel of the recording file. + `dual` records each leg to a separate channel of the recording file. + The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. + + @default 'mono' + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transport_configuration_twilio_recording_channels.py b/src/vapi/types/transport_configuration_twilio_recording_channels.py new file mode 100644 index 0000000..717d5fb --- /dev/null +++ b/src/vapi/types/transport_configuration_twilio_recording_channels.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TransportConfigurationTwilioRecordingChannels = typing.Union[typing.Literal["mono", "dual"], typing.Any] diff --git a/src/vapi/types/transport_cost.py b/src/vapi/types/transport_cost.py new file mode 100644 index 0000000..eb6c31c --- /dev/null +++ b/src/vapi/types/transport_cost.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class TransportCost(UniversalBaseModel): + minutes: float = pydantic.Field() + """ + This is the minutes of `transport` usage. This should match `call.endedAt` - `call.startedAt`. + """ + + cost: float = pydantic.Field() + """ + This is the cost of the component in USD. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/twilio_credential.py b/src/vapi/types/twilio_credential.py new file mode 100644 index 0000000..30ea1cc --- /dev/null +++ b/src/vapi/types/twilio_credential.py @@ -0,0 +1,48 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TwilioCredential(UniversalBaseModel): + provider: typing.Literal["twilio"] = "twilio" + auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="authToken")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="accountSid")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/twilio_phone_number.py b/src/vapi/types/twilio_phone_number.py new file mode 100644 index 0000000..b76abad --- /dev/null +++ b/src/vapi/types/twilio_phone_number.py @@ -0,0 +1,112 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .twilio_phone_number_fallback_destination import TwilioPhoneNumberFallbackDestination +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TwilioPhoneNumber(UniversalBaseModel): + fallback_destination: typing_extensions.Annotated[ + typing.Optional[TwilioPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = pydantic.Field(default=None) + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the phone number. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this phone number belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the phone number was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the phone number was last updated. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the phone number. This is just for your own reference. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + number: str = pydantic.Field() + """ + These are the digits of the phone number you own on your Twilio. + """ + + twilio_account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAccountSid")] = pydantic.Field() + """ + This is the Twilio Account SID for the phone number. + """ + + twilio_auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="twilioAuthToken")] = pydantic.Field() + """ + This is the Twilio Auth Token for the phone number. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/twilio_phone_number_fallback_destination.py b/src/vapi/types/twilio_phone_number_fallback_destination.py new file mode 100644 index 0000000..75ca2a6 --- /dev/null +++ b/src/vapi/types/twilio_phone_number_fallback_destination.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class TwilioPhoneNumberFallbackDestination_Number(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class TwilioPhoneNumberFallbackDestination_Sip(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +TwilioPhoneNumberFallbackDestination = typing.Union[ + TwilioPhoneNumberFallbackDestination_Number, TwilioPhoneNumberFallbackDestination_Sip +] diff --git a/src/vapi/types/twilio_voicemail_detection.py b/src/vapi/types/twilio_voicemail_detection.py new file mode 100644 index 0000000..9d8b240 --- /dev/null +++ b/src/vapi/types/twilio_voicemail_detection.py @@ -0,0 +1,107 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from .twilio_voicemail_detection_voicemail_detection_types_item import ( + TwilioVoicemailDetectionVoicemailDetectionTypesItem, +) +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class TwilioVoicemailDetection(UniversalBaseModel): + provider: typing.Literal["twilio"] = pydantic.Field(default="twilio") + """ + This is the provider to use for voicemail detection. + """ + + voicemail_detection_types: typing_extensions.Annotated[ + typing.Optional[typing.List[TwilioVoicemailDetectionVoicemailDetectionTypesItem]], + FieldMetadata(alias="voicemailDetectionTypes"), + ] = pydantic.Field(default=None) + """ + These are the AMD messages from Twilio that are considered as voicemail. Default is ['machine_end_beep', 'machine_end_silence']. + + @default {Array} ['machine_end_beep', 'machine_end_silence'] + """ + + enabled: typing.Optional[bool] = pydantic.Field(default=None) + """ + This sets whether the assistant should detect voicemail. Defaults to true. + + @default true + """ + + machine_detection_timeout: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="machineDetectionTimeout") + ] = pydantic.Field(default=None) + """ + The number of seconds that Twilio should attempt to perform answering machine detection before timing out and returning AnsweredBy as unknown. Default is 30 seconds. + + Increasing this value will provide the engine more time to make a determination. This can be useful when DetectMessageEnd is provided in the MachineDetection parameter and there is an expectation of long answering machine greetings that can exceed 30 seconds. + + Decreasing this value will reduce the amount of time the engine has to make a determination. This can be particularly useful when the Enable option is provided in the MachineDetection parameter and you want to limit the time for initial detection. + + Check the [Twilio docs](https://www.twilio.com/docs/voice/answering-machine-detection#optional-api-tuning-parameters) for more info. + + @default 30 + """ + + machine_detection_speech_threshold: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="machineDetectionSpeechThreshold") + ] = pydantic.Field(default=None) + """ + The number of milliseconds that is used as the measuring stick for the length of the speech activity. Durations lower than this value will be interpreted as a human, longer as a machine. Default is 2400 milliseconds. + + Increasing this value will reduce the chance of a False Machine (detected machine, actually human) for a long human greeting (e.g., a business greeting) but increase the time it takes to detect a machine. + + Decreasing this value will reduce the chances of a False Human (detected human, actually machine) for short voicemail greetings. The value of this parameter may need to be reduced by more than 1000ms to detect very short voicemail greetings. A reduction of that significance can result in increased False Machine detections. Adjusting the MachineDetectionSpeechEndThreshold is likely the better approach for short voicemails. Decreasing MachineDetectionSpeechThreshold will also reduce the time it takes to detect a machine. + + Check the [Twilio docs](https://www.twilio.com/docs/voice/answering-machine-detection#optional-api-tuning-parameters) for more info. + + @default 2400 + """ + + machine_detection_speech_end_threshold: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="machineDetectionSpeechEndThreshold") + ] = pydantic.Field(default=None) + """ + The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Default is 1200 milliseconds. + + Increasing this value will typically be used to better address the short voicemail greeting scenarios. For short voicemails, there is typically 1000-2000ms of audio followed by 1200-2400ms of silence and then additional audio before the beep. Increasing the MachineDetectionSpeechEndThreshold to ~2500ms will treat the 1200-2400ms of silence as a gap in the greeting but not the end of the greeting and will result in a machine detection. The downsides of such a change include: + + - Increasing the delay for human detection by the amount you increase this parameter, e.g., a change of 1200ms to 2500ms increases human detection delay by 1300ms. + - Cases where a human has two utterances separated by a period of silence (e.g. a "Hello", then 2000ms of silence, and another "Hello") may be interpreted as a machine. + + Decreasing this value will result in faster human detection. The consequence is that it can lead to increased False Human (detected human, actually machine) detections because a silence gap in a voicemail greeting (not necessarily just in short voicemail scenarios) can be incorrectly interpreted as the end of speech. + + Check the [Twilio docs](https://www.twilio.com/docs/voice/answering-machine-detection#optional-api-tuning-parameters) for more info. + + @default 1200 + """ + + machine_detection_silence_timeout: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="machineDetectionSilenceTimeout") + ] = pydantic.Field(default=None) + """ + The number of milliseconds of initial silence after which an unknown AnsweredBy result will be returned. Default is 5000 milliseconds. + + Increasing this value will result in waiting for a longer period of initial silence before returning an 'unknown' AMD result. + + Decreasing this value will result in waiting for a shorter period of initial silence before returning an 'unknown' AMD result. + + Check the [Twilio docs](https://www.twilio.com/docs/voice/answering-machine-detection#optional-api-tuning-parameters) for more info. + + @default 5000 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/twilio_voicemail_detection_voicemail_detection_types_item.py b/src/vapi/types/twilio_voicemail_detection_voicemail_detection_types_item.py new file mode 100644 index 0000000..e8cf7b9 --- /dev/null +++ b/src/vapi/types/twilio_voicemail_detection_voicemail_detection_types_item.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TwilioVoicemailDetectionVoicemailDetectionTypesItem = typing.Union[ + typing.Literal[ + "machine_start", "human", "fax", "unknown", "machine_end_beep", "machine_end_silence", "machine_end_other" + ], + typing.Any, +] diff --git a/src/vapi/types/update_anthropic_credential_dto.py b/src/vapi/types/update_anthropic_credential_dto.py new file mode 100644 index 0000000..74a4b61 --- /dev/null +++ b/src/vapi/types/update_anthropic_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateAnthropicCredentialDto(UniversalBaseModel): + provider: typing.Literal["anthropic"] = "anthropic" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_anyscale_credential_dto.py b/src/vapi/types/update_anyscale_credential_dto.py new file mode 100644 index 0000000..0f33436 --- /dev/null +++ b/src/vapi/types/update_anyscale_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateAnyscaleCredentialDto(UniversalBaseModel): + provider: typing.Literal["anyscale"] = "anyscale" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_azure_open_ai_credential_dto.py b/src/vapi/types/update_azure_open_ai_credential_dto.py new file mode 100644 index 0000000..f71bf52 --- /dev/null +++ b/src/vapi/types/update_azure_open_ai_credential_dto.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .update_azure_open_ai_credential_dto_region import UpdateAzureOpenAiCredentialDtoRegion +from .update_azure_open_ai_credential_dto_models_item import UpdateAzureOpenAiCredentialDtoModelsItem +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateAzureOpenAiCredentialDto(UniversalBaseModel): + provider: typing.Literal["azure-openai"] = "azure-openai" + region: UpdateAzureOpenAiCredentialDtoRegion + models: typing.List[UpdateAzureOpenAiCredentialDtoModelsItem] + open_ai_key: typing_extensions.Annotated[str, FieldMetadata(alias="openAIKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + open_ai_endpoint: typing_extensions.Annotated[str, FieldMetadata(alias="openAIEndpoint")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_azure_open_ai_credential_dto_models_item.py b/src/vapi/types/update_azure_open_ai_credential_dto_models_item.py new file mode 100644 index 0000000..529eb2a --- /dev/null +++ b/src/vapi/types/update_azure_open_ai_credential_dto_models_item.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateAzureOpenAiCredentialDtoModelsItem = typing.Union[ + typing.Literal[ + "gpt-4o-mini-2024-07-18", + "gpt-4o-2024-05-13", + "gpt-4-turbo-2024-04-09", + "gpt-4-0125-preview", + "gpt-4-1106-preview", + "gpt-4-0613", + "gpt-35-turbo-0125", + "gpt-35-turbo-1106", + ], + typing.Any, +] diff --git a/src/vapi/types/update_azure_open_ai_credential_dto_region.py b/src/vapi/types/update_azure_open_ai_credential_dto_region.py new file mode 100644 index 0000000..874a5bb --- /dev/null +++ b/src/vapi/types/update_azure_open_ai_credential_dto_region.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateAzureOpenAiCredentialDtoRegion = typing.Union[ + typing.Literal[ + "australia", + "canada", + "eastus2", + "eastus", + "france", + "india", + "japan", + "northcentralus", + "norway", + "southcentralus", + "sweden", + "switzerland", + "uk", + "westus", + "westus3", + ], + typing.Any, +] diff --git a/src/vapi/types/update_byo_sip_trunk_credential_dto.py b/src/vapi/types/update_byo_sip_trunk_credential_dto.py new file mode 100644 index 0000000..3bec860 --- /dev/null +++ b/src/vapi/types/update_byo_sip_trunk_credential_dto.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +from .sip_trunk_gateway import SipTrunkGateway +import typing_extensions +from .sip_trunk_outbound_authentication_plan import SipTrunkOutboundAuthenticationPlan +from ..core.serialization import FieldMetadata +from .sbc_configuration import SbcConfiguration +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateByoSipTrunkCredentialDto(UniversalBaseModel): + provider: typing.Optional[typing.Literal["byo-sip-trunk"]] = pydantic.Field(default=None) + """ + This can be used to bring your own SIP trunks or to connect to a Carrier. + """ + + gateways: typing.List[SipTrunkGateway] = pydantic.Field() + """ + This is the list of SIP trunk's gateways. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the SIP trunk. This is just for your reference. + """ + + outbound_authentication_plan: typing_extensions.Annotated[ + typing.Optional[SipTrunkOutboundAuthenticationPlan], FieldMetadata(alias="outboundAuthenticationPlan") + ] = pydantic.Field(default=None) + """ + This can be used to configure the outbound authentication if required by the SIP trunk. + """ + + outbound_leading_plus_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="outboundLeadingPlusEnabled") + ] = pydantic.Field(default=None) + """ + This ensures the outbound origination attempts have a leading plus. Defaults to false to match conventional telecom behavior. + + Usage: + + - Vonage/Twilio requires leading plus for all outbound calls. Set this to true. + + @default false + """ + + sbc_configuration: typing_extensions.Annotated[ + typing.Optional[SbcConfiguration], FieldMetadata(alias="sbcConfiguration") + ] = pydantic.Field(default=None) + """ + This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk's `gateways`, rather than the managed SBC provided by Vapi. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_cartesia_credential_dto.py b/src/vapi/types/update_cartesia_credential_dto.py new file mode 100644 index 0000000..d3adc83 --- /dev/null +++ b/src/vapi/types/update_cartesia_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateCartesiaCredentialDto(UniversalBaseModel): + provider: typing.Literal["cartesia"] = "cartesia" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_custom_llm_credential_dto.py b/src/vapi/types/update_custom_llm_credential_dto.py new file mode 100644 index 0000000..68e1daa --- /dev/null +++ b/src/vapi/types/update_custom_llm_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateCustomLlmCredentialDto(UniversalBaseModel): + provider: typing.Literal["custom-llm"] = "custom-llm" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_deep_infra_credential_dto.py b/src/vapi/types/update_deep_infra_credential_dto.py new file mode 100644 index 0000000..59d154e --- /dev/null +++ b/src/vapi/types/update_deep_infra_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateDeepInfraCredentialDto(UniversalBaseModel): + provider: typing.Literal["deepinfra"] = "deepinfra" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_deepgram_credential_dto.py b/src/vapi/types/update_deepgram_credential_dto.py new file mode 100644 index 0000000..522ee9f --- /dev/null +++ b/src/vapi/types/update_deepgram_credential_dto.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateDeepgramCredentialDto(UniversalBaseModel): + provider: typing.Literal["deepgram"] = "deepgram" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + api_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="apiUrl")] = pydantic.Field( + default=None + ) + """ + This can be used to point to an onprem Deepgram instance. Defaults to api.deepgram.com. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_eleven_labs_credential_dto.py b/src/vapi/types/update_eleven_labs_credential_dto.py new file mode 100644 index 0000000..7cf9735 --- /dev/null +++ b/src/vapi/types/update_eleven_labs_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateElevenLabsCredentialDto(UniversalBaseModel): + provider: typing.Literal["11labs"] = "11labs" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_gcp_credential_dto.py b/src/vapi/types/update_gcp_credential_dto.py new file mode 100644 index 0000000..81bfba5 --- /dev/null +++ b/src/vapi/types/update_gcp_credential_dto.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from .gcp_key import GcpKey +from ..core.serialization import FieldMetadata +from .bucket_plan import BucketPlan +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateGcpCredentialDto(UniversalBaseModel): + provider: typing.Literal["gcp"] = "gcp" + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the GCP credential. This is just for your reference. + """ + + gcp_key: typing_extensions.Annotated[GcpKey, FieldMetadata(alias="gcpKey")] = pydantic.Field() + """ + This is the GCP key. This is the JSON that can be generated in the Google Cloud Console at https://console.cloud.google.com/iam-admin/serviceaccounts/details//keys. + + The schema is identical to the JSON that GCP outputs. + """ + + bucket_plan: typing_extensions.Annotated[typing.Optional[BucketPlan], FieldMetadata(alias="bucketPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the bucket plan that can be provided to store call artifacts in GCP. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_gladia_credential_dto.py b/src/vapi/types/update_gladia_credential_dto.py new file mode 100644 index 0000000..ceb3faa --- /dev/null +++ b/src/vapi/types/update_gladia_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateGladiaCredentialDto(UniversalBaseModel): + provider: typing.Literal["gladia"] = "gladia" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_go_high_level_credential_dto.py b/src/vapi/types/update_go_high_level_credential_dto.py new file mode 100644 index 0000000..60718a1 --- /dev/null +++ b/src/vapi/types/update_go_high_level_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateGoHighLevelCredentialDto(UniversalBaseModel): + provider: typing.Literal["gohighlevel"] = "gohighlevel" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_groq_credential_dto.py b/src/vapi/types/update_groq_credential_dto.py new file mode 100644 index 0000000..1fc0441 --- /dev/null +++ b/src/vapi/types/update_groq_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateGroqCredentialDto(UniversalBaseModel): + provider: typing.Literal["groq"] = "groq" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_lmnt_credential_dto.py b/src/vapi/types/update_lmnt_credential_dto.py new file mode 100644 index 0000000..e56727a --- /dev/null +++ b/src/vapi/types/update_lmnt_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateLmntCredentialDto(UniversalBaseModel): + provider: typing.Literal["lmnt"] = "lmnt" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_make_credential_dto.py b/src/vapi/types/update_make_credential_dto.py new file mode 100644 index 0000000..e767111 --- /dev/null +++ b/src/vapi/types/update_make_credential_dto.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateMakeCredentialDto(UniversalBaseModel): + provider: typing.Literal["make"] = "make" + team_id: typing_extensions.Annotated[str, FieldMetadata(alias="teamId")] = pydantic.Field() + """ + Team ID + """ + + region: str = pydantic.Field() + """ + Region of your application. For example: eu1, eu2, us1, us2 + """ + + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_open_ai_credential_dto.py b/src/vapi/types/update_open_ai_credential_dto.py new file mode 100644 index 0000000..023cdc8 --- /dev/null +++ b/src/vapi/types/update_open_ai_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateOpenAiCredentialDto(UniversalBaseModel): + provider: typing.Literal["openai"] = "openai" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_open_router_credential_dto.py b/src/vapi/types/update_open_router_credential_dto.py new file mode 100644 index 0000000..c6f5ec8 --- /dev/null +++ b/src/vapi/types/update_open_router_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateOpenRouterCredentialDto(UniversalBaseModel): + provider: typing.Literal["openrouter"] = "openrouter" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_org_dto.py b/src/vapi/types/update_org_dto.py new file mode 100644 index 0000000..ec2d05a --- /dev/null +++ b/src/vapi/types/update_org_dto.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateOrgDto(UniversalBaseModel): + hipaa_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="hipaaEnabled")] = ( + pydantic.Field(default=None) + ) + """ + When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + When HIPAA is enabled, only OpenAI/Custom LLM or Azure Providers will be available for LLM and Voice respectively. + This is due to the compliance requirements of HIPAA. Other providers may not meet these requirements. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the org. This is just for your own reference. + """ + + billing_limit: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="billingLimit")] = ( + pydantic.Field(default=None) + ) + """ + This is the monthly billing limit for the org. To go beyond $1000/mo, please contact us at support@vapi.ai. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. + + All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. + """ + + concurrency_limit: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="concurrencyLimit")] = ( + pydantic.Field(default=None) + ) + """ + This is the concurrency limit for the org. This is the maximum number of calls that can be active at any given time. To go beyond 10, please contact us at support@vapi.ai. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_perplexity_ai_credential_dto.py b/src/vapi/types/update_perplexity_ai_credential_dto.py new file mode 100644 index 0000000..62c91f8 --- /dev/null +++ b/src/vapi/types/update_perplexity_ai_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdatePerplexityAiCredentialDto(UniversalBaseModel): + provider: typing.Literal["perplexity-ai"] = "perplexity-ai" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_play_ht_credential_dto.py b/src/vapi/types/update_play_ht_credential_dto.py new file mode 100644 index 0000000..eb7c3e4 --- /dev/null +++ b/src/vapi/types/update_play_ht_credential_dto.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdatePlayHtCredentialDto(UniversalBaseModel): + provider: typing.Literal["playht"] = "playht" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + user_id: typing_extensions.Annotated[str, FieldMetadata(alias="userId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_rime_ai_credential_dto.py b/src/vapi/types/update_rime_ai_credential_dto.py new file mode 100644 index 0000000..250ffab --- /dev/null +++ b/src/vapi/types/update_rime_ai_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateRimeAiCredentialDto(UniversalBaseModel): + provider: typing.Literal["rime-ai"] = "rime-ai" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_runpod_credential_dto.py b/src/vapi/types/update_runpod_credential_dto.py new file mode 100644 index 0000000..b060c80 --- /dev/null +++ b/src/vapi/types/update_runpod_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateRunpodCredentialDto(UniversalBaseModel): + provider: typing.Literal["runpod"] = "runpod" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_s_3_credential_dto.py b/src/vapi/types/update_s_3_credential_dto.py new file mode 100644 index 0000000..196595b --- /dev/null +++ b/src/vapi/types/update_s_3_credential_dto.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateS3CredentialDto(UniversalBaseModel): + provider: typing.Literal["s3"] = pydantic.Field(default="s3") + """ + Credential provider. Only allowed value is s3 + """ + + aws_access_key_id: typing_extensions.Annotated[str, FieldMetadata(alias="awsAccessKeyId")] = pydantic.Field() + """ + AWS access key ID. + """ + + aws_secret_access_key: typing_extensions.Annotated[str, FieldMetadata(alias="awsSecretAccessKey")] = ( + pydantic.Field() + ) + """ + AWS access key secret. This is not returned in the API. + """ + + region: str = pydantic.Field() + """ + AWS region in which the S3 bucket is located. + """ + + s_3_bucket_name: typing_extensions.Annotated[str, FieldMetadata(alias="s3BucketName")] = pydantic.Field() + """ + AWS S3 bucket name. + """ + + s_3_path_prefix: typing_extensions.Annotated[str, FieldMetadata(alias="s3PathPrefix")] = pydantic.Field() + """ + The path prefix for the uploaded recording. Ex. "recordings/" + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_together_ai_credential_dto.py b/src/vapi/types/update_together_ai_credential_dto.py new file mode 100644 index 0000000..bd55816 --- /dev/null +++ b/src/vapi/types/update_together_ai_credential_dto.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateTogetherAiCredentialDto(UniversalBaseModel): + provider: typing.Literal["together-ai"] = "together-ai" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_tool_template_dto.py b/src/vapi/types/update_tool_template_dto.py new file mode 100644 index 0000000..bb3c835 --- /dev/null +++ b/src/vapi/types/update_tool_template_dto.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .update_tool_template_dto_details import UpdateToolTemplateDtoDetails +import typing_extensions +from .update_tool_template_dto_provider_details import UpdateToolTemplateDtoProviderDetails +from ..core.serialization import FieldMetadata +from .tool_template_metadata import ToolTemplateMetadata +from .update_tool_template_dto_visibility import UpdateToolTemplateDtoVisibility +import pydantic +from .update_tool_template_dto_provider import UpdateToolTemplateDtoProvider +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateToolTemplateDto(UniversalBaseModel): + details: typing.Optional[UpdateToolTemplateDtoDetails] = None + provider_details: typing_extensions.Annotated[ + typing.Optional[UpdateToolTemplateDtoProviderDetails], FieldMetadata(alias="providerDetails") + ] = None + metadata: typing.Optional[ToolTemplateMetadata] = None + visibility: typing.Optional[UpdateToolTemplateDtoVisibility] = None + type: typing.Literal["tool"] = "tool" + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The name of the template. This is just for your own reference. + """ + + provider: typing.Optional[UpdateToolTemplateDtoProvider] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_tool_template_dto_details.py b/src/vapi/types/update_tool_template_dto_details.py new file mode 100644 index 0000000..16be6cb --- /dev/null +++ b/src/vapi/types/update_tool_template_dto_details.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class UpdateToolTemplateDtoDetails_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateToolTemplateDtoDetails_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateToolTemplateDtoDetails_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateToolTemplateDtoDetails_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateToolTemplateDtoDetails_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateToolTemplateDtoDetails_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateToolTemplateDtoDetails_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +UpdateToolTemplateDtoDetails = typing.Union[ + UpdateToolTemplateDtoDetails_Dtmf, + UpdateToolTemplateDtoDetails_EndCall, + UpdateToolTemplateDtoDetails_Voicemail, + UpdateToolTemplateDtoDetails_Function, + UpdateToolTemplateDtoDetails_Ghl, + UpdateToolTemplateDtoDetails_Make, + UpdateToolTemplateDtoDetails_TransferCall, +] diff --git a/src/vapi/types/update_tool_template_dto_provider.py b/src/vapi/types/update_tool_template_dto_provider.py new file mode 100644 index 0000000..43477a8 --- /dev/null +++ b/src/vapi/types/update_tool_template_dto_provider.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateToolTemplateDtoProvider = typing.Union[typing.Literal["make", "gohighlevel", "function"], typing.Any] diff --git a/src/vapi/types/update_tool_template_dto_provider_details.py b/src/vapi/types/update_tool_template_dto_provider_details.py new file mode 100644 index 0000000..251509b --- /dev/null +++ b/src/vapi/types/update_tool_template_dto_provider_details.py @@ -0,0 +1,77 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .tool_template_setup import ToolTemplateSetup +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class UpdateToolTemplateDtoProviderDetails_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + template_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateUrl")] = None + setup_instructions: typing_extensions.Annotated[ + typing.Optional[typing.List[ToolTemplateSetup]], FieldMetadata(alias="setupInstructions") + ] = None + scenario_id: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="scenarioId")] = None + scenario_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="scenarioName")] = None + trigger_hook_id: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="triggerHookId")] = None + trigger_hook_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="triggerHookName")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateToolTemplateDtoProviderDetails_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + template_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateUrl")] = None + setup_instructions: typing_extensions.Annotated[ + typing.Optional[typing.List[ToolTemplateSetup]], FieldMetadata(alias="setupInstructions") + ] = None + workflow_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="workflowId")] = None + workflow_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="workflowName")] = None + webhook_hook_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="webhookHookId")] = None + webhook_hook_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="webhookHookName")] = None + location_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="locationId")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class UpdateToolTemplateDtoProviderDetails_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + template_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateUrl")] = None + setup_instructions: typing_extensions.Annotated[ + typing.Optional[typing.List[ToolTemplateSetup]], FieldMetadata(alias="setupInstructions") + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +UpdateToolTemplateDtoProviderDetails = typing.Union[ + UpdateToolTemplateDtoProviderDetails_Make, + UpdateToolTemplateDtoProviderDetails_Ghl, + UpdateToolTemplateDtoProviderDetails_Function, +] diff --git a/src/vapi/types/update_tool_template_dto_visibility.py b/src/vapi/types/update_tool_template_dto_visibility.py new file mode 100644 index 0000000..29c112d --- /dev/null +++ b/src/vapi/types/update_tool_template_dto_visibility.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateToolTemplateDtoVisibility = typing.Union[typing.Literal["public", "private"], typing.Any] diff --git a/src/vapi/types/update_twilio_credential_dto.py b/src/vapi/types/update_twilio_credential_dto.py new file mode 100644 index 0000000..33095af --- /dev/null +++ b/src/vapi/types/update_twilio_credential_dto.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateTwilioCredentialDto(UniversalBaseModel): + provider: typing.Literal["twilio"] = "twilio" + auth_token: typing_extensions.Annotated[str, FieldMetadata(alias="authToken")] = pydantic.Field() + """ + This is not returned in the API. + """ + + account_sid: typing_extensions.Annotated[str, FieldMetadata(alias="accountSid")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_user_role_dto.py b/src/vapi/types/update_user_role_dto.py new file mode 100644 index 0000000..9d10f70 --- /dev/null +++ b/src/vapi/types/update_user_role_dto.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +from ..core.serialization import FieldMetadata +from .update_user_role_dto_role import UpdateUserRoleDtoRole +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class UpdateUserRoleDto(UniversalBaseModel): + user_id: typing_extensions.Annotated[str, FieldMetadata(alias="userId")] + role: UpdateUserRoleDtoRole + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_user_role_dto_role.py b/src/vapi/types/update_user_role_dto_role.py new file mode 100644 index 0000000..5292b5e --- /dev/null +++ b/src/vapi/types/update_user_role_dto_role.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateUserRoleDtoRole = typing.Union[typing.Literal["admin", "editor", "viewer"], typing.Any] diff --git a/src/vapi/types/update_vonage_credential_dto.py b/src/vapi/types/update_vonage_credential_dto.py new file mode 100644 index 0000000..5d349d2 --- /dev/null +++ b/src/vapi/types/update_vonage_credential_dto.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateVonageCredentialDto(UniversalBaseModel): + provider: typing.Literal["vonage"] = "vonage" + api_secret: typing_extensions.Annotated[str, FieldMetadata(alias="apiSecret")] = pydantic.Field() + """ + This is not returned in the API. + """ + + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/user.py b/src/vapi/types/user.py new file mode 100644 index 0000000..1012611 --- /dev/null +++ b/src/vapi/types/user.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing_extensions +import datetime as dt +from ..core.serialization import FieldMetadata +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class User(UniversalBaseModel): + id: str = pydantic.Field() + """ + This is the unique identifier for the profile or user. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the profile was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the profile was last updated. + """ + + email: str = pydantic.Field() + """ + This is the email of the user that is associated with the profile. + """ + + full_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="fullName")] = pydantic.Field( + default=None + ) + """ + This is the full name of the user that is associated with the profile. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/user_message.py b/src/vapi/types/user_message.py new file mode 100644 index 0000000..9e9630a --- /dev/null +++ b/src/vapi/types/user_message.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UserMessage(UniversalBaseModel): + role: str = pydantic.Field() + """ + The role of the user in the conversation. + """ + + message: str = pydantic.Field() + """ + The message content from the user. + """ + + time: float = pydantic.Field() + """ + The timestamp when the message was sent. + """ + + end_time: typing_extensions.Annotated[float, FieldMetadata(alias="endTime")] = pydantic.Field() + """ + The timestamp when the message ended. + """ + + seconds_from_start: typing_extensions.Annotated[float, FieldMetadata(alias="secondsFromStart")] = pydantic.Field() + """ + The number of seconds from the start of the conversation. + """ + + duration: typing.Optional[float] = pydantic.Field(default=None) + """ + The duration of the message in seconds. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/vapi_cost.py b/src/vapi/types/vapi_cost.py new file mode 100644 index 0000000..3decfe5 --- /dev/null +++ b/src/vapi/types/vapi_cost.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class VapiCost(UniversalBaseModel): + minutes: float = pydantic.Field() + """ + This is the minutes of Vapi usage. This should match `call.endedAt` - `call.startedAt`. + """ + + cost: float = pydantic.Field() + """ + This is the cost of the component in USD. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/vapi_model.py b/src/vapi/types/vapi_model.py new file mode 100644 index 0000000..3a99f1a --- /dev/null +++ b/src/vapi/types/vapi_model.py @@ -0,0 +1,101 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing +from .open_ai_message import OpenAiMessage +import pydantic +from .vapi_model_tools_item import VapiModelToolsItem +import typing_extensions +from ..core.serialization import FieldMetadata +from .vapi_model_steps_item import VapiModelStepsItem +from .knowledge_base import KnowledgeBase +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class VapiModel(UniversalBaseModel): + messages: typing.Optional[typing.List[OpenAiMessage]] = pydantic.Field(default=None) + """ + This is the starting state for the conversation. + """ + + tools: typing.Optional[typing.List[VapiModelToolsItem]] = pydantic.Field(default=None) + """ + These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. + + Both `tools` and `toolIds` can be used together. + """ + + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = ( + pydantic.Field(default=None) + ) + """ + These are the tools that the assistant can use during the call. To use transient tools, use `tools`. + + Both `tools` and `toolIds` can be used together. + """ + + steps: typing.Optional[typing.List[VapiModelStepsItem]] = None + model: str = pydantic.Field() + """ + This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b + """ + + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + """ + + knowledge_base: typing_extensions.Annotated[ + typing.Optional[KnowledgeBase], FieldMetadata(alias="knowledgeBase") + ] = pydantic.Field(default=None) + """ + These are the options for the knowledge base. + """ + + max_tokens: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="maxTokens")] = pydantic.Field( + default=None + ) + """ + This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + """ + + emotion_recognition_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="emotionRecognitionEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether we detect user's emotion while they speak and send it as an additional info to model. + + Default `false` because the model is usually are good at understanding the user's emotion from text. + + @default false + """ + + num_fast_turns: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="numFastTurns")] = ( + pydantic.Field(default=None) + ) + """ + This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + + Default is 0. + + @default 0 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, VapiModel=VapiModel) +update_forward_refs(CreateWorkflowBlockDto, VapiModel=VapiModel) +update_forward_refs(HandoffStep, VapiModel=VapiModel) diff --git a/src/vapi/types/vapi_model_steps_item.py b/src/vapi/types/vapi_model_steps_item.py new file mode 100644 index 0000000..d8724c0 --- /dev/null +++ b/src/vapi/types/vapi_model_steps_item.py @@ -0,0 +1,67 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .step_destination import StepDestination +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .assignment_mutation import AssignmentMutation +from ..core.pydantic_utilities import update_forward_refs + + +class VapiModelStepsItem_Handoff(UniversalBaseModel): + type: typing.Literal["handoff"] = "handoff" + block: typing.Optional["HandoffStepBlock"] = None + destinations: typing.Optional[typing.List[StepDestination]] = None + name: str + block_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="blockId")] = None + input: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .handoff_step_block import HandoffStepBlock # noqa: E402 + + +class VapiModelStepsItem_Callback(UniversalBaseModel): + type: typing.Literal["callback"] = "callback" + block: typing.Optional["CallbackStepBlock"] = None + mutations: typing.Optional[typing.List[AssignmentMutation]] = None + name: str + block_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="blockId")] = None + input: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .callback_step import CallbackStep # noqa: E402 +from .create_workflow_block_dto import CreateWorkflowBlockDto # noqa: E402 +from .handoff_step import HandoffStep # noqa: E402 +from .callback_step_block import CallbackStepBlock # noqa: E402 + +VapiModelStepsItem = typing.Union[VapiModelStepsItem_Handoff, VapiModelStepsItem_Callback] +update_forward_refs(CallbackStep, VapiModelStepsItem_Handoff=VapiModelStepsItem_Handoff) +update_forward_refs(CreateWorkflowBlockDto, VapiModelStepsItem_Handoff=VapiModelStepsItem_Handoff) +update_forward_refs(HandoffStep, VapiModelStepsItem_Handoff=VapiModelStepsItem_Handoff) +update_forward_refs(VapiModelStepsItem_Handoff) +update_forward_refs(CallbackStep, VapiModelStepsItem_Callback=VapiModelStepsItem_Callback) +update_forward_refs(CreateWorkflowBlockDto, VapiModelStepsItem_Callback=VapiModelStepsItem_Callback) +update_forward_refs(HandoffStep, VapiModelStepsItem_Callback=VapiModelStepsItem_Callback) +update_forward_refs(VapiModelStepsItem_Callback) diff --git a/src/vapi/types/vapi_model_tools_item.py b/src/vapi/types/vapi_model_tools_item.py new file mode 100644 index 0000000..358fb83 --- /dev/null +++ b/src/vapi/types/vapi_model_tools_item.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem +from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem +from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem +from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem +from .ghl_tool_metadata import GhlToolMetadata +from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem +from .make_tool_metadata import MakeToolMetadata +from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem +from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + + +class VapiModelToolsItem_Dtmf(UniversalBaseModel): + type: typing.Literal["dtmf"] = "dtmf" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateDtmfToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class VapiModelToolsItem_EndCall(UniversalBaseModel): + type: typing.Literal["endCall"] = "endCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateEndCallToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class VapiModelToolsItem_Voicemail(UniversalBaseModel): + type: typing.Literal["voicemail"] = "voicemail" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateVoicemailToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class VapiModelToolsItem_Function(UniversalBaseModel): + type: typing.Literal["function"] = "function" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateFunctionToolDtoMessagesItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class VapiModelToolsItem_Ghl(UniversalBaseModel): + type: typing.Literal["ghl"] = "ghl" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateGhlToolDtoMessagesItem]] = None + metadata: GhlToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class VapiModelToolsItem_Make(UniversalBaseModel): + type: typing.Literal["make"] = "make" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateMakeToolDtoMessagesItem]] = None + metadata: MakeToolMetadata + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class VapiModelToolsItem_TransferCall(UniversalBaseModel): + type: typing.Literal["transferCall"] = "transferCall" + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = None + messages: typing.Optional[typing.List[CreateTransferCallToolDtoMessagesItem]] = None + destinations: typing.Optional[typing.List[CreateTransferCallToolDtoDestinationsItem]] = None + function: typing.Optional[OpenAiFunction] = None + server: typing.Optional[Server] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +VapiModelToolsItem = typing.Union[ + VapiModelToolsItem_Dtmf, + VapiModelToolsItem_EndCall, + VapiModelToolsItem_Voicemail, + VapiModelToolsItem_Function, + VapiModelToolsItem_Ghl, + VapiModelToolsItem_Make, + VapiModelToolsItem_TransferCall, +] diff --git a/src/vapi/types/vapi_phone_number.py b/src/vapi/types/vapi_phone_number.py new file mode 100644 index 0000000..bef57a1 --- /dev/null +++ b/src/vapi/types/vapi_phone_number.py @@ -0,0 +1,104 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .vapi_phone_number_fallback_destination import VapiPhoneNumberFallbackDestination +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class VapiPhoneNumber(UniversalBaseModel): + fallback_destination: typing_extensions.Annotated[ + typing.Optional[VapiPhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = pydantic.Field(default=None) + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the phone number. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this phone number belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the phone number was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the phone number was last updated. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the phone number. This is just for your own reference. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] = pydantic.Field() + """ + This is the SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer. + + This is case-insensitive. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/vapi_phone_number_fallback_destination.py b/src/vapi/types/vapi_phone_number_fallback_destination.py new file mode 100644 index 0000000..30d4a56 --- /dev/null +++ b/src/vapi/types/vapi_phone_number_fallback_destination.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class VapiPhoneNumberFallbackDestination_Number(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class VapiPhoneNumberFallbackDestination_Sip(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +VapiPhoneNumberFallbackDestination = typing.Union[ + VapiPhoneNumberFallbackDestination_Number, VapiPhoneNumberFallbackDestination_Sip +] diff --git a/src/vapi/types/voice_cost.py b/src/vapi/types/voice_cost.py new file mode 100644 index 0000000..c0650ac --- /dev/null +++ b/src/vapi/types/voice_cost.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class VoiceCost(UniversalBaseModel): + voice: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() + """ + This is the voice that was used during the call. + + This matches one of the following: + + - `call.assistant.voice`, + - `call.assistantId->voice`, + - `call.squad[n].assistant.voice`, + - `call.squad[n].assistantId->voice`, + - `call.squadId->[n].assistant.voice`, + - `call.squadId->[n].assistantId->voice`. + """ + + characters: float = pydantic.Field() + """ + This is the number of characters that were generated during the call. These should be total characters used in the call for single assistant calls, while squad calls will have multiple voice costs one for each assistant that was used. + """ + + cost: float = pydantic.Field() + """ + This is the cost of the component in USD. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/voice_library.py b/src/vapi/types/voice_library.py new file mode 100644 index 0000000..f033796 --- /dev/null +++ b/src/vapi/types/voice_library.py @@ -0,0 +1,126 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ..core.serialization import FieldMetadata +from .voice_library_gender import VoiceLibraryGender +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class VoiceLibrary(UniversalBaseModel): + provider: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + This is the voice provider that will be used. + """ + + provider_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="providerId")] = pydantic.Field( + default=None + ) + """ + The ID of the voice provided by the provider. + """ + + slug: typing.Optional[str] = pydantic.Field(default=None) + """ + The unique slug of the voice. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The name of the voice. + """ + + language: typing.Optional[str] = pydantic.Field(default=None) + """ + The language of the voice. + """ + + language_code: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="languageCode")] = ( + pydantic.Field(default=None) + ) + """ + The language code of the voice. + """ + + model: typing.Optional[str] = pydantic.Field(default=None) + """ + The model of the voice. + """ + + supported_models: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="supportedModels")] = ( + pydantic.Field(default=None) + ) + """ + The supported models of the voice. + """ + + gender: typing.Optional[VoiceLibraryGender] = pydantic.Field(default=None) + """ + The gender of the voice. + """ + + accent: typing.Optional[str] = pydantic.Field(default=None) + """ + The accent of the voice. + """ + + preview_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="previewUrl")] = pydantic.Field( + default=None + ) + """ + The preview URL of the voice. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + The description of the voice. + """ + + credential_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="credentialId")] = ( + pydantic.Field(default=None) + ) + """ + The credential ID of the voice. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the voice library. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + The unique identifier for the organization that this voice library belongs to. + """ + + is_public: typing_extensions.Annotated[bool, FieldMetadata(alias="isPublic")] = pydantic.Field() + """ + The Public voice is shared accross all the organizations. + """ + + is_deleted: typing_extensions.Annotated[bool, FieldMetadata(alias="isDeleted")] = pydantic.Field() + """ + The deletion status of the voice. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + The ISO 8601 date-time string of when the voice library was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + The ISO 8601 date-time string of when the voice library was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/voice_library_gender.py b/src/vapi/types/voice_library_gender.py new file mode 100644 index 0000000..014b4ab --- /dev/null +++ b/src/vapi/types/voice_library_gender.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +VoiceLibraryGender = typing.Union[typing.Literal["male", "female"], typing.Any] diff --git a/src/vapi/types/voice_library_voice_response.py b/src/vapi/types/voice_library_voice_response.py new file mode 100644 index 0000000..4271b26 --- /dev/null +++ b/src/vapi/types/voice_library_voice_response.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +from ..core.serialization import FieldMetadata +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class VoiceLibraryVoiceResponse(UniversalBaseModel): + voice_id: typing_extensions.Annotated[str, FieldMetadata(alias="voiceId")] + name: str + public_owner_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="publicOwnerId")] = None + description: typing.Optional[str] = None + gender: typing.Optional[str] = None + age: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + accent: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/vonage_credential.py b/src/vapi/types/vonage_credential.py new file mode 100644 index 0000000..efb8d55 --- /dev/null +++ b/src/vapi/types/vonage_credential.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +from ..core.serialization import FieldMetadata +import pydantic +import typing +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class VonageCredential(UniversalBaseModel): + vonage_application_private_key: typing_extensions.Annotated[ + str, FieldMetadata(alias="vonageApplicationPrivateKey") + ] = pydantic.Field() + """ + This is not returned in the API. + """ + + provider: typing.Literal["vonage"] = "vonage" + api_secret: typing_extensions.Annotated[str, FieldMetadata(alias="apiSecret")] = pydantic.Field() + """ + This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + vonage_application_id: typing_extensions.Annotated[str, FieldMetadata(alias="vonageApplicationId")] = ( + pydantic.Field() + ) + """ + This is the Vonage Application ID for the credential. + + Only relevant for Vonage credentials. + """ + + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/vonage_phone_number.py b/src/vapi/types/vonage_phone_number.py new file mode 100644 index 0000000..add98bf --- /dev/null +++ b/src/vapi/types/vonage_phone_number.py @@ -0,0 +1,107 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .vonage_phone_number_fallback_destination import VonagePhoneNumberFallbackDestination +from ..core.serialization import FieldMetadata +import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class VonagePhoneNumber(UniversalBaseModel): + fallback_destination: typing_extensions.Annotated[ + typing.Optional[VonagePhoneNumberFallbackDestination], FieldMetadata(alias="fallbackDestination") + ] = pydantic.Field(default=None) + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the phone number. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this phone number belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the phone number was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the phone number was last updated. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the phone number. This is just for your own reference. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( + default=None + ) + """ + This is the squad that will be used for incoming calls to this phone number. + + If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + """ + + server_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrl")] = pydantic.Field( + default=None + ) + """ + This is the server URL where messages will be sent for calls on this number. This includes the `assistant-request` message. + + You can see the shape of the messages sent in `ServerMessage`. + + This overrides the `org.serverUrl`. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl. + """ + + server_url_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serverUrlSecret")] = ( + pydantic.Field(default=None) + ) + """ + This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret. + + Same precedence logic as serverUrl. + """ + + number: str = pydantic.Field() + """ + These are the digits of the phone number you own on your Vonage. + """ + + credential_id: typing_extensions.Annotated[str, FieldMetadata(alias="credentialId")] = pydantic.Field() + """ + This is the credential that is used to make outgoing calls, and do operations like call transfer and hang up. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/vonage_phone_number_fallback_destination.py b/src/vapi/types/vonage_phone_number_fallback_destination.py new file mode 100644 index 0000000..ed6a6d8 --- /dev/null +++ b/src/vapi/types/vonage_phone_number_fallback_destination.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class VonagePhoneNumberFallbackDestination_Number(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["number"] = "number" + number_e_164_check_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="numberE164CheckEnabled") + ] = None + number: str + extension: typing.Optional[str] = None + caller_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callerId")] = None + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class VonagePhoneNumberFallbackDestination_Sip(UniversalBaseModel): + """ + This is the fallback destination an inbound call will be transferred to if: + + 1. `assistantId` is not set + 2. `squadId` is not set + 3. and, `assistant-request` message to the `serverUrl` fails + + If this is not set and above conditions are met, the inbound call is hung up with an error message. + """ + + type: typing.Literal["sip"] = "sip" + sip_uri: typing_extensions.Annotated[str, FieldMetadata(alias="sipUri")] + message: typing.Optional[str] = None + description: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +VonagePhoneNumberFallbackDestination = typing.Union[ + VonagePhoneNumberFallbackDestination_Number, VonagePhoneNumberFallbackDestination_Sip +] diff --git a/src/vapi/types/workflow_block.py b/src/vapi/types/workflow_block.py new file mode 100644 index 0000000..a8971e0 --- /dev/null +++ b/src/vapi/types/workflow_block.py @@ -0,0 +1,98 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +from .callback_step import CallbackStep +from .create_workflow_block_dto import CreateWorkflowBlockDto +from .handoff_step import HandoffStep +import typing +from .workflow_block_messages_item import WorkflowBlockMessagesItem +import pydantic +import typing_extensions +from .json_schema import JsonSchema +from ..core.serialization import FieldMetadata +from .workflow_block_steps_item import WorkflowBlockStepsItem +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import update_forward_refs + + +class WorkflowBlock(UniversalBaseModel): + messages: typing.Optional[typing.List[WorkflowBlockMessagesItem]] = pydantic.Field(default=None) + """ + These are the pre-configured messages that will be spoken to the user while the block is running. + """ + + input_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="inputSchema")] = ( + pydantic.Field(default=None) + ) + """ + This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` + + These are accessible as variables: + + - ({{input.propertyName}}) in context of the block execution (step) + - ({{stepName.input.propertyName}}) in context of the workflow + """ + + output_schema: typing_extensions.Annotated[typing.Optional[JsonSchema], FieldMetadata(alias="outputSchema")] = ( + pydantic.Field(default=None) + ) + """ + This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). + + These are accessible as variables: + + - ({{output.propertyName}}) in context of the block execution (step) + - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) + - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) + + Caveats: + + 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. + 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. + """ + + steps: typing.Optional[typing.List[WorkflowBlockStepsItem]] = pydantic.Field(default=None) + """ + These are the steps in the workflow. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the block. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the organization that this block belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the block was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the block was last updated. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the block. This is just for your reference. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +update_forward_refs(CallbackStep, WorkflowBlock=WorkflowBlock) +update_forward_refs(CreateWorkflowBlockDto, WorkflowBlock=WorkflowBlock) +update_forward_refs(HandoffStep, WorkflowBlock=WorkflowBlock) diff --git a/src/vapi/types/workflow_block_messages_item.py b/src/vapi/types/workflow_block_messages_item.py new file mode 100644 index 0000000..7d9036d --- /dev/null +++ b/src/vapi/types/workflow_block_messages_item.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .block_start_message_conditions_item import BlockStartMessageConditionsItem +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .block_complete_message_conditions_item import BlockCompleteMessageConditionsItem + + +class WorkflowBlockMessagesItem_BlockStart(UniversalBaseModel): + type: typing.Literal["block-start"] = "block-start" + conditions: typing.Optional[typing.List[BlockStartMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class WorkflowBlockMessagesItem_BlockComplete(UniversalBaseModel): + type: typing.Literal["block-complete"] = "block-complete" + conditions: typing.Optional[typing.List[BlockCompleteMessageConditionsItem]] = None + content: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +WorkflowBlockMessagesItem = typing.Union[WorkflowBlockMessagesItem_BlockStart, WorkflowBlockMessagesItem_BlockComplete] diff --git a/src/vapi/types/workflow_block_steps_item.py b/src/vapi/types/workflow_block_steps_item.py new file mode 100644 index 0000000..da2f867 --- /dev/null +++ b/src/vapi/types/workflow_block_steps_item.py @@ -0,0 +1,67 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .step_destination import StepDestination +import typing_extensions +from ..core.serialization import FieldMetadata +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .assignment_mutation import AssignmentMutation +from ..core.pydantic_utilities import update_forward_refs + + +class WorkflowBlockStepsItem_Handoff(UniversalBaseModel): + type: typing.Literal["handoff"] = "handoff" + block: typing.Optional["HandoffStepBlock"] = None + destinations: typing.Optional[typing.List[StepDestination]] = None + name: str + block_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="blockId")] = None + input: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .handoff_step_block import HandoffStepBlock # noqa: E402 + + +class WorkflowBlockStepsItem_Callback(UniversalBaseModel): + type: typing.Literal["callback"] = "callback" + block: typing.Optional["CallbackStepBlock"] = None + mutations: typing.Optional[typing.List[AssignmentMutation]] = None + name: str + block_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="blockId")] = None + input: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .callback_step import CallbackStep # noqa: E402 +from .create_workflow_block_dto import CreateWorkflowBlockDto # noqa: E402 +from .handoff_step import HandoffStep # noqa: E402 +from .callback_step_block import CallbackStepBlock # noqa: E402 + +WorkflowBlockStepsItem = typing.Union[WorkflowBlockStepsItem_Handoff, WorkflowBlockStepsItem_Callback] +update_forward_refs(CallbackStep, WorkflowBlockStepsItem_Handoff=WorkflowBlockStepsItem_Handoff) +update_forward_refs(CreateWorkflowBlockDto, WorkflowBlockStepsItem_Handoff=WorkflowBlockStepsItem_Handoff) +update_forward_refs(HandoffStep, WorkflowBlockStepsItem_Handoff=WorkflowBlockStepsItem_Handoff) +update_forward_refs(WorkflowBlockStepsItem_Handoff) +update_forward_refs(CallbackStep, WorkflowBlockStepsItem_Callback=WorkflowBlockStepsItem_Callback) +update_forward_refs(CreateWorkflowBlockDto, WorkflowBlockStepsItem_Callback=WorkflowBlockStepsItem_Callback) +update_forward_refs(HandoffStep, WorkflowBlockStepsItem_Callback=WorkflowBlockStepsItem_Callback) +update_forward_refs(WorkflowBlockStepsItem_Callback) diff --git a/src/vapi/version.py b/src/vapi/version.py new file mode 100644 index 0000000..7b589df --- /dev/null +++ b/src/vapi/version.py @@ -0,0 +1,3 @@ +from importlib import metadata + +__version__ = metadata.version("Vapi") diff --git a/tests/custom/test_client.py b/tests/custom/test_client.py new file mode 100644 index 0000000..73f811f --- /dev/null +++ b/tests/custom/test_client.py @@ -0,0 +1,7 @@ +import pytest + + +# Get started with writing tests with pytest at https://docs.pytest.org +@pytest.mark.skip(reason="Unimplemented") +def test_client() -> None: + assert True == True diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py new file mode 100644 index 0000000..f3ea265 --- /dev/null +++ b/tests/utils/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/tests/utils/assets/models/__init__.py b/tests/utils/assets/models/__init__.py new file mode 100644 index 0000000..3a1c852 --- /dev/null +++ b/tests/utils/assets/models/__init__.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +from .circle import CircleParams +from .object_with_defaults import ObjectWithDefaultsParams +from .object_with_optional_field import ObjectWithOptionalFieldParams +from .shape import ShapeParams, Shape_CircleParams, Shape_SquareParams +from .square import SquareParams +from .undiscriminated_shape import UndiscriminatedShapeParams + +__all__ = [ + "CircleParams", + "ObjectWithDefaultsParams", + "ObjectWithOptionalFieldParams", + "ShapeParams", + "Shape_CircleParams", + "Shape_SquareParams", + "SquareParams", + "UndiscriminatedShapeParams", +] diff --git a/tests/utils/assets/models/circle.py b/tests/utils/assets/models/circle.py new file mode 100644 index 0000000..b664b08 --- /dev/null +++ b/tests/utils/assets/models/circle.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +import typing_extensions +from vapi.core.serialization import FieldMetadata + + +class CircleParams(typing_extensions.TypedDict): + radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] diff --git a/tests/utils/assets/models/color.py b/tests/utils/assets/models/color.py new file mode 100644 index 0000000..2aa2c4c --- /dev/null +++ b/tests/utils/assets/models/color.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing + +Color = typing.Union[typing.Literal["red", "blue"], typing.Any] diff --git a/tests/utils/assets/models/object_with_defaults.py b/tests/utils/assets/models/object_with_defaults.py new file mode 100644 index 0000000..ef14f7b --- /dev/null +++ b/tests/utils/assets/models/object_with_defaults.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +import typing_extensions + + +class ObjectWithDefaultsParams(typing_extensions.TypedDict): + """ + Defines properties with default values and validation rules. + """ + + decimal: typing_extensions.NotRequired[float] + string: typing_extensions.NotRequired[str] + required_string: str diff --git a/tests/utils/assets/models/object_with_optional_field.py b/tests/utils/assets/models/object_with_optional_field.py new file mode 100644 index 0000000..b374f5b --- /dev/null +++ b/tests/utils/assets/models/object_with_optional_field.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +import typing +import typing_extensions +from vapi.core.serialization import FieldMetadata +import datetime as dt +import uuid +from .color import Color +from .shape import ShapeParams +from .undiscriminated_shape import UndiscriminatedShapeParams + + +class ObjectWithOptionalFieldParams(typing_extensions.TypedDict): + literal: typing.Literal["lit_one"] + string: typing_extensions.NotRequired[str] + integer: typing_extensions.NotRequired[int] + long_: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="long")]] + double: typing_extensions.NotRequired[float] + bool_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="bool")]] + datetime: typing_extensions.NotRequired[dt.datetime] + date: typing_extensions.NotRequired[dt.date] + uuid_: typing_extensions.NotRequired[typing_extensions.Annotated[uuid.UUID, FieldMetadata(alias="uuid")]] + base_64: typing_extensions.NotRequired[typing_extensions.Annotated[str, FieldMetadata(alias="base64")]] + list_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Sequence[str], FieldMetadata(alias="list")]] + set_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Set[str], FieldMetadata(alias="set")]] + map_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Dict[int, str], FieldMetadata(alias="map")]] + enum: typing_extensions.NotRequired[Color] + union: typing_extensions.NotRequired[ShapeParams] + second_union: typing_extensions.NotRequired[ShapeParams] + undiscriminated_union: typing_extensions.NotRequired[UndiscriminatedShapeParams] + any: typing.Optional[typing.Any] diff --git a/tests/utils/assets/models/shape.py b/tests/utils/assets/models/shape.py new file mode 100644 index 0000000..18c9c33 --- /dev/null +++ b/tests/utils/assets/models/shape.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +import typing_extensions +import typing_extensions +import typing +from vapi.core.serialization import FieldMetadata + + +class Base(typing_extensions.TypedDict): + id: str + + +class Shape_CircleParams(Base): + shape_type: typing_extensions.Annotated[typing.Literal["circle"], FieldMetadata(alias="shapeType")] + radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] + + +class Shape_SquareParams(Base): + shape_type: typing_extensions.Annotated[typing.Literal["square"], FieldMetadata(alias="shapeType")] + length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] + + +ShapeParams = typing.Union[Shape_CircleParams, Shape_SquareParams] diff --git a/tests/utils/assets/models/square.py b/tests/utils/assets/models/square.py new file mode 100644 index 0000000..c0e7aac --- /dev/null +++ b/tests/utils/assets/models/square.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +import typing_extensions +from vapi.core.serialization import FieldMetadata + + +class SquareParams(typing_extensions.TypedDict): + length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] diff --git a/tests/utils/assets/models/undiscriminated_shape.py b/tests/utils/assets/models/undiscriminated_shape.py new file mode 100644 index 0000000..68876a2 --- /dev/null +++ b/tests/utils/assets/models/undiscriminated_shape.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing +from .circle import CircleParams +from .square import SquareParams + +UndiscriminatedShapeParams = typing.Union[CircleParams, SquareParams] diff --git a/tests/utils/test_http_client.py b/tests/utils/test_http_client.py new file mode 100644 index 0000000..21cc9d6 --- /dev/null +++ b/tests/utils/test_http_client.py @@ -0,0 +1,61 @@ +# This file was auto-generated by Fern from our API Definition. + +from vapi.core.http_client import get_request_body +from vapi.core.request_options import RequestOptions + + +def get_request_options() -> RequestOptions: + return {"additional_body_parameters": {"see you": "later"}} + + +def test_get_json_request_body() -> None: + json_body, data_body = get_request_body(json={"hello": "world"}, data=None, request_options=None, omit=None) + assert json_body == {"hello": "world"} + assert data_body is None + + json_body_extras, data_body_extras = get_request_body( + json={"goodbye": "world"}, data=None, request_options=get_request_options(), omit=None + ) + + assert json_body_extras == {"goodbye": "world", "see you": "later"} + assert data_body_extras is None + + +def test_get_files_request_body() -> None: + json_body, data_body = get_request_body(json=None, data={"hello": "world"}, request_options=None, omit=None) + assert data_body == {"hello": "world"} + assert json_body is None + + json_body_extras, data_body_extras = get_request_body( + json=None, data={"goodbye": "world"}, request_options=get_request_options(), omit=None + ) + + assert data_body_extras == {"goodbye": "world", "see you": "later"} + assert json_body_extras is None + + +def test_get_none_request_body() -> None: + json_body, data_body = get_request_body(json=None, data=None, request_options=None, omit=None) + assert data_body is None + assert json_body is None + + json_body_extras, data_body_extras = get_request_body( + json=None, data=None, request_options=get_request_options(), omit=None + ) + + assert json_body_extras == {"see you": "later"} + assert data_body_extras is None + + +def test_get_empty_json_request_body() -> None: + unrelated_request_options: RequestOptions = {"max_retries": 3} + json_body, data_body = get_request_body(json=None, data=None, request_options=unrelated_request_options, omit=None) + assert json_body is None + assert data_body is None + + json_body_extras, data_body_extras = get_request_body( + json={}, data=None, request_options=unrelated_request_options, omit=None + ) + + assert json_body_extras is None + assert data_body_extras is None diff --git a/tests/utils/test_query_encoding.py b/tests/utils/test_query_encoding.py new file mode 100644 index 0000000..a78cd5b --- /dev/null +++ b/tests/utils/test_query_encoding.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + + +from vapi.core.query_encoder import encode_query + + +def test_query_encoding_deep_objects() -> None: + assert encode_query({"hello world": "hello world"}) == [("hello world", "hello world")] + assert encode_query({"hello_world": {"hello": "world"}}) == [("hello_world[hello]", "world")] + assert encode_query({"hello_world": {"hello": {"world": "today"}, "test": "this"}, "hi": "there"}) == [ + ("hello_world[hello][world]", "today"), + ("hello_world[test]", "this"), + ("hi", "there"), + ] + + +def test_query_encoding_deep_object_arrays() -> None: + assert encode_query({"objects": [{"key": "hello", "value": "world"}, {"key": "foo", "value": "bar"}]}) == [ + ("objects[key]", "hello"), + ("objects[value]", "world"), + ("objects[key]", "foo"), + ("objects[value]", "bar"), + ] + assert encode_query( + {"users": [{"name": "string", "tags": ["string"]}, {"name": "string2", "tags": ["string2", "string3"]}]} + ) == [ + ("users[name]", "string"), + ("users[tags]", "string"), + ("users[name]", "string2"), + ("users[tags]", "string2"), + ("users[tags]", "string3"), + ] + + +def test_encode_query_with_none() -> None: + encoded = encode_query(None) + assert encoded == None diff --git a/tests/utils/test_serialization.py b/tests/utils/test_serialization.py new file mode 100644 index 0000000..0d1b05d --- /dev/null +++ b/tests/utils/test_serialization.py @@ -0,0 +1,72 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import List, Any + +from vapi.core.serialization import convert_and_respect_annotation_metadata +from .assets.models import ShapeParams, ObjectWithOptionalFieldParams + + +UNION_TEST: ShapeParams = {"radius_measurement": 1.0, "shape_type": "circle", "id": "1"} +UNION_TEST_CONVERTED = {"shapeType": "circle", "radiusMeasurement": 1.0, "id": "1"} + + +def test_convert_and_respect_annotation_metadata() -> None: + data: ObjectWithOptionalFieldParams = { + "string": "string", + "long_": 12345, + "bool_": True, + "literal": "lit_one", + "any": "any", + } + converted = convert_and_respect_annotation_metadata( + object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" + ) + assert converted == {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"} + + +def test_convert_and_respect_annotation_metadata_in_list() -> None: + data: List[ObjectWithOptionalFieldParams] = [ + {"string": "string", "long_": 12345, "bool_": True, "literal": "lit_one", "any": "any"}, + {"string": "another string", "long_": 67890, "list_": [], "literal": "lit_one", "any": "any"}, + ] + converted = convert_and_respect_annotation_metadata( + object_=data, annotation=List[ObjectWithOptionalFieldParams], direction="write" + ) + + assert converted == [ + {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"}, + {"string": "another string", "long": 67890, "list": [], "literal": "lit_one", "any": "any"}, + ] + + +def test_convert_and_respect_annotation_metadata_in_nested_object() -> None: + data: ObjectWithOptionalFieldParams = { + "string": "string", + "long_": 12345, + "union": UNION_TEST, + "literal": "lit_one", + "any": "any", + } + converted = convert_and_respect_annotation_metadata( + object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" + ) + + assert converted == { + "string": "string", + "long": 12345, + "union": UNION_TEST_CONVERTED, + "literal": "lit_one", + "any": "any", + } + + +def test_convert_and_respect_annotation_metadata_in_union() -> None: + converted = convert_and_respect_annotation_metadata(object_=UNION_TEST, annotation=ShapeParams, direction="write") + + assert converted == UNION_TEST_CONVERTED + + +def test_convert_and_respect_annotation_metadata_with_empty_object() -> None: + data: Any = {} + converted = convert_and_respect_annotation_metadata(object_=data, annotation=ShapeParams, direction="write") + assert converted == data