diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a95c8527..263d47d2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.31.0" + ".": "4.32.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 5d83c560..b29f59ec 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 39 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-33c92a2f7908f82088c3cad1076ac008f22cc41d25cbdbcd23b005bfd5e5ab3d.yml -openapi_spec_hash: 3df26020335431e67fdaa9c3865a6a81 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-01ccd56ecde0b5e2e742326f26f3cf2c0bbafef856e1b032110be4880e162106.yml +openapi_spec_hash: 8b1688d1e66812ccafbe5fcf26faa67a config_hash: f4bc63f2350a2a4988750b41a0737f9d diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e7d4995..af760276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 4.32.0 (2025-05-26) + +Full Changelog: [v4.31.0...v4.32.0](https://github.com/RetellAI/retell-python-sdk/compare/v4.31.0...v4.32.0) + +### Features + +* **api:** api update ([59e4d5a](https://github.com/RetellAI/retell-python-sdk/commit/59e4d5a864c6e028437f5f15619aabad7d18b445)) +* **api:** api update ([887256f](https://github.com/RetellAI/retell-python-sdk/commit/887256f2b38d8f6ed6a77d9855a39bc9ee53558f)) + ## 4.31.0 (2025-05-22) Full Changelog: [v4.30.0...v4.31.0](https://github.com/RetellAI/retell-python-sdk/compare/v4.30.0...v4.31.0) diff --git a/pyproject.toml b/pyproject.toml index f0a64608..96029fd1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "retell-sdk" -version = "4.31.0" +version = "4.32.0" description = "The official Python library for the retell API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/retell/_version.py b/src/retell/_version.py index 8be660c9..1be0e816 100644 --- a/src/retell/_version.py +++ b/src/retell/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "retell" -__version__ = "4.31.0" # x-release-please-version +__version__ = "4.32.0" # x-release-please-version diff --git a/src/retell/resources/agent.py b/src/retell/resources/agent.py index 2f2f3dd0..55b774e9 100644 --- a/src/retell/resources/agent.py +++ b/src/retell/resources/agent.py @@ -124,6 +124,7 @@ def create( stt_mode: Literal["fast", "accurate"] | NotGiven = NOT_GIVEN, user_dtmf_options: Optional[agent_create_params.UserDtmfOptions] | NotGiven = NOT_GIVEN, version: Optional[float] | NotGiven = NOT_GIVEN, + vocab_specialization: Literal["general", "medical"] | NotGiven = NOT_GIVEN, voice_model: Optional[ Literal[ "eleven_turbo_v2", @@ -301,6 +302,10 @@ def create( version: Version of the agent. + vocab_specialization: If set, determines the vocabulary set to use for transcription. This setting + only applies for English agents, for non English agent, this setting is a no-op. + Default to general. + voice_model: Optionally set the voice model used for the selected voice. Currently only elevenlab voices have voice model selections. Set to null to remove voice model selection, and default ones will apply. Check out the dashboard for details on @@ -377,6 +382,7 @@ def create( "stt_mode": stt_mode, "user_dtmf_options": user_dtmf_options, "version": version, + "vocab_specialization": vocab_specialization, "voice_model": voice_model, "voice_speed": voice_speed, "voice_temperature": voice_temperature, @@ -512,6 +518,7 @@ def update( stt_mode: Literal["fast", "accurate"] | NotGiven = NOT_GIVEN, user_dtmf_options: Optional[agent_update_params.UserDtmfOptions] | NotGiven = NOT_GIVEN, body_version: Optional[float] | NotGiven = NOT_GIVEN, + vocab_specialization: Literal["general", "medical"] | NotGiven = NOT_GIVEN, voice_id: str | NotGiven = NOT_GIVEN, voice_model: Optional[ Literal[ @@ -689,6 +696,10 @@ def update( body_version: Version of the agent. + vocab_specialization: If set, determines the vocabulary set to use for transcription. This setting + only applies for English agents, for non English agent, this setting is a no-op. + Default to general. + voice_id: Unique voice id used for the agent. Find list of available voices and their preview in Dashboard. @@ -769,6 +780,7 @@ def update( "stt_mode": stt_mode, "user_dtmf_options": user_dtmf_options, "body_version": body_version, + "vocab_specialization": vocab_specialization, "voice_id": voice_id, "voice_model": voice_model, "voice_speed": voice_speed, @@ -975,6 +987,7 @@ async def create( stt_mode: Literal["fast", "accurate"] | NotGiven = NOT_GIVEN, user_dtmf_options: Optional[agent_create_params.UserDtmfOptions] | NotGiven = NOT_GIVEN, version: Optional[float] | NotGiven = NOT_GIVEN, + vocab_specialization: Literal["general", "medical"] | NotGiven = NOT_GIVEN, voice_model: Optional[ Literal[ "eleven_turbo_v2", @@ -1152,6 +1165,10 @@ async def create( version: Version of the agent. + vocab_specialization: If set, determines the vocabulary set to use for transcription. This setting + only applies for English agents, for non English agent, this setting is a no-op. + Default to general. + voice_model: Optionally set the voice model used for the selected voice. Currently only elevenlab voices have voice model selections. Set to null to remove voice model selection, and default ones will apply. Check out the dashboard for details on @@ -1228,6 +1245,7 @@ async def create( "stt_mode": stt_mode, "user_dtmf_options": user_dtmf_options, "version": version, + "vocab_specialization": vocab_specialization, "voice_model": voice_model, "voice_speed": voice_speed, "voice_temperature": voice_temperature, @@ -1363,6 +1381,7 @@ async def update( stt_mode: Literal["fast", "accurate"] | NotGiven = NOT_GIVEN, user_dtmf_options: Optional[agent_update_params.UserDtmfOptions] | NotGiven = NOT_GIVEN, body_version: Optional[float] | NotGiven = NOT_GIVEN, + vocab_specialization: Literal["general", "medical"] | NotGiven = NOT_GIVEN, voice_id: str | NotGiven = NOT_GIVEN, voice_model: Optional[ Literal[ @@ -1540,6 +1559,10 @@ async def update( body_version: Version of the agent. + vocab_specialization: If set, determines the vocabulary set to use for transcription. This setting + only applies for English agents, for non English agent, this setting is a no-op. + Default to general. + voice_id: Unique voice id used for the agent. Find list of available voices and their preview in Dashboard. @@ -1620,6 +1643,7 @@ async def update( "stt_mode": stt_mode, "user_dtmf_options": user_dtmf_options, "body_version": body_version, + "vocab_specialization": vocab_specialization, "voice_id": voice_id, "voice_model": voice_model, "voice_speed": voice_speed, diff --git a/src/retell/types/agent_create_params.py b/src/retell/types/agent_create_params.py index 9e6d980b..29e55668 100644 --- a/src/retell/types/agent_create_params.py +++ b/src/retell/types/agent_create_params.py @@ -298,6 +298,13 @@ class AgentCreateParams(TypedDict, total=False): version: Optional[float] """Version of the agent.""" + vocab_specialization: Literal["general", "medical"] + """If set, determines the vocabulary set to use for transcription. + + This setting only applies for English agents, for non English agent, this + setting is a no-op. Default to general. + """ + voice_model: Optional[ Literal[ "eleven_turbo_v2", diff --git a/src/retell/types/agent_response.py b/src/retell/types/agent_response.py index e79b69db..55976074 100644 --- a/src/retell/types/agent_response.py +++ b/src/retell/types/agent_response.py @@ -440,6 +440,13 @@ class AgentResponse(BaseModel): version: Optional[object] = None """Version of the agent.""" + vocab_specialization: Optional[Literal["general", "medical"]] = None + """If set, determines the vocabulary set to use for transcription. + + This setting only applies for English agents, for non English agent, this + setting is a no-op. Default to general. + """ + voice_model: Optional[ Literal[ "eleven_turbo_v2", diff --git a/src/retell/types/agent_update_params.py b/src/retell/types/agent_update_params.py index 17d44bdf..c44ea4b4 100644 --- a/src/retell/types/agent_update_params.py +++ b/src/retell/types/agent_update_params.py @@ -297,6 +297,13 @@ class AgentUpdateParams(TypedDict, total=False): body_version: Annotated[Optional[float], PropertyInfo(alias="version")] """Version of the agent.""" + vocab_specialization: Literal["general", "medical"] + """If set, determines the vocabulary set to use for transcription. + + This setting only applies for English agents, for non English agent, this + setting is a no-op. Default to general. + """ + voice_id: str """Unique voice id used for the agent. diff --git a/src/retell/types/chat_response.py b/src/retell/types/chat_response.py index 53eaa8c2..96ed34d4 100644 --- a/src/retell/types/chat_response.py +++ b/src/retell/types/chat_response.py @@ -187,6 +187,9 @@ class ChatResponse(BaseModel): chat_cost: Optional[ChatCost] = None + collected_dynamic_variables: Optional[Dict[str, object]] = None + """Dynamic variables collected from the chat. Only available after the chat ends.""" + end_timestamp: Optional[int] = None """End timestamp (milliseconds since epoch) of the chat. diff --git a/src/retell/types/phone_call_response.py b/src/retell/types/phone_call_response.py index 0f070d24..ba02a004 100644 --- a/src/retell/types/phone_call_response.py +++ b/src/retell/types/phone_call_response.py @@ -19,6 +19,7 @@ "LatencyLlmWebsocketNetworkRtt", "LatencyS2s", "LatencyTts", + "LlmTokenUsage", "TelephonyIdentifier", "TranscriptObject", "TranscriptObjectWord", @@ -281,6 +282,17 @@ class Latency(BaseModel): """ +class LlmTokenUsage(BaseModel): + average: float + """Average token count of the call.""" + + num_requests: float + """Number of requests made to the LLM.""" + + values: List[float] + """All the token count values in the call.""" + + class TelephonyIdentifier(BaseModel): twilio_call_sid: Optional[str] = None """Twilio call sid.""" @@ -439,6 +451,9 @@ class PhoneCallResponse(BaseModel): call_cost: Optional[CallCost] = None """Cost of the call, including all the products and their costs and discount.""" + collected_dynamic_variables: Optional[Dict[str, object]] = None + """Dynamic variables collected from the call. Only available after the call ends.""" + disconnection_reason: Optional[ Literal[ "user_hangup", @@ -489,6 +504,12 @@ class PhoneCallResponse(BaseModel): feature used. """ + llm_token_usage: Optional[LlmTokenUsage] = None + """LLM token usage of the call, available after call ends. + + Not populated if using custom LLM, realtime API, or no LLM call is made. + """ + metadata: Optional[object] = None """An arbitrary object for storage purpose only. diff --git a/src/retell/types/web_call_response.py b/src/retell/types/web_call_response.py index 991ebb42..161cf968 100644 --- a/src/retell/types/web_call_response.py +++ b/src/retell/types/web_call_response.py @@ -19,6 +19,7 @@ "LatencyLlmWebsocketNetworkRtt", "LatencyS2s", "LatencyTts", + "LlmTokenUsage", "TranscriptObject", "TranscriptObjectWord", "TranscriptWithToolCall", @@ -280,6 +281,17 @@ class Latency(BaseModel): """ +class LlmTokenUsage(BaseModel): + average: float + """Average token count of the call.""" + + num_requests: float + """Number of requests made to the LLM.""" + + values: List[float] + """All the token count values in the call.""" + + class TranscriptObjectWord(BaseModel): end: Optional[float] = None """End time of the word in the call in second. @@ -430,6 +442,9 @@ class WebCallResponse(BaseModel): call_cost: Optional[CallCost] = None """Cost of the call, including all the products and their costs and discount.""" + collected_dynamic_variables: Optional[Dict[str, object]] = None + """Dynamic variables collected from the call. Only available after the call ends.""" + disconnection_reason: Optional[ Literal[ "user_hangup", @@ -480,6 +495,12 @@ class WebCallResponse(BaseModel): feature used. """ + llm_token_usage: Optional[LlmTokenUsage] = None + """LLM token usage of the call, available after call ends. + + Not populated if using custom LLM, realtime API, or no LLM call is made. + """ + metadata: Optional[object] = None """An arbitrary object for storage purpose only. diff --git a/tests/api_resources/test_agent.py b/tests/api_resources/test_agent.py index b8cb7c7b..54bf8204 100644 --- a/tests/api_resources/test_agent.py +++ b/tests/api_resources/test_agent.py @@ -88,6 +88,7 @@ def test_method_create_with_all_params(self, client: Retell) -> None: "timeout_ms": 1000, }, version=0, + vocab_specialization="general", voice_model="eleven_turbo_v2", voice_speed=1, voice_temperature=1, @@ -240,6 +241,7 @@ def test_method_update_with_all_params(self, client: Retell) -> None: "timeout_ms": 1000, }, body_version=0, + vocab_specialization="general", voice_id="11labs-Adrian", voice_model="eleven_turbo_v2", voice_speed=1, @@ -454,6 +456,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> "timeout_ms": 1000, }, version=0, + vocab_specialization="general", voice_model="eleven_turbo_v2", voice_speed=1, voice_temperature=1, @@ -606,6 +609,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> "timeout_ms": 1000, }, body_version=0, + vocab_specialization="general", voice_id="11labs-Adrian", voice_model="eleven_turbo_v2", voice_speed=1,