diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1cd1dfda..e905afb3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.135.0" + ".": "4.136.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 6ebf4e77..d609885c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1041 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx/telnyx-9cc495153444889989ae89f838f2d0429c3dd41e08a26fb76658b03f68007794.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx/telnyx-1a793276dc4d7fa1e848d3ca6b301533de22377db293aeca2eca1ca8e52f04eb.yml openapi_spec_hash: 80c8b711c00455999eba32f4c3f225fe -config_hash: 6b6686945572dbb277d4884e51cb07e7 +config_hash: a192a56f5166333bbe5063b015ed0f54 diff --git a/CHANGELOG.md b/CHANGELOG.md index e1eed0b8..84845b2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 4.136.0 (2026-05-15) + +Full Changelog: [v4.135.0...v4.136.0](https://github.com/team-telnyx/telnyx-python/compare/v4.135.0...v4.136.0) + +### Features + +* **api:** manual updates ([b60f39c](https://github.com/team-telnyx/telnyx-python/commit/b60f39c59eafd3fe80a26720e50e96e134fc44b2)) + ## 4.135.0 (2026-05-15) Full Changelog: [v4.134.0...v4.135.0](https://github.com/team-telnyx/telnyx-python/compare/v4.134.0...v4.135.0) diff --git a/api.md b/api.md index 08b3ef68..d5fa8493 100644 --- a/api.md +++ b/api.md @@ -1458,6 +1458,7 @@ from telnyx.types.calls import ( TranscriptionEngineBConfig, TranscriptionEngineDeepgramConfig, TranscriptionEngineGoogleConfig, + TranscriptionEngineSpeechmaticsConfig, TranscriptionEngineTelnyxConfig, TranscriptionEngineXaiConfig, TranscriptionStartRequest, diff --git a/pyproject.toml b/pyproject.toml index 9609079f..8754c08e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "telnyx" -version = "4.135.0" +version = "4.136.0" description = "The official Python library for the telnyx API" dynamic = ["readme"] license = "MIT" diff --git a/src/telnyx/_version.py b/src/telnyx/_version.py index 90cbd4dc..2e59d686 100644 --- a/src/telnyx/_version.py +++ b/src/telnyx/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "telnyx" -__version__ = "4.135.0" # x-release-please-version +__version__ = "4.136.0" # x-release-please-version diff --git a/src/telnyx/resources/ai/ai.py b/src/telnyx/resources/ai/ai.py index 18e6add8..62e278c7 100644 --- a/src/telnyx/resources/ai/ai.py +++ b/src/telnyx/resources/ai/ai.py @@ -202,7 +202,7 @@ def with_streaming_response(self) -> AIResourceWithStreamingResponse: def create_response( self, *, - body: Dict[str, object], + params: Dict[str, object], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -230,7 +230,7 @@ def create_response( """ return self._post( "/ai/responses", - body=maybe_transform(body, ai_create_response_params.AICreateResponseParams), + body=maybe_transform(params, ai_create_response_params.AICreateResponseParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -405,7 +405,7 @@ def with_streaming_response(self) -> AsyncAIResourceWithStreamingResponse: async def create_response( self, *, - body: Dict[str, object], + params: Dict[str, object], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -433,7 +433,7 @@ async def create_response( """ return await self._post( "/ai/responses", - body=await async_maybe_transform(body, ai_create_response_params.AICreateResponseParams), + body=await async_maybe_transform(params, ai_create_response_params.AICreateResponseParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/telnyx/resources/ai/openai/openai.py b/src/telnyx/resources/ai/openai/openai.py index eddd5647..f494ca6a 100644 --- a/src/telnyx/resources/ai/openai/openai.py +++ b/src/telnyx/resources/ai/openai/openai.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Dict + import httpx from .chat import ( @@ -73,7 +75,7 @@ def create_response( self, *, conversation: str | Omit = omit, - input: object | Omit = omit, + input: Dict[str, object] | Omit = omit, instructions: str | Omit = omit, model: str | Omit = omit, stream: bool | Omit = omit, @@ -229,7 +231,7 @@ async def create_response( self, *, conversation: str | Omit = omit, - input: object | Omit = omit, + input: Dict[str, object] | Omit = omit, instructions: str | Omit = omit, model: str | Omit = omit, stream: bool | Omit = omit, diff --git a/src/telnyx/types/ai/openai_create_response_params.py b/src/telnyx/types/ai/openai_create_response_params.py index aa324787..8e2d8911 100644 --- a/src/telnyx/types/ai/openai_create_response_params.py +++ b/src/telnyx/types/ai/openai_create_response_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Dict from typing_extensions import TypedDict __all__ = ["OpenAICreateResponseParams"] @@ -16,7 +17,7 @@ class OpenAICreateResponseParams(TypedDict, total=False): and tool-result followups. Omit it for a non-persisted, stateless response. """ - input: object + input: Dict[str, object] """The input items for this turn, using the OpenAI Responses API input format.""" instructions: str diff --git a/src/telnyx/types/ai_create_response_params.py b/src/telnyx/types/ai_create_response_params.py index 33ba3e71..ddf7f304 100644 --- a/src/telnyx/types/ai_create_response_params.py +++ b/src/telnyx/types/ai_create_response_params.py @@ -9,4 +9,4 @@ class AICreateResponseParams(TypedDict, total=False): - body: Required[Dict[str, object]] + params: Required[Dict[str, object]] diff --git a/src/telnyx/types/calls/__init__.py b/src/telnyx/types/calls/__init__.py index 16251b0a..556ba69f 100644 --- a/src/telnyx/types/calls/__init__.py +++ b/src/telnyx/types/calls/__init__.py @@ -131,6 +131,9 @@ from .transcription_engine_assemblyai_config_param import ( TranscriptionEngineAssemblyaiConfigParam as TranscriptionEngineAssemblyaiConfigParam, ) +from .transcription_engine_speechmatics_config_param import ( + TranscriptionEngineSpeechmaticsConfigParam as TranscriptionEngineSpeechmaticsConfigParam, +) from .call_control_command_result_with_conversation_id import ( CallControlCommandResultWithConversationID as CallControlCommandResultWithConversationID, ) diff --git a/src/telnyx/types/calls/action_start_transcription_params.py b/src/telnyx/types/calls/action_start_transcription_params.py index fcbfe91e..5ede5b0f 100644 --- a/src/telnyx/types/calls/action_start_transcription_params.py +++ b/src/telnyx/types/calls/action_start_transcription_params.py @@ -14,12 +14,9 @@ from .transcription_engine_google_config_param import TranscriptionEngineGoogleConfigParam from .transcription_engine_telnyx_config_param import TranscriptionEngineTelnyxConfigParam from .transcription_engine_assemblyai_config_param import TranscriptionEngineAssemblyaiConfigParam +from .transcription_engine_speechmatics_config_param import TranscriptionEngineSpeechmaticsConfigParam -__all__ = [ - "ActionStartTranscriptionParams", - "TranscriptionEngineConfig", - "TranscriptionEngineConfigTranscriptionEngineSpeechmaticsConfig", -] +__all__ = ["ActionStartTranscriptionParams", "TranscriptionEngineConfig"] class ActionStartTranscriptionParams(TypedDict, total=False): @@ -55,48 +52,13 @@ class ActionStartTranscriptionParams(TypedDict, total=False): """ -class TranscriptionEngineConfigTranscriptionEngineSpeechmaticsConfig(TypedDict, total=False): - interim_results: bool - """Whether to send also interim results. - - If set to false, only final results will be sent. - """ - - language: Literal[ - "en", - "ba", - "eu", - "gl", - "ga", - "mt", - "mn", - "sw", - "ug", - "cy", - "ar_en", - "cmn_en", - "en_ms", - "en_ta", - "tl", - "es-bilingual-en", - "cmn_en_ms_ta", - ] - """Language to use for speech recognition""" - - transcription_engine: Literal["Speechmatics"] - """Engine identifier for Speechmatics transcription service""" - - transcription_model: Literal["speechmatics/standard"] - """The model to use for transcription.""" - - TranscriptionEngineConfig: TypeAlias = Union[ TranscriptionEngineGoogleConfigParam, TranscriptionEngineTelnyxConfigParam, TranscriptionEngineAzureConfigParam, TranscriptionEngineXaiConfigParam, TranscriptionEngineAssemblyaiConfigParam, - TranscriptionEngineConfigTranscriptionEngineSpeechmaticsConfig, + TranscriptionEngineSpeechmaticsConfigParam, TranscriptionEngineAConfigParam, TranscriptionEngineBConfigParam, DeepgramNova2ConfigParam, diff --git a/src/telnyx/types/calls/transcription_engine_speechmatics_config_param.py b/src/telnyx/types/calls/transcription_engine_speechmatics_config_param.py new file mode 100644 index 00000000..3e04eff7 --- /dev/null +++ b/src/telnyx/types/calls/transcription_engine_speechmatics_config_param.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["TranscriptionEngineSpeechmaticsConfigParam"] + + +class TranscriptionEngineSpeechmaticsConfigParam(TypedDict, total=False): + interim_results: bool + """Whether to send also interim results. + + If set to false, only final results will be sent. + """ + + language: Literal[ + "en", + "ba", + "eu", + "gl", + "ga", + "mt", + "mn", + "sw", + "ug", + "cy", + "ar_en", + "cmn_en", + "en_ms", + "en_ta", + "tl", + "es-bilingual-en", + "cmn_en_ms_ta", + ] + """Language to use for speech recognition""" + + transcription_engine: Literal["Speechmatics"] + """Engine identifier for Speechmatics transcription service""" + + transcription_model: Literal["speechmatics/standard"] + """The model to use for transcription.""" diff --git a/src/telnyx/types/calls/transcription_start_request_param.py b/src/telnyx/types/calls/transcription_start_request_param.py index 22742261..35574e4f 100644 --- a/src/telnyx/types/calls/transcription_start_request_param.py +++ b/src/telnyx/types/calls/transcription_start_request_param.py @@ -14,48 +14,9 @@ from .transcription_engine_google_config_param import TranscriptionEngineGoogleConfigParam from .transcription_engine_telnyx_config_param import TranscriptionEngineTelnyxConfigParam from .transcription_engine_assemblyai_config_param import TranscriptionEngineAssemblyaiConfigParam +from .transcription_engine_speechmatics_config_param import TranscriptionEngineSpeechmaticsConfigParam -__all__ = [ - "TranscriptionStartRequestParam", - "TranscriptionEngineConfig", - "TranscriptionEngineConfigTranscriptionEngineSpeechmaticsConfig", -] - - -class TranscriptionEngineConfigTranscriptionEngineSpeechmaticsConfig(TypedDict, total=False): - interim_results: bool - """Whether to send also interim results. - - If set to false, only final results will be sent. - """ - - language: Literal[ - "en", - "ba", - "eu", - "gl", - "ga", - "mt", - "mn", - "sw", - "ug", - "cy", - "ar_en", - "cmn_en", - "en_ms", - "en_ta", - "tl", - "es-bilingual-en", - "cmn_en_ms_ta", - ] - """Language to use for speech recognition""" - - transcription_engine: Literal["Speechmatics"] - """Engine identifier for Speechmatics transcription service""" - - transcription_model: Literal["speechmatics/standard"] - """The model to use for transcription.""" - +__all__ = ["TranscriptionStartRequestParam", "TranscriptionEngineConfig"] TranscriptionEngineConfig: TypeAlias = Union[ TranscriptionEngineGoogleConfigParam, @@ -63,7 +24,7 @@ class TranscriptionEngineConfigTranscriptionEngineSpeechmaticsConfig(TypedDict, TranscriptionEngineAzureConfigParam, TranscriptionEngineXaiConfigParam, TranscriptionEngineAssemblyaiConfigParam, - TranscriptionEngineConfigTranscriptionEngineSpeechmaticsConfig, + TranscriptionEngineSpeechmaticsConfigParam, TranscriptionEngineAConfigParam, TranscriptionEngineBConfigParam, DeepgramNova2ConfigParam, diff --git a/tests/api_resources/ai/test_openai.py b/tests/api_resources/ai/test_openai.py index 392d32de..21081be0 100644 --- a/tests/api_resources/ai/test_openai.py +++ b/tests/api_resources/ai/test_openai.py @@ -28,17 +28,7 @@ def test_method_create_response(self, client: Telnyx) -> None: def test_method_create_response_with_all_params(self, client: Telnyx) -> None: openai = client.ai.openai.create_response( conversation="6a09cdc3-8948-47f0-aa62-74ac943d6c58", - input=[ - { - "role": "user", - "content": [ - { - "type": "input_text", - "text": "Hello, world!", - } - ], - } - ], + input={"0": "bar"}, instructions="You are a friendly chatbot.", model="zai-org/GLM-5.1-FP8", stream=True, @@ -112,17 +102,7 @@ async def test_method_create_response(self, async_client: AsyncTelnyx) -> None: async def test_method_create_response_with_all_params(self, async_client: AsyncTelnyx) -> None: openai = await async_client.ai.openai.create_response( conversation="6a09cdc3-8948-47f0-aa62-74ac943d6c58", - input=[ - { - "role": "user", - "content": [ - { - "type": "input_text", - "text": "Hello, world!", - } - ], - } - ], + input={"0": "bar"}, instructions="You are a friendly chatbot.", model="zai-org/GLM-5.1-FP8", stream=True, diff --git a/tests/api_resources/test_ai.py b/tests/api_resources/test_ai.py index fa7f2b77..47ef66a9 100644 --- a/tests/api_resources/test_ai.py +++ b/tests/api_resources/test_ai.py @@ -28,7 +28,7 @@ class TestAI: def test_method_create_response(self, client: Telnyx) -> None: with pytest.warns(DeprecationWarning): ai = client.ai.create_response( - body={ + params={ "model": "bar", "input": "bar", }, @@ -41,7 +41,7 @@ def test_method_create_response(self, client: Telnyx) -> None: def test_raw_response_create_response(self, client: Telnyx) -> None: with pytest.warns(DeprecationWarning): response = client.ai.with_raw_response.create_response( - body={ + params={ "model": "bar", "input": "bar", }, @@ -57,7 +57,7 @@ def test_raw_response_create_response(self, client: Telnyx) -> None: def test_streaming_response_create_response(self, client: Telnyx) -> None: with pytest.warns(DeprecationWarning): with client.ai.with_streaming_response.create_response( - body={ + params={ "model": "bar", "input": "bar", }, @@ -160,7 +160,7 @@ class TestAsyncAI: async def test_method_create_response(self, async_client: AsyncTelnyx) -> None: with pytest.warns(DeprecationWarning): ai = await async_client.ai.create_response( - body={ + params={ "model": "bar", "input": "bar", }, @@ -173,7 +173,7 @@ async def test_method_create_response(self, async_client: AsyncTelnyx) -> None: async def test_raw_response_create_response(self, async_client: AsyncTelnyx) -> None: with pytest.warns(DeprecationWarning): response = await async_client.ai.with_raw_response.create_response( - body={ + params={ "model": "bar", "input": "bar", }, @@ -189,7 +189,7 @@ async def test_raw_response_create_response(self, async_client: AsyncTelnyx) -> async def test_streaming_response_create_response(self, async_client: AsyncTelnyx) -> None: with pytest.warns(DeprecationWarning): async with async_client.ai.with_streaming_response.create_response( - body={ + params={ "model": "bar", "input": "bar", },