From fec8949571e10b013f403720bb97735078783a44 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 09:22:00 +0000 Subject: [PATCH] SDK regeneration --- .github/workflows/ci.yml | 56 ++++--- .github/workflows/release.yml | 65 --------- README.md | 34 ++--- poetry.lock | 96 ++++++------ pyproject.toml | 2 +- reference.md | 108 ++++++++++++++ src/agora_agent/agents/client.py | 137 +++++++++++++++++- src/agora_agent/agents/raw_client.py | 123 ++++++++++++++++ .../agents/types/get_turns_agents_response.py | 24 +++ .../get_turns_agents_response_turns_item.py | 51 +++++++ ...et_turns_agents_response_turns_item_end.py | 43 ++++++ ...agents_response_turns_item_end_metadata.py | 62 ++++++++ ...rns_agents_response_turns_item_end_type.py | 7 + ...urns_agents_response_turns_item_metrics.py | 41 ++++++ ..._item_metrics_segmented_latency_ms_item.py | 42 ++++++ ..._turns_agents_response_turns_item_start.py | 43 ++++++ ...ents_response_turns_item_start_metadata.py | 51 +++++++ ...s_agents_response_turns_item_start_type.py | 7 + .../types/start_agents_request_properties.py | 2 +- ...ts_request_properties_advanced_features.py | 7 +- .../start_agents_request_properties_avatar.py | 3 +- ...agents_request_properties_avatar_vendor.py | 4 +- .../start_agents_request_properties_mllm.py | 5 +- ...t_agents_request_properties_mllm_vendor.py | 2 +- .../start_agents_request_properties_sal.py | 2 +- ...on_config_end_of_speech_semantic_config.py | 5 +- ..._config_start_of_speech_disabled_config.py | 2 +- ...tart_of_speech_disabled_config_strategy.py | 2 +- src/agora_agent/core/client_wrapper.py | 4 +- src/agora_agent/version.py | 2 +- 30 files changed, 859 insertions(+), 173 deletions(-) delete mode 100644 .github/workflows/release.yml create mode 100644 src/agora_agent/agents/types/get_turns_agents_response.py create mode 100644 src/agora_agent/agents/types/get_turns_agents_response_turns_item.py create mode 100644 src/agora_agent/agents/types/get_turns_agents_response_turns_item_end.py create mode 100644 src/agora_agent/agents/types/get_turns_agents_response_turns_item_end_metadata.py create mode 100644 src/agora_agent/agents/types/get_turns_agents_response_turns_item_end_type.py create mode 100644 src/agora_agent/agents/types/get_turns_agents_response_turns_item_metrics.py create mode 100644 src/agora_agent/agents/types/get_turns_agents_response_turns_item_metrics_segmented_latency_ms_item.py create mode 100644 src/agora_agent/agents/types/get_turns_agents_response_turns_item_start.py create mode 100644 src/agora_agent/agents/types/get_turns_agents_response_turns_item_start_metadata.py create mode 100644 src/agora_agent/agents/types/get_turns_agents_response_turns_item_start_type.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index deb6af7..f46ffcf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,46 +1,60 @@ name: ci - -on: - push: - workflow_dispatch: - +on: [push] jobs: compile: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v6 - + uses: actions/checkout@v4 - name: Set up python - uses: actions/setup-python@v6 + uses: actions/setup-python@v4 with: - python-version: '3.8' - + python-version: 3.8 - name: Bootstrap poetry - run: curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - + 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-latest steps: - name: Checkout repo - uses: actions/checkout@v6 - + uses: actions/checkout@v4 - name: Set up python - uses: actions/setup-python@v6 + uses: actions/setup-python@v4 with: - python-version: '3.8' - + python-version: 3.8 - name: Bootstrap poetry - run: curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - + 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-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - 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/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 9cabaaa..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: release - -on: - push: - tags: - - 'v*' - -jobs: - release: - runs-on: ubuntu-latest - permissions: - contents: write # create GitHub Release - id-token: write # PyPI trusted publishing (OIDC) - steps: - - name: Checkout repo - uses: actions/checkout@v6 - - - name: Set up python - uses: actions/setup-python@v6 - 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 . - - - name: Test - run: poetry run pytest -rP . - - - name: Build - run: poetry build - - - name: Extract changelog notes - id: changelog - run: | - VERSION="${GITHUB_REF_NAME}" - NOTES=$(awk -v ver="## [${VERSION}]" ' - index($0, ver) == 1 { found=1; next } - found && /^## / { exit } - found { print } - ' changelog.md) - echo "notes<> "$GITHUB_OUTPUT" - echo "$NOTES" >> "$GITHUB_OUTPUT" - echo "EOF" >> "$GITHUB_OUTPUT" - - - name: Create GitHub Release - env: - GH_TOKEN: ${{ github.token }} - NOTES: ${{ steps.changelog.outputs.notes }} - run: | - echo "$NOTES" > release_notes.md - gh release create "$GITHUB_REF_NAME" \ - --title "$GITHUB_REF_NAME" \ - --notes-file release_notes.md \ - dist/* - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/README.md b/README.md index e01e338..5a61e85 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# Agora Agent Server SDK for Python +# Agoraio Python Library [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FAgoraIO-Conversational-AI%2Fagent-server-sdk-python) -[![pypi](https://img.shields.io/pypi/v/agent-server-sdk-python)](https://pypi.python.org/pypi/agent-server-sdk-python) +[![pypi](https://img.shields.io/pypi/v/agora-agent-server-sdk)](https://pypi.python.org/pypi/agora-agent-server-sdk) The Agora Conversational AI SDK provides convenient access to the Agora Conversational AI APIs, enabling you to build voice-powered AI agents with support for both cascading flows (ASR -> LLM -> TTS) @@ -30,7 +30,7 @@ and multimodal flows (MLLM) for real-time audio processing. ## Installation ```sh -pip install agent-server-sdk-python +pip install agora-agent-server-sdk ``` ## Quick Start @@ -155,29 +155,26 @@ A full reference for this library is available [here](https://github.com/AgoraIO For real-time audio processing using OpenAI's Realtime API or Google Gemini Live, use the MLLM (Multimodal Large Language Model) flow instead of the cascading ASR -> LLM -> TTS flow. See the [MLLM Overview](https://docs.agora.io/en/conversational-ai/models/mllm/overview) for more details. ```python -from agora_agent import Agora, Area -from agora_agent.agentkit import ( - AdvancedFeatures, - TurnDetectionConfig, - TurnDetectionTypeValues, -) -from agora_agent.agents import ( +from agora-agent-server-sdk import Agora +from agora-agent-server-sdk.agents import ( StartAgentsRequestProperties, + StartAgentsRequestPropertiesAdvancedFeatures, StartAgentsRequestPropertiesMllm, StartAgentsRequestPropertiesMllmVendor, StartAgentsRequestPropertiesTts, StartAgentsRequestPropertiesTtsVendor, StartAgentsRequestPropertiesLlm, + StartAgentsRequestPropertiesTurnDetection, + StartAgentsRequestPropertiesTurnDetectionType, ) client = Agora( - area=Area.US, - app_id="YOUR_APP_ID", - app_certificate="YOUR_APP_CERTIFICATE", + customer_id="YOUR_CUSTOMER_ID", + customer_secret="YOUR_CUSTOMER_SECRET", ) client.agents.start( - client.app_id, + appid="your_app_id", name="mllm_agent", properties=StartAgentsRequestProperties( channel="channel_name", @@ -185,7 +182,9 @@ client.agents.start( agent_rtc_uid="1001", remote_rtc_uids=["1002"], idle_timeout=120, - advanced_features=AdvancedFeatures(enable_mllm=True), + advanced_features=StartAgentsRequestPropertiesAdvancedFeatures( + enable_mllm=True, + ), mllm=StartAgentsRequestPropertiesMllm( url="wss://api.openai.com/v1/realtime", api_key="", @@ -198,8 +197,8 @@ client.agents.start( output_modalities=["text", "audio"], greeting_message="Hello! I'm ready to chat in real-time.", ), - turn_detection=TurnDetectionConfig( - type=TurnDetectionTypeValues.SERVER_VAD, # deprecated; use config.end_of_speech instead + turn_detection=StartAgentsRequestPropertiesTurnDetection( + type=StartAgentsRequestPropertiesTurnDetectionType.SERVER_VAD, threshold=0.5, silence_duration_ms=500, ), @@ -215,6 +214,7 @@ client.agents.start( ) ``` + ## MLLM Flow (Multimodal) For real-time audio processing using OpenAI's Realtime API or Google Gemini Live, use the MLLM (Multimodal Large Language Model) flow instead of the cascading ASR -> LLM -> TTS flow. See the [MLLM Overview](https://docs.agora.io/en/conversational-ai/models/mllm/overview) for more details. diff --git a/poetry.lock b/poetry.lock index 2744b38..5092d3a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -483,58 +483,58 @@ files = [ [[package]] name = "tomli" -version = "2.4.0" +version = "2.4.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" files = [ - {file = "tomli-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867"}, - {file = "tomli-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9"}, - {file = "tomli-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95"}, - {file = "tomli-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76"}, - {file = "tomli-2.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d"}, - {file = "tomli-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576"}, - {file = "tomli-2.4.0-cp311-cp311-win32.whl", hash = "sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a"}, - {file = "tomli-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa"}, - {file = "tomli-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614"}, - {file = "tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1"}, - {file = "tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8"}, - {file = "tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a"}, - {file = "tomli-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c8a885b370751837c029ef9bc014f27d80840e48bac415f3412e6593bbc18c1"}, - {file = "tomli-2.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8768715ffc41f0008abe25d808c20c3d990f42b6e2e58305d5da280ae7d1fa3b"}, - {file = "tomli-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b438885858efd5be02a9a133caf5812b8776ee0c969fea02c45e8e3f296ba51"}, - {file = "tomli-2.4.0-cp312-cp312-win32.whl", hash = "sha256:0408e3de5ec77cc7f81960c362543cbbd91ef883e3138e81b729fc3eea5b9729"}, - {file = "tomli-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:685306e2cc7da35be4ee914fd34ab801a6acacb061b6a7abca922aaf9ad368da"}, - {file = "tomli-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:5aa48d7c2356055feef06a43611fc401a07337d5b006be13a30f6c58f869e3c3"}, - {file = "tomli-2.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84d081fbc252d1b6a982e1870660e7330fb8f90f676f6e78b052ad4e64714bf0"}, - {file = "tomli-2.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9a08144fa4cba33db5255f9b74f0b89888622109bd2776148f2597447f92a94e"}, - {file = "tomli-2.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c73add4bb52a206fd0c0723432db123c0c75c280cbd67174dd9d2db228ebb1b4"}, - {file = "tomli-2.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fb2945cbe303b1419e2706e711b7113da57b7db31ee378d08712d678a34e51e"}, - {file = "tomli-2.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bbb1b10aa643d973366dc2cb1ad94f99c1726a02343d43cbc011edbfac579e7c"}, - {file = "tomli-2.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4cbcb367d44a1f0c2be408758b43e1ffb5308abe0ea222897d6bfc8e8281ef2f"}, - {file = "tomli-2.4.0-cp313-cp313-win32.whl", hash = "sha256:7d49c66a7d5e56ac959cb6fc583aff0651094ec071ba9ad43df785abc2320d86"}, - {file = "tomli-2.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:3cf226acb51d8f1c394c1b310e0e0e61fecdd7adcb78d01e294ac297dd2e7f87"}, - {file = "tomli-2.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:d20b797a5c1ad80c516e41bc1fb0443ddb5006e9aaa7bda2d71978346aeb9132"}, - {file = "tomli-2.4.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:26ab906a1eb794cd4e103691daa23d95c6919cc2fa9160000ac02370cc9dd3f6"}, - {file = "tomli-2.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:20cedb4ee43278bc4f2fee6cb50daec836959aadaf948db5172e776dd3d993fc"}, - {file = "tomli-2.4.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:39b0b5d1b6dd03684b3fb276407ebed7090bbec989fa55838c98560c01113b66"}, - {file = "tomli-2.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a26d7ff68dfdb9f87a016ecfd1e1c2bacbe3108f4e0f8bcd2228ef9a766c787d"}, - {file = "tomli-2.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:20ffd184fb1df76a66e34bd1b36b4a4641bd2b82954befa32fe8163e79f1a702"}, - {file = "tomli-2.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:75c2f8bbddf170e8effc98f5e9084a8751f8174ea6ccf4fca5398436e0320bc8"}, - {file = "tomli-2.4.0-cp314-cp314-win32.whl", hash = "sha256:31d556d079d72db7c584c0627ff3a24c5d3fb4f730221d3444f3efb1b2514776"}, - {file = "tomli-2.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:43e685b9b2341681907759cf3a04e14d7104b3580f808cfde1dfdb60ada85475"}, - {file = "tomli-2.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:3d895d56bd3f82ddd6faaff993c275efc2ff38e52322ea264122d72729dca2b2"}, - {file = "tomli-2.4.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:5b5807f3999fb66776dbce568cc9a828544244a8eb84b84b9bafc080c99597b9"}, - {file = "tomli-2.4.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c084ad935abe686bd9c898e62a02a19abfc9760b5a79bc29644463eaf2840cb0"}, - {file = "tomli-2.4.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f2e3955efea4d1cfbcb87bc321e00dc08d2bcb737fd1d5e398af111d86db5df"}, - {file = "tomli-2.4.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e0fe8a0b8312acf3a88077a0802565cb09ee34107813bba1c7cd591fa6cfc8d"}, - {file = "tomli-2.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:413540dce94673591859c4c6f794dfeaa845e98bf35d72ed59636f869ef9f86f"}, - {file = "tomli-2.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0dc56fef0e2c1c470aeac5b6ca8cc7b640bb93e92d9803ddaf9ea03e198f5b0b"}, - {file = "tomli-2.4.0-cp314-cp314t-win32.whl", hash = "sha256:d878f2a6707cc9d53a1be1414bbb419e629c3d6e67f69230217bb663e76b5087"}, - {file = "tomli-2.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2add28aacc7425117ff6364fe9e06a183bb0251b03f986df0e78e974047571fd"}, - {file = "tomli-2.4.0-cp314-cp314t-win_arm64.whl", hash = "sha256:2b1e3b80e1d5e52e40e9b924ec43d81570f0e7d09d11081b797bc4692765a3d4"}, - {file = "tomli-2.4.0-py3-none-any.whl", hash = "sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a"}, - {file = "tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c"}, + {file = "tomli-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f8f0fc26ec2cc2b965b7a3b87cd19c5c6b8c5e5f436b984e85f486d652285c30"}, + {file = "tomli-2.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4ab97e64ccda8756376892c53a72bd1f964e519c77236368527f758fbc36a53a"}, + {file = "tomli-2.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96481a5786729fd470164b47cdb3e0e58062a496f455ee41b4403be77cb5a076"}, + {file = "tomli-2.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a881ab208c0baf688221f8cecc5401bd291d67e38a1ac884d6736cbcd8247e9"}, + {file = "tomli-2.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:47149d5bd38761ac8be13a84864bf0b7b70bc051806bc3669ab1cbc56216b23c"}, + {file = "tomli-2.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ec9bfaf3ad2df51ace80688143a6a4ebc09a248f6ff781a9945e51937008fcbc"}, + {file = "tomli-2.4.1-cp311-cp311-win32.whl", hash = "sha256:ff2983983d34813c1aeb0fa89091e76c3a22889ee83ab27c5eeb45100560c049"}, + {file = "tomli-2.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:5ee18d9ebdb417e384b58fe414e8d6af9f4e7a0ae761519fb50f721de398dd4e"}, + {file = "tomli-2.4.1-cp311-cp311-win_arm64.whl", hash = "sha256:c2541745709bad0264b7d4705ad453b76ccd191e64aa6f0fc66b69a293a45ece"}, + {file = "tomli-2.4.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c742f741d58a28940ce01d58f0ab2ea3ced8b12402f162f4d534dfe18ba1cd6a"}, + {file = "tomli-2.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7f86fd587c4ed9dd76f318225e7d9b29cfc5a9d43de44e5754db8d1128487085"}, + {file = "tomli-2.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ff18e6a727ee0ab0388507b89d1bc6a22b138d1e2fa56d1ad494586d61d2eae9"}, + {file = "tomli-2.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:136443dbd7e1dee43c68ac2694fde36b2849865fa258d39bf822c10e8068eac5"}, + {file = "tomli-2.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5e262d41726bc187e69af7825504c933b6794dc3fbd5945e41a79bb14c31f585"}, + {file = "tomli-2.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5cb41aa38891e073ee49d55fbc7839cfdb2bc0e600add13874d048c94aadddd1"}, + {file = "tomli-2.4.1-cp312-cp312-win32.whl", hash = "sha256:da25dc3563bff5965356133435b757a795a17b17d01dbc0f42fb32447ddfd917"}, + {file = "tomli-2.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:52c8ef851d9a240f11a88c003eacb03c31fc1c9c4ec64a99a0f922b93874fda9"}, + {file = "tomli-2.4.1-cp312-cp312-win_arm64.whl", hash = "sha256:f758f1b9299d059cc3f6546ae2af89670cb1c4d48ea29c3cacc4fe7de3058257"}, + {file = "tomli-2.4.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:36d2bd2ad5fb9eaddba5226aa02c8ec3fa4f192631e347b3ed28186d43be6b54"}, + {file = "tomli-2.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:eb0dc4e38e6a1fd579e5d50369aa2e10acfc9cace504579b2faabb478e76941a"}, + {file = "tomli-2.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c7f2c7f2b9ca6bdeef8f0fa897f8e05085923eb091721675170254cbc5b02897"}, + {file = "tomli-2.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f3c6818a1a86dd6dca7ddcaaf76947d5ba31aecc28cb1b67009a5877c9a64f3f"}, + {file = "tomli-2.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:d312ef37c91508b0ab2cee7da26ec0b3ed2f03ce12bd87a588d771ae15dcf82d"}, + {file = "tomli-2.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:51529d40e3ca50046d7606fa99ce3956a617f9b36380da3b7f0dd3dd28e68cb5"}, + {file = "tomli-2.4.1-cp313-cp313-win32.whl", hash = "sha256:2190f2e9dd7508d2a90ded5ed369255980a1bcdd58e52f7fe24b8162bf9fedbd"}, + {file = "tomli-2.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:8d65a2fbf9d2f8352685bc1364177ee3923d6baf5e7f43ea4959d7d8bc326a36"}, + {file = "tomli-2.4.1-cp313-cp313-win_arm64.whl", hash = "sha256:4b605484e43cdc43f0954ddae319fb75f04cc10dd80d830540060ee7cd0243cd"}, + {file = "tomli-2.4.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:fd0409a3653af6c147209d267a0e4243f0ae46b011aa978b1080359fddc9b6cf"}, + {file = "tomli-2.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a120733b01c45e9a0c34aeef92bf0cf1d56cfe81ed9d47d562f9ed591a9828ac"}, + {file = "tomli-2.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:559db847dc486944896521f68d8190be1c9e719fced785720d2216fe7022b662"}, + {file = "tomli-2.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:01f520d4f53ef97964a240a035ec2a869fe1a37dde002b57ebc4417a27ccd853"}, + {file = "tomli-2.4.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7f94b27a62cfad8496c8d2513e1a222dd446f095fca8987fceef261225538a15"}, + {file = "tomli-2.4.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ede3e6487c5ef5d28634ba3f31f989030ad6af71edfb0055cbbd14189ff240ba"}, + {file = "tomli-2.4.1-cp314-cp314-win32.whl", hash = "sha256:3d48a93ee1c9b79c04bb38772ee1b64dcf18ff43085896ea460ca8dec96f35f6"}, + {file = "tomli-2.4.1-cp314-cp314-win_amd64.whl", hash = "sha256:88dceee75c2c63af144e456745e10101eb67361050196b0b6af5d717254dddf7"}, + {file = "tomli-2.4.1-cp314-cp314-win_arm64.whl", hash = "sha256:b8c198f8c1805dc42708689ed6864951fd2494f924149d3e4bce7710f8eb5232"}, + {file = "tomli-2.4.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:d4d8fe59808a54658fcc0160ecfb1b30f9089906c50b23bcb4c69eddc19ec2b4"}, + {file = "tomli-2.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7008df2e7655c495dd12d2a4ad038ff878d4ca4b81fccaf82b714e07eae4402c"}, + {file = "tomli-2.4.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1d8591993e228b0c930c4bb0db464bdad97b3289fb981255d6c9a41aedc84b2d"}, + {file = "tomli-2.4.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:734e20b57ba95624ecf1841e72b53f6e186355e216e5412de414e3c51e5e3c41"}, + {file = "tomli-2.4.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8a650c2dbafa08d42e51ba0b62740dae4ecb9338eefa093aa5c78ceb546fcd5c"}, + {file = "tomli-2.4.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:504aa796fe0569bb43171066009ead363de03675276d2d121ac1a4572397870f"}, + {file = "tomli-2.4.1-cp314-cp314t-win32.whl", hash = "sha256:b1d22e6e9387bf4739fbe23bfa80e93f6b0373a7f1b96c6227c32bef95a4d7a8"}, + {file = "tomli-2.4.1-cp314-cp314t-win_amd64.whl", hash = "sha256:2c1c351919aca02858f740c6d33adea0c5deea37f9ecca1cc1ef9e884a619d26"}, + {file = "tomli-2.4.1-cp314-cp314t-win_arm64.whl", hash = "sha256:eab21f45c7f66c13f2a9e0e1535309cee140182a9cdae1e041d02e47291e8396"}, + {file = "tomli-2.4.1-py3-none-any.whl", hash = "sha256:0d85819802132122da43cb86656f8d1f8c6587d54ae7dcaf30e90533028b49fe"}, + {file = "tomli-2.4.1.tar.gz", hash = "sha256:7c7e1a961a0b2f2472c1ac5b69affa0ae1132c39adcb67aba98568702b9cc23f"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index ef55276..b2149d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "agora-agent-server-sdk" [tool.poetry] name = "agora-agent-server-sdk" -version = "1.2.0" +version = "1.3.0" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index b631050..43c3768 100644 --- a/reference.md +++ b/reference.md @@ -110,6 +110,29 @@ client.agents.start(
+**preset:** `typing.Optional[str]` + +A comma-separated string of one or more presets. Each preset provides a predefined configuration for ASR, LLM, and TTS. You can specify a preset for any or all of ASR, LLM, and TTS. When a preset is specified, you do not need to provide the endpoint URL, API key, or model for the preset providers. Use the `asr`, `llm`, and `tts` fields to configure additional settings. + +Available presets: +- ASR: `deepgram_nova_2`, `deepgram_nova_3` +- LLM: `openai_gpt_4o_mini`, `openai_gpt_4_1_mini`, `openai_gpt_5_nano`, `openai_gpt_5_mini` +- TTS: `minimax_speech_2_6_turbo`, `minimax_speech_2_8_turbo`, `openai_tts_1` + +
+
+ +
+
+ +**pipeline_id:** `typing.Optional[str]` — The unique ID of a published agent in AI Studio. When provided, the saved agent configuration is used as the base configuration. Any fields specified in `properties` override the corresponding agent settings. When you specify a `pipeline_id`, the `asr`, `tts`, and `llm` fields in `properties` are optional. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -416,6 +439,91 @@ client.agents.get_history(
+ + + + +
client.agents.get_turns(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Query conversation turn information for a conversational AI agent session. + +After a conversation with the agent ends, use this endpoint to query the conversation turn information, including the start information, end information, and performance metrics of each conversation turn. + +You can query sessions within the last 7 days. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from agora_agent import Agora + +client = Agora( + authorization="YOUR_AUTHORIZATION", + username="YOUR_USERNAME", + password="YOUR_PASSWORD", +) +client.agents.get_turns( + appid="appid", + agent_id="agentId", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**appid:** `str` — The App ID of the project. + +
+
+ +
+
+ +**agent_id:** `str` — The agent instance ID you obtained after successfully calling `join` to start a conversational AI agent. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
diff --git a/src/agora_agent/agents/client.py b/src/agora_agent/agents/client.py index bc22d06..6c4a48c 100644 --- a/src/agora_agent/agents/client.py +++ b/src/agora_agent/agents/client.py @@ -8,6 +8,7 @@ from .raw_client import AsyncRawAgentsClient, RawAgentsClient from .types.get_agents_response import GetAgentsResponse from .types.get_history_agents_response import GetHistoryAgentsResponse +from .types.get_turns_agents_response import GetTurnsAgentsResponse from .types.interrupt_agents_response import InterruptAgentsResponse from .types.list_agents_request_state import ListAgentsRequestState from .types.list_agents_response import ListAgentsResponse @@ -44,6 +45,8 @@ def start( *, name: str, properties: StartAgentsRequestProperties, + preset: typing.Optional[str] = OMIT, + pipeline_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> StartAgentsResponse: """ @@ -60,6 +63,17 @@ def start( properties : StartAgentsRequestProperties Configuration details of the agent. + preset : typing.Optional[str] + A comma-separated string of one or more presets. Each preset provides a predefined configuration for ASR, LLM, and TTS. You can specify a preset for any or all of ASR, LLM, and TTS. When a preset is specified, you do not need to provide the endpoint URL, API key, or model for the preset providers. Use the `asr`, `llm`, and `tts` fields to configure additional settings. + + Available presets: + - ASR: `deepgram_nova_2`, `deepgram_nova_3` + - LLM: `openai_gpt_4o_mini`, `openai_gpt_4_1_mini`, `openai_gpt_5_nano`, `openai_gpt_5_mini` + - TTS: `minimax_speech_2_6_turbo`, `minimax_speech_2_8_turbo`, `openai_tts_1` + + pipeline_id : typing.Optional[str] + The unique ID of a published agent in AI Studio. When provided, the saved agent configuration is used as the base configuration. Any fields specified in `properties` override the corresponding agent settings. When you specify a `pipeline_id`, the `asr`, `tts`, and `llm` fields in `properties` are optional. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -115,7 +129,14 @@ def start( ), ) """ - _response = self._raw_client.start(appid, name=name, properties=properties, request_options=request_options) + _response = self._raw_client.start( + appid, + name=name, + properties=properties, + preset=preset, + pipeline_id=pipeline_id, + request_options=request_options, + ) return _response.data def list( @@ -280,6 +301,49 @@ def get_history( _response = self._raw_client.get_history(appid, agent_id, request_options=request_options) return _response.data + def get_turns( + self, appid: str, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetTurnsAgentsResponse: + """ + Query conversation turn information for a conversational AI agent session. + + After a conversation with the agent ends, use this endpoint to query the conversation turn information, including the start information, end information, and performance metrics of each conversation turn. + + You can query sessions within the last 7 days. + + Parameters + ---------- + appid : str + The App ID of the project. + + agent_id : str + The agent instance ID you obtained after successfully calling `join` to start a conversational AI agent. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetTurnsAgentsResponse + Request was successful. The response body contains the result of the request. + + Examples + -------- + from agora_agent import Agora + + client = Agora( + authorization="YOUR_AUTHORIZATION", + username="YOUR_USERNAME", + password="YOUR_PASSWORD", + ) + client.agents.get_turns( + appid="appid", + agent_id="agentId", + ) + """ + _response = self._raw_client.get_turns(appid, agent_id, request_options=request_options) + return _response.data + def stop(self, appid: str, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Stop the specified conversational agent instance. @@ -513,6 +577,8 @@ async def start( *, name: str, properties: StartAgentsRequestProperties, + preset: typing.Optional[str] = OMIT, + pipeline_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> StartAgentsResponse: """ @@ -529,6 +595,17 @@ async def start( properties : StartAgentsRequestProperties Configuration details of the agent. + preset : typing.Optional[str] + A comma-separated string of one or more presets. Each preset provides a predefined configuration for ASR, LLM, and TTS. You can specify a preset for any or all of ASR, LLM, and TTS. When a preset is specified, you do not need to provide the endpoint URL, API key, or model for the preset providers. Use the `asr`, `llm`, and `tts` fields to configure additional settings. + + Available presets: + - ASR: `deepgram_nova_2`, `deepgram_nova_3` + - LLM: `openai_gpt_4o_mini`, `openai_gpt_4_1_mini`, `openai_gpt_5_nano`, `openai_gpt_5_mini` + - TTS: `minimax_speech_2_6_turbo`, `minimax_speech_2_8_turbo`, `openai_tts_1` + + pipeline_id : typing.Optional[str] + The unique ID of a published agent in AI Studio. When provided, the saved agent configuration is used as the base configuration. Any fields specified in `properties` override the corresponding agent settings. When you specify a `pipeline_id`, the `asr`, `tts`, and `llm` fields in `properties` are optional. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -593,7 +670,12 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.start( - appid, name=name, properties=properties, request_options=request_options + appid, + name=name, + properties=properties, + preset=preset, + pipeline_id=pipeline_id, + request_options=request_options, ) return _response.data @@ -784,6 +866,57 @@ async def main() -> None: _response = await self._raw_client.get_history(appid, agent_id, request_options=request_options) return _response.data + async def get_turns( + self, appid: str, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetTurnsAgentsResponse: + """ + Query conversation turn information for a conversational AI agent session. + + After a conversation with the agent ends, use this endpoint to query the conversation turn information, including the start information, end information, and performance metrics of each conversation turn. + + You can query sessions within the last 7 days. + + Parameters + ---------- + appid : str + The App ID of the project. + + agent_id : str + The agent instance ID you obtained after successfully calling `join` to start a conversational AI agent. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetTurnsAgentsResponse + Request was successful. The response body contains the result of the request. + + Examples + -------- + import asyncio + + from agora_agent import AsyncAgora + + client = AsyncAgora( + authorization="YOUR_AUTHORIZATION", + username="YOUR_USERNAME", + password="YOUR_PASSWORD", + ) + + + async def main() -> None: + await client.agents.get_turns( + appid="appid", + agent_id="agentId", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_turns(appid, agent_id, request_options=request_options) + return _response.data + async def stop(self, appid: str, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: """ Stop the specified conversational agent instance. diff --git a/src/agora_agent/agents/raw_client.py b/src/agora_agent/agents/raw_client.py index bd83e31..c6eb03f 100644 --- a/src/agora_agent/agents/raw_client.py +++ b/src/agora_agent/agents/raw_client.py @@ -13,6 +13,7 @@ from ..core.unchecked_base_model import construct_type from .types.get_agents_response import GetAgentsResponse from .types.get_history_agents_response import GetHistoryAgentsResponse +from .types.get_turns_agents_response import GetTurnsAgentsResponse from .types.interrupt_agents_response import InterruptAgentsResponse from .types.list_agents_request_state import ListAgentsRequestState from .types.list_agents_response import ListAgentsResponse @@ -38,6 +39,8 @@ def start( *, name: str, properties: StartAgentsRequestProperties, + preset: typing.Optional[str] = OMIT, + pipeline_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[StartAgentsResponse]: """ @@ -54,6 +57,17 @@ def start( properties : StartAgentsRequestProperties Configuration details of the agent. + preset : typing.Optional[str] + A comma-separated string of one or more presets. Each preset provides a predefined configuration for ASR, LLM, and TTS. You can specify a preset for any or all of ASR, LLM, and TTS. When a preset is specified, you do not need to provide the endpoint URL, API key, or model for the preset providers. Use the `asr`, `llm`, and `tts` fields to configure additional settings. + + Available presets: + - ASR: `deepgram_nova_2`, `deepgram_nova_3` + - LLM: `openai_gpt_4o_mini`, `openai_gpt_4_1_mini`, `openai_gpt_5_nano`, `openai_gpt_5_mini` + - TTS: `minimax_speech_2_6_turbo`, `minimax_speech_2_8_turbo`, `openai_tts_1` + + pipeline_id : typing.Optional[str] + The unique ID of a published agent in AI Studio. When provided, the saved agent configuration is used as the base configuration. Any fields specified in `properties` override the corresponding agent settings. When you specify a `pipeline_id`, the `asr`, `tts`, and `llm` fields in `properties` are optional. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -67,6 +81,8 @@ def start( method="POST", json={ "name": name, + "preset": preset, + "pipeline_id": pipeline_id, "properties": convert_and_respect_annotation_metadata( object_=properties, annotation=StartAgentsRequestProperties, direction="write" ), @@ -276,6 +292,52 @@ def get_history( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def get_turns( + self, appid: str, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GetTurnsAgentsResponse]: + """ + Query conversation turn information for a conversational AI agent session. + + After a conversation with the agent ends, use this endpoint to query the conversation turn information, including the start information, end information, and performance metrics of each conversation turn. + + You can query sessions within the last 7 days. + + Parameters + ---------- + appid : str + The App ID of the project. + + agent_id : str + The agent instance ID you obtained after successfully calling `join` to start a conversational AI agent. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetTurnsAgentsResponse] + Request was successful. The response body contains the result of the request. + """ + _response = self._client_wrapper.httpx_client.request( + f"v2/projects/{jsonable_encoder(appid)}/agents/{jsonable_encoder(agent_id)}/turns", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetTurnsAgentsResponse, + construct_type( + type_=GetTurnsAgentsResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def stop( self, appid: str, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[None]: @@ -503,6 +565,8 @@ async def start( *, name: str, properties: StartAgentsRequestProperties, + preset: typing.Optional[str] = OMIT, + pipeline_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[StartAgentsResponse]: """ @@ -519,6 +583,17 @@ async def start( properties : StartAgentsRequestProperties Configuration details of the agent. + preset : typing.Optional[str] + A comma-separated string of one or more presets. Each preset provides a predefined configuration for ASR, LLM, and TTS. You can specify a preset for any or all of ASR, LLM, and TTS. When a preset is specified, you do not need to provide the endpoint URL, API key, or model for the preset providers. Use the `asr`, `llm`, and `tts` fields to configure additional settings. + + Available presets: + - ASR: `deepgram_nova_2`, `deepgram_nova_3` + - LLM: `openai_gpt_4o_mini`, `openai_gpt_4_1_mini`, `openai_gpt_5_nano`, `openai_gpt_5_mini` + - TTS: `minimax_speech_2_6_turbo`, `minimax_speech_2_8_turbo`, `openai_tts_1` + + pipeline_id : typing.Optional[str] + The unique ID of a published agent in AI Studio. When provided, the saved agent configuration is used as the base configuration. Any fields specified in `properties` override the corresponding agent settings. When you specify a `pipeline_id`, the `asr`, `tts`, and `llm` fields in `properties` are optional. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -532,6 +607,8 @@ async def start( method="POST", json={ "name": name, + "preset": preset, + "pipeline_id": pipeline_id, "properties": convert_and_respect_annotation_metadata( object_=properties, annotation=StartAgentsRequestProperties, direction="write" ), @@ -744,6 +821,52 @@ async def get_history( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + async def get_turns( + self, appid: str, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetTurnsAgentsResponse]: + """ + Query conversation turn information for a conversational AI agent session. + + After a conversation with the agent ends, use this endpoint to query the conversation turn information, including the start information, end information, and performance metrics of each conversation turn. + + You can query sessions within the last 7 days. + + Parameters + ---------- + appid : str + The App ID of the project. + + agent_id : str + The agent instance ID you obtained after successfully calling `join` to start a conversational AI agent. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetTurnsAgentsResponse] + Request was successful. The response body contains the result of the request. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v2/projects/{jsonable_encoder(appid)}/agents/{jsonable_encoder(agent_id)}/turns", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetTurnsAgentsResponse, + construct_type( + type_=GetTurnsAgentsResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + async def stop( self, appid: str, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[None]: diff --git a/src/agora_agent/agents/types/get_turns_agents_response.py b/src/agora_agent/agents/types/get_turns_agents_response.py new file mode 100644 index 0000000..dca9ce1 --- /dev/null +++ b/src/agora_agent/agents/types/get_turns_agents_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.unchecked_base_model import UncheckedBaseModel +from .get_turns_agents_response_turns_item import GetTurnsAgentsResponseTurnsItem + + +class GetTurnsAgentsResponse(UncheckedBaseModel): + turns: typing.Optional[typing.List[GetTurnsAgentsResponseTurnsItem]] = pydantic.Field(default=None) + """ + A list of conversation turns for the agent session. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/agora_agent/agents/types/get_turns_agents_response_turns_item.py b/src/agora_agent/agents/types/get_turns_agents_response_turns_item.py new file mode 100644 index 0000000..a89f250 --- /dev/null +++ b/src/agora_agent/agents/types/get_turns_agents_response_turns_item.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.unchecked_base_model import UncheckedBaseModel +from .get_turns_agents_response_turns_item_end import GetTurnsAgentsResponseTurnsItemEnd +from .get_turns_agents_response_turns_item_metrics import GetTurnsAgentsResponseTurnsItemMetrics +from .get_turns_agents_response_turns_item_start import GetTurnsAgentsResponseTurnsItemStart + + +class GetTurnsAgentsResponseTurnsItem(UncheckedBaseModel): + agent_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The unique identifier of the agent. + """ + + channel: typing.Optional[str] = pydantic.Field(default=None) + """ + The name of the RTC channel the agent joined. + """ + + turn_id: typing.Optional[float] = pydantic.Field(default=None) + """ + The sequential index of the turn within the session. Starts at `1`. + """ + + start: typing.Optional[GetTurnsAgentsResponseTurnsItemStart] = pydantic.Field(default=None) + """ + Details about the start of the turn. + """ + + end: typing.Optional[GetTurnsAgentsResponseTurnsItemEnd] = pydantic.Field(default=None) + """ + Details about the end of the turn. + """ + + metrics: typing.Optional[GetTurnsAgentsResponseTurnsItemMetrics] = pydantic.Field(default=None) + """ + Latency metrics for the turn. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/agora_agent/agents/types/get_turns_agents_response_turns_item_end.py b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_end.py new file mode 100644 index 0000000..b259c8c --- /dev/null +++ b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_end.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.unchecked_base_model import UncheckedBaseModel +from .get_turns_agents_response_turns_item_end_metadata import GetTurnsAgentsResponseTurnsItemEndMetadata +from .get_turns_agents_response_turns_item_end_type import GetTurnsAgentsResponseTurnsItemEndType + + +class GetTurnsAgentsResponseTurnsItemEnd(UncheckedBaseModel): + """ + Details about the end of the turn. + """ + + end_at: typing.Optional[float] = pydantic.Field(default=None) + """ + The Unix timestamp in milliseconds (UTC time) when the turn ended. + """ + + type: typing.Optional[GetTurnsAgentsResponseTurnsItemEndType] = pydantic.Field(default=None) + """ + The type of event that ended the turn. + - `ok`: The turn ended normally. + - `interrupted`: The turn was interrupted. + - `ignored`: The turn was ignored. + - `error`: The turn ended due to an error. + """ + + metadata: typing.Optional[GetTurnsAgentsResponseTurnsItemEndMetadata] = pydantic.Field(default=None) + """ + Additional context about the turn end event. Included fields depend on the value of the `type` field. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/agora_agent/agents/types/get_turns_agents_response_turns_item_end_metadata.py b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_end_metadata.py new file mode 100644 index 0000000..0d9c61e --- /dev/null +++ b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_end_metadata.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.unchecked_base_model import UncheckedBaseModel + + +class GetTurnsAgentsResponseTurnsItemEndMetadata(UncheckedBaseModel): + """ + Additional context about the turn end event. Included fields depend on the value of the `type` field. + """ + + playback_duration_ms: typing.Optional[int] = pydantic.Field(default=None) + """ + The audio playback duration in milliseconds. Included only when `type` is `ok`. + """ + + caused_by: typing.Optional[str] = pydantic.Field(default=None) + """ + The cause of the turn ending. + + When `type` is `interrupted`, possible values are: + - `start_of_speech`: A new voice input interrupted the turn. + - `api_speak`: The turn was interrupted by a call to the speak API. + - `api_interrupt`: The turn was interrupted by a call to the interrupt API. + - `api_leave`: The turn was interrupted because the agent left the channel. + + When `type` is `ignored`, possible values are: + - `semantic`: The turn was ignored because semantic end-of-speech detection determined no response was required. + - `keywords`: The turn was ignored because the start keyword was not detected. + - `disable`: The turn was ignored because interruption is disabled for this turn. + """ + + transport: typing.Optional[str] = pydantic.Field(default=None) + """ + The transport protocol used to deliver the request. Included only when `caused_by` is `api_speak` or `api_interrupt`. + - `http`: Delivered over HTTP. + - `rtm`: Delivered through the RTM Presence channel. + """ + + reason: typing.Optional[str] = pydantic.Field(default=None) + """ + The error type. Included only when `type` is `error`. + - `LLM_REQUEST_ERR`: LLM request error. + - `INTERNAL_ERR`: Internal error. + """ + + details: typing.Optional[str] = pydantic.Field(default=None) + """ + Additional error details. Included only when `type` is `error`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/agora_agent/agents/types/get_turns_agents_response_turns_item_end_type.py b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_end_type.py new file mode 100644 index 0000000..ea298f8 --- /dev/null +++ b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_end_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GetTurnsAgentsResponseTurnsItemEndType = typing.Union[ + typing.Literal["ok", "interrupted", "ignored", "error"], typing.Any +] diff --git a/src/agora_agent/agents/types/get_turns_agents_response_turns_item_metrics.py b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_metrics.py new file mode 100644 index 0000000..ae5002c --- /dev/null +++ b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_metrics.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata +from ...core.unchecked_base_model import UncheckedBaseModel +from .get_turns_agents_response_turns_item_metrics_segmented_latency_ms_item import ( + GetTurnsAgentsResponseTurnsItemMetricsSegmentedLatencyMsItem, +) + + +class GetTurnsAgentsResponseTurnsItemMetrics(UncheckedBaseModel): + """ + Latency metrics for the turn. + """ + + e_2_e_latency_ms: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="e2e_latency_ms")] = ( + pydantic.Field(default=None) + ) + """ + The end-to-end latency in milliseconds for the turn. + """ + + segmented_latency_ms: typing.Optional[typing.List[GetTurnsAgentsResponseTurnsItemMetricsSegmentedLatencyMsItem]] = ( + pydantic.Field(default=None) + ) + """ + A breakdown of latency by segment. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/agora_agent/agents/types/get_turns_agents_response_turns_item_metrics_segmented_latency_ms_item.py b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_metrics_segmented_latency_ms_item.py new file mode 100644 index 0000000..345d970 --- /dev/null +++ b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_metrics_segmented_latency_ms_item.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.unchecked_base_model import UncheckedBaseModel + + +class GetTurnsAgentsResponseTurnsItemMetricsSegmentedLatencyMsItem(UncheckedBaseModel): + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The name of the latency segment. + + When the LLM input modality is `text`, the returned segments are: + - `algorithm_processing`: Algorithm processing delay. + - `asr_ttlw`: ASR Time To Last Word (TTLW) in milliseconds. + - `llm_ttft`: LLM Time To First Token (TTFT) in milliseconds. + - `llm_ftfs`: LLM First Token To First Sentence (FTFS) in milliseconds. + - `tts_ttfb`: TTS Time To First Byte (TTFB) in milliseconds. + - `transport`: Network transmission delay in milliseconds. Not returned when the user is connected using the RTC Web SDK. + + When the LLM input modality is `audio`, the returned segments are: + - `algorithm_processing`: Algorithm processing delay. + - `asr_ttlw`: ASR Time To Last Word (TTLW) in milliseconds. + - `llm_ttfa`: LLM Time To First Audio Byte (TTFA) in milliseconds. + - `transport`: Network transmission delay in milliseconds. Not returned when the user is connected using the RTC Web SDK. + """ + + latency: typing.Optional[float] = pydantic.Field(default=None) + """ + The latency in milliseconds for the segment. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/agora_agent/agents/types/get_turns_agents_response_turns_item_start.py b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_start.py new file mode 100644 index 0000000..75c2206 --- /dev/null +++ b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_start.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.unchecked_base_model import UncheckedBaseModel +from .get_turns_agents_response_turns_item_start_metadata import GetTurnsAgentsResponseTurnsItemStartMetadata +from .get_turns_agents_response_turns_item_start_type import GetTurnsAgentsResponseTurnsItemStartType + + +class GetTurnsAgentsResponseTurnsItemStart(UncheckedBaseModel): + """ + Details about the start of the turn. + """ + + start_at: typing.Optional[float] = pydantic.Field(default=None) + """ + The Unix timestamp in milliseconds (UTC time) when the turn started. + """ + + type: typing.Optional[GetTurnsAgentsResponseTurnsItemStartType] = pydantic.Field(default=None) + """ + The type of event that initiated the turn. + - `voice_input`: The turn was initiated by user voice input. + - `greeting`: The turn was initiated by an agent greeting. + - `silence_timeout`: The turn was initiated due to a silence timeout. + - `api_speak`: The turn was initiated by a call to the speak API. + """ + + metadata: typing.Optional[GetTurnsAgentsResponseTurnsItemStartMetadata] = pydantic.Field(default=None) + """ + Additional context about the turn start event. Included fields depend on the value of the `type` field. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/agora_agent/agents/types/get_turns_agents_response_turns_item_start_metadata.py b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_start_metadata.py new file mode 100644 index 0000000..a5792a2 --- /dev/null +++ b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_start_metadata.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.unchecked_base_model import UncheckedBaseModel + + +class GetTurnsAgentsResponseTurnsItemStartMetadata(UncheckedBaseModel): + """ + Additional context about the turn start event. Included fields depend on the value of the `type` field. + """ + + speech_duration_ms: typing.Optional[int] = pydantic.Field(default=None) + """ + The duration of the user's voice input in milliseconds. Included only when `type` is `voice_input`. + """ + + interrupt_duration_ms: typing.Optional[int] = pydantic.Field(default=None) + """ + The minimum voice duration in milliseconds required to trigger an interruption. Included only when `type` is `voice_input`. + """ + + greeting_nth: typing.Optional[int] = pydantic.Field(default=None) + """ + The index of the current greeting occurrence. Included only when `type` is `greeting`. + """ + + action: typing.Optional[str] = pydantic.Field(default=None) + """ + The action taken in response to the silence timeout. Included only when `type` is `silence_timeout`. + - `speak`: Plays the silence prompt message to the user. + - `think`: Appends the silence message to the conversation context and passes it to the LLM. + """ + + transport: typing.Optional[str] = pydantic.Field(default=None) + """ + The transport protocol used to deliver the speak request. Included only when `type` is `api_speak`. + - `http`: Delivered over HTTP. + - `rtm`: Delivered through the RTM Presence channel. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/agora_agent/agents/types/get_turns_agents_response_turns_item_start_type.py b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_start_type.py new file mode 100644 index 0000000..c8ea6e7 --- /dev/null +++ b/src/agora_agent/agents/types/get_turns_agents_response_turns_item_start_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GetTurnsAgentsResponseTurnsItemStartType = typing.Union[ + typing.Literal["voice_input", "greeting", "silence_timeout", "api_speak"], typing.Any +] diff --git a/src/agora_agent/agents/types/start_agents_request_properties.py b/src/agora_agent/agents/types/start_agents_request_properties.py index 538a2b0..e6bb1d1 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties.py +++ b/src/agora_agent/agents/types/start_agents_request_properties.py @@ -83,7 +83,7 @@ class StartAgentsRequestProperties(UncheckedBaseModel): mllm: typing.Optional[StartAgentsRequestPropertiesMllm] = pydantic.Field(default=None) """ - Multimodal Large Language Model (MLLM) configuration for real-time audio and text processing. MLLM is an exclusive alternative to the standard `asr` + `llm` + `tts` pipeline. + Multimodal Large Language Model (MLLM) configuration for real-time audio and text processing. `mllm` is an exclusive alternative to the standard `asr` + `llm` + `tts` pipeline. """ avatar: typing.Optional[StartAgentsRequestPropertiesAvatar] = pydantic.Field(default=None) diff --git a/src/agora_agent/agents/types/start_agents_request_properties_advanced_features.py b/src/agora_agent/agents/types/start_agents_request_properties_advanced_features.py index 223fdd0..55480a4 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties_advanced_features.py +++ b/src/agora_agent/agents/types/start_agents_request_properties_advanced_features.py @@ -12,14 +12,9 @@ class StartAgentsRequestPropertiesAdvancedFeatures(UncheckedBaseModel): Advanced features configuration. """ - enable_aivad: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether to enable the intelligent interruption handling function (AIVAD). This feature is currently available only for English. Deprecated. Use `turn_detection.config.end_of_speech.mode.semantic` instead. - """ - enable_mllm: typing.Optional[bool] = pydantic.Field(default=None) """ - Enable Multimodal Large Language Model. Enabling MLLM automatically disables ASR, LLM, and TTS. When you set this parameter to true, `enable_aivad` is also disabled. + Enable Multimodal Large Language Model for voice-to-voice processing. Enabling MLLM automatically disables ASR, LLM, and TTS since the MLLM handles end-to-end voice processing directly. See `turn_detection.type` for turn detection options available with MLLM. """ enable_rtm: typing.Optional[bool] = pydantic.Field(default=None) diff --git a/src/agora_agent/agents/types/start_agents_request_properties_avatar.py b/src/agora_agent/agents/types/start_agents_request_properties_avatar.py index 49a8b40..24e3888 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties_avatar.py +++ b/src/agora_agent/agents/types/start_agents_request_properties_avatar.py @@ -22,7 +22,8 @@ class StartAgentsRequestPropertiesAvatar(UncheckedBaseModel): """ Avatar vendor. Supports the following values: - `akool`: Akool (Beta) - - `heygen`: HeyGen (Beta) + - `liveavatar`: LiveAvatar (Beta) + - `anam`: Anam (Beta) """ params: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) diff --git a/src/agora_agent/agents/types/start_agents_request_properties_avatar_vendor.py b/src/agora_agent/agents/types/start_agents_request_properties_avatar_vendor.py index 156e056..2926d04 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties_avatar_vendor.py +++ b/src/agora_agent/agents/types/start_agents_request_properties_avatar_vendor.py @@ -2,4 +2,6 @@ import typing -StartAgentsRequestPropertiesAvatarVendor = typing.Union[typing.Literal["akool", "heygen"], typing.Any] +StartAgentsRequestPropertiesAvatarVendor = typing.Union[ + typing.Literal["akool", "liveavatar", "anam", "heygen"], typing.Any +] diff --git a/src/agora_agent/agents/types/start_agents_request_properties_mllm.py b/src/agora_agent/agents/types/start_agents_request_properties_mllm.py index c0b9f61..d0693f6 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties_mllm.py +++ b/src/agora_agent/agents/types/start_agents_request_properties_mllm.py @@ -10,7 +10,7 @@ class StartAgentsRequestPropertiesMllm(UncheckedBaseModel): """ - Multimodal Large Language Model (MLLM) configuration for real-time audio and text processing. MLLM is an exclusive alternative to the standard `asr` + `llm` + `tts` pipeline. + Multimodal Large Language Model (MLLM) configuration for real-time audio and text processing. `mllm` is an exclusive alternative to the standard `asr` + `llm` + `tts` pipeline. """ url: typing.Optional[str] = pydantic.Field(default=None) @@ -55,7 +55,8 @@ class StartAgentsRequestPropertiesMllm(UncheckedBaseModel): """ MLLM provider. Currently supports: - `openai`: OpenAI Realtime API - - `vertexai`: Use this for Google Gemini Live + - `gemini`: Google Gemini Live + - `vertexai`: Google Gemini Live (Vertex AI) """ style: typing.Optional[typing.Literal["openai"]] = pydantic.Field(default=None) diff --git a/src/agora_agent/agents/types/start_agents_request_properties_mllm_vendor.py b/src/agora_agent/agents/types/start_agents_request_properties_mllm_vendor.py index 322f8bb..519b143 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties_mllm_vendor.py +++ b/src/agora_agent/agents/types/start_agents_request_properties_mllm_vendor.py @@ -2,4 +2,4 @@ import typing -StartAgentsRequestPropertiesMllmVendor = typing.Union[typing.Literal["openai", "vertexai"], typing.Any] +StartAgentsRequestPropertiesMllmVendor = typing.Union[typing.Literal["openai", "gemini", "vertexai"], typing.Any] diff --git a/src/agora_agent/agents/types/start_agents_request_properties_sal.py b/src/agora_agent/agents/types/start_agents_request_properties_sal.py index 1d8b0b5..c39b299 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties_sal.py +++ b/src/agora_agent/agents/types/start_agents_request_properties_sal.py @@ -29,7 +29,7 @@ class StartAgentsRequestPropertiesSal(UncheckedBaseModel): > - For a registered voiceprint, ensure that: > - Size: A single voiceprint file must not exceed 2 MB. > - Duration: 10 to 15 seconds, with at least 8 seconds of effective audio without silent segments. - > - Format: 16kHz sampling rate, 16-bit depth, mono PCM audio file. The file name extension must be ".pcm". + > - Format: 16kHz sampling rate, 16-bit depth, mono PCM audio file. The file name extension must be ".pcm". """ if IS_PYDANTIC_V2: diff --git a/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_end_of_speech_semantic_config.py b/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_end_of_speech_semantic_config.py index 60fce12..3c45e22 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_end_of_speech_semantic_config.py +++ b/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_end_of_speech_semantic_config.py @@ -13,7 +13,10 @@ class StartAgentsRequestPropertiesTurnDetectionConfigEndOfSpeechSemanticConfig(U """ silence_duration_ms: typing.Optional[int] = None - max_wait_ms: typing.Optional[int] = None + max_wait_ms: typing.Optional[int] = pydantic.Field(default=None) + """ + Maximum wait time in milliseconds. Use `-1` for no timeout. The maximum time to wait for semantic determination. After timeout, the conversation end is determined based on the current state. + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_disabled_config.py b/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_disabled_config.py index 243eec5..1cee737 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_disabled_config.py +++ b/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_disabled_config.py @@ -21,7 +21,7 @@ class StartAgentsRequestPropertiesTurnDetectionConfigStartOfSpeechDisabledConfig """ Voice processing strategy when the agent is interacting: - `append`: Human voice does not interrupt the agent. The agent processes the human voice input after the current interaction ends. - - `ignored`: The agent ignores human voice input and discards it without storing in context. + - `ignore`: The agent ignores human voice input and discards it without storing in context. """ if IS_PYDANTIC_V2: diff --git a/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_disabled_config_strategy.py b/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_disabled_config_strategy.py index fa18849..ca444de 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_disabled_config_strategy.py +++ b/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_disabled_config_strategy.py @@ -3,5 +3,5 @@ import typing StartAgentsRequestPropertiesTurnDetectionConfigStartOfSpeechDisabledConfigStrategy = typing.Union[ - typing.Literal["append", "ignored"], typing.Any + typing.Literal["append", "ignore"], typing.Any ] diff --git a/src/agora_agent/core/client_wrapper.py b/src/agora_agent/core/client_wrapper.py index b61db10..e632923 100644 --- a/src/agora_agent/core/client_wrapper.py +++ b/src/agora_agent/core/client_wrapper.py @@ -26,10 +26,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "agora-agent-server-sdk/1.0.0", + "User-Agent": "agora-agent-server-sdk/1.3.0", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "agora-agent-server-sdk", - "X-Fern-SDK-Version": "1.0.0", + "X-Fern-SDK-Version": "1.3.0", **(self.get_custom_headers() or {}), } headers["Authorization"] = httpx.BasicAuth(self._get_username(), self._get_password())._auth_header diff --git a/src/agora_agent/version.py b/src/agora_agent/version.py index 4630ae3..160096b 100644 --- a/src/agora_agent/version.py +++ b/src/agora_agent/version.py @@ -1,3 +1,3 @@ from importlib import metadata -__version__ = metadata.version("agent-server-sdk-python") +__version__ = metadata.version("agora-agent-server-sdk")