From 75fffe18866f638e9671a6cf0ec9544b8a0fe751 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 03:29:51 +0000 Subject: [PATCH] Release 0.0.27 --- pyproject.toml | 2 +- src/vocode/__init__.py | 24 +++++ src/vocode/core/client_wrapper.py | 2 +- src/vocode/resources/agents/client.py | 10 +++ src/vocode/resources/numbers/client.py | 87 ++++++++++++++++--- src/vocode/types/__init__.py | 26 ++++++ src/vocode/types/agent.py | 1 + src/vocode/types/agent_update_params.py | 2 + ...ent_update_params_initial_message_delay.py | 7 ++ src/vocode/types/buy_phone_number_request.py | 28 ++++++ ...phone_number_request_telephony_provider.py | 17 ++++ src/vocode/types/call.py | 3 + src/vocode/types/call_telephony_provider.py | 17 ++++ src/vocode/types/create_call_agent_params.py | 1 + src/vocode/types/eleven_labs_voice.py | 2 + ...leven_labs_voice_update_params_model_id.py | 7 ++ ...pdate_params_optimize_streaming_latency.py | 7 ++ src/vocode/types/normalized_agent.py | 1 + src/vocode/types/normalized_call.py | 3 + .../normalized_call_telephony_provider.py | 17 ++++ src/vocode/types/normalized_phone_number.py | 4 + ...one_number_telephony_account_connection.py | 7 ++ ...malized_phone_number_telephony_provider.py | 17 ++++ src/vocode/types/phone_number.py | 4 + .../types/phone_number_telephony_provider.py | 17 ++++ src/vocode/types/twilio_account_connection.py | 30 +++++++ src/vocode/types/twilio_credentials.py | 26 ++++++ 27 files changed, 355 insertions(+), 14 deletions(-) create mode 100644 src/vocode/types/agent_update_params_initial_message_delay.py create mode 100644 src/vocode/types/buy_phone_number_request.py create mode 100644 src/vocode/types/buy_phone_number_request_telephony_provider.py create mode 100644 src/vocode/types/call_telephony_provider.py create mode 100644 src/vocode/types/eleven_labs_voice_update_params_model_id.py create mode 100644 src/vocode/types/eleven_labs_voice_update_params_optimize_streaming_latency.py create mode 100644 src/vocode/types/normalized_call_telephony_provider.py create mode 100644 src/vocode/types/normalized_phone_number_telephony_account_connection.py create mode 100644 src/vocode/types/normalized_phone_number_telephony_provider.py create mode 100644 src/vocode/types/phone_number_telephony_provider.py create mode 100644 src/vocode/types/twilio_account_connection.py create mode 100644 src/vocode/types/twilio_credentials.py diff --git a/pyproject.toml b/pyproject.toml index 88e4752..fc21d1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "vocode-api" -version = "0.0.26" +version = "0.0.27" description = "" readme = "README.md" authors = [] diff --git a/src/vocode/__init__.py b/src/vocode/__init__.py index 8cb1f22..e9a3182 100644 --- a/src/vocode/__init__.py +++ b/src/vocode/__init__.py @@ -53,6 +53,7 @@ AgentUpdateParamsConversationSpeed, AgentUpdateParamsEndpointingSensitivity, AgentUpdateParamsInitialMessage, + AgentUpdateParamsInitialMessageDelay, AgentUpdateParamsInterruptSensitivity, AgentUpdateParamsIvrNavigationMode, AgentUpdateParamsLanguage, @@ -77,11 +78,14 @@ AzureVoiceUpdateParamsPitch, AzureVoiceUpdateParamsRate, AzureVoiceUpdateParamsVoiceName, + BuyPhoneNumberRequest, + BuyPhoneNumberRequestTelephonyProvider, Call, CallHumanDetectionResult, CallOnNoHumanAnswer, CallPage, CallStatus, + CallTelephonyProvider, CollectField, CreateCallAgentParams, CreateCallAgentParamsActionsItem, @@ -110,6 +114,8 @@ ElevenLabsVoiceParams, ElevenLabsVoiceUpdateParams, ElevenLabsVoiceUpdateParamsApiKey, + ElevenLabsVoiceUpdateParamsModelId, + ElevenLabsVoiceUpdateParamsOptimizeStreamingLatency, ElevenLabsVoiceUpdateParamsSimilarityBoost, ElevenLabsVoiceUpdateParamsStability, ElevenLabsVoiceUpdateParamsVoiceId, @@ -131,10 +137,14 @@ NormalizedCall, NormalizedCallHumanDetectionResult, NormalizedCallOnNoHumanAnswer, + NormalizedCallTelephonyProvider, NormalizedPhoneNumber, + NormalizedPhoneNumberTelephonyAccountConnection, + NormalizedPhoneNumberTelephonyProvider, NormalizedPrompt, PhoneNumber, PhoneNumberPage, + PhoneNumberTelephonyProvider, PineconeVectorDatabase, PineconeVectorDatabaseParams, PineconeVectorDatabaseUpdateParams, @@ -172,6 +182,8 @@ TransferCallActionUpdateParams, TransferCallActionUpdateParamsConfig, TransferCallConfig, + TwilioAccountConnection, + TwilioCredentials, Undefined, UpdateNumberRequestInboundAgent, UpdateNumberRequestLabel, @@ -265,6 +277,7 @@ "AgentUpdateParamsConversationSpeed", "AgentUpdateParamsEndpointingSensitivity", "AgentUpdateParamsInitialMessage", + "AgentUpdateParamsInitialMessageDelay", "AgentUpdateParamsInterruptSensitivity", "AgentUpdateParamsIvrNavigationMode", "AgentUpdateParamsLanguage", @@ -289,11 +302,14 @@ "AzureVoiceUpdateParamsPitch", "AzureVoiceUpdateParamsRate", "AzureVoiceUpdateParamsVoiceName", + "BuyPhoneNumberRequest", + "BuyPhoneNumberRequestTelephonyProvider", "Call", "CallHumanDetectionResult", "CallOnNoHumanAnswer", "CallPage", "CallStatus", + "CallTelephonyProvider", "CollectField", "CreateCallAgentParams", "CreateCallAgentParamsActionsItem", @@ -322,6 +338,8 @@ "ElevenLabsVoiceParams", "ElevenLabsVoiceUpdateParams", "ElevenLabsVoiceUpdateParamsApiKey", + "ElevenLabsVoiceUpdateParamsModelId", + "ElevenLabsVoiceUpdateParamsOptimizeStreamingLatency", "ElevenLabsVoiceUpdateParamsSimilarityBoost", "ElevenLabsVoiceUpdateParamsStability", "ElevenLabsVoiceUpdateParamsVoiceId", @@ -343,10 +361,14 @@ "NormalizedCall", "NormalizedCallHumanDetectionResult", "NormalizedCallOnNoHumanAnswer", + "NormalizedCallTelephonyProvider", "NormalizedPhoneNumber", + "NormalizedPhoneNumberTelephonyAccountConnection", + "NormalizedPhoneNumberTelephonyProvider", "NormalizedPrompt", "PhoneNumber", "PhoneNumberPage", + "PhoneNumberTelephonyProvider", "PineconeVectorDatabase", "PineconeVectorDatabaseParams", "PineconeVectorDatabaseUpdateParams", @@ -384,6 +406,8 @@ "TransferCallActionUpdateParams", "TransferCallActionUpdateParamsConfig", "TransferCallConfig", + "TwilioAccountConnection", + "TwilioCredentials", "Undefined", "UnprocessableEntityError", "UpdateNumberRequestInboundAgent", diff --git a/src/vocode/core/client_wrapper.py b/src/vocode/core/client_wrapper.py index c91fa14..b614309 100644 --- a/src/vocode/core/client_wrapper.py +++ b/src/vocode/core/client_wrapper.py @@ -14,7 +14,7 @@ def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { "X-Fern-Language": "Python", "X-Fern-SDK-Name": "vocode-api", - "X-Fern-SDK-Version": "0.0.26", + "X-Fern-SDK-Version": "0.0.27", } headers["Authorization"] = f"Bearer {self._get_token()}" return headers diff --git a/src/vocode/resources/agents/client.py b/src/vocode/resources/agents/client.py index 9912f7b..7d860a7 100644 --- a/src/vocode/resources/agents/client.py +++ b/src/vocode/resources/agents/client.py @@ -95,6 +95,7 @@ def create_agent( endpointing_sensitivity: typing.Optional[AgentParamsEndpointingSensitivity] = OMIT, ivr_navigation_mode: typing.Optional[AgentParamsIvrNavigationMode] = OMIT, conversation_speed: typing.Optional[float] = OMIT, + initial_message_delay: typing.Optional[float] = OMIT, ) -> Agent: """ Parameters: @@ -123,6 +124,8 @@ def create_agent( - ivr_navigation_mode: typing.Optional[AgentParamsIvrNavigationMode]. - conversation_speed: typing.Optional[float]. + + - initial_message_delay: typing.Optional[float]. """ _request: typing.Dict[str, typing.Any] = {"prompt": prompt, "voice": voice} if language is not OMIT: @@ -147,6 +150,8 @@ def create_agent( _request["ivr_navigation_mode"] = ivr_navigation_mode if conversation_speed is not OMIT: _request["conversation_speed"] = conversation_speed + if initial_message_delay is not OMIT: + _request["initial_message_delay"] = initial_message_delay _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/agents/create"), @@ -256,6 +261,7 @@ async def create_agent( endpointing_sensitivity: typing.Optional[AgentParamsEndpointingSensitivity] = OMIT, ivr_navigation_mode: typing.Optional[AgentParamsIvrNavigationMode] = OMIT, conversation_speed: typing.Optional[float] = OMIT, + initial_message_delay: typing.Optional[float] = OMIT, ) -> Agent: """ Parameters: @@ -284,6 +290,8 @@ async def create_agent( - ivr_navigation_mode: typing.Optional[AgentParamsIvrNavigationMode]. - conversation_speed: typing.Optional[float]. + + - initial_message_delay: typing.Optional[float]. """ _request: typing.Dict[str, typing.Any] = {"prompt": prompt, "voice": voice} if language is not OMIT: @@ -308,6 +316,8 @@ async def create_agent( _request["ivr_navigation_mode"] = ivr_navigation_mode if conversation_speed is not OMIT: _request["conversation_speed"] = conversation_speed + if initial_message_delay is not OMIT: + _request["initial_message_delay"] = initial_message_delay _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/agents/create"), diff --git a/src/vocode/resources/numbers/client.py b/src/vocode/resources/numbers/client.py index 705a236..dcf1202 100644 --- a/src/vocode/resources/numbers/client.py +++ b/src/vocode/resources/numbers/client.py @@ -11,6 +11,7 @@ from ...core.jsonable_encoder import jsonable_encoder from ...core.remove_none_from_dict import remove_none_from_dict from ...errors.unprocessable_entity_error import UnprocessableEntityError +from ...types.buy_phone_number_request import BuyPhoneNumberRequest from ...types.http_validation_error import HttpValidationError from ...types.phone_number import PhoneNumber from ...types.phone_number_page import PhoneNumberPage @@ -71,18 +72,15 @@ def get_number(self, *, phone_number: str) -> PhoneNumber: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def buy_number(self, *, area_code: typing.Optional[str] = OMIT) -> PhoneNumber: + def buy_number(self, *, request: BuyPhoneNumberRequest) -> PhoneNumber: """ Parameters: - - area_code: typing.Optional[str]. + - request: BuyPhoneNumberRequest. """ - _request: typing.Dict[str, typing.Any] = {} - if area_code is not OMIT: - _request["area_code"] = area_code _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/numbers/buy"), - json=jsonable_encoder(_request), + json=jsonable_encoder(request), headers=self._client_wrapper.get_headers(), timeout=60, ) @@ -156,6 +154,40 @@ def cancel_number(self, *, phone_number: str) -> PhoneNumber: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + def link_number( + self, *, phone_number: str, telephony_account_connection: str, outbound_only: typing.Optional[bool] = OMIT + ) -> PhoneNumber: + """ + Parameters: + - phone_number: str. + + - telephony_account_connection: str. + + - outbound_only: typing.Optional[bool]. + """ + _request: typing.Dict[str, typing.Any] = { + "phone_number": phone_number, + "telephony_account_connection": telephony_account_connection, + } + if outbound_only is not OMIT: + _request["outbound_only"] = outbound_only + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/numbers/link"), + json=jsonable_encoder(_request), + headers=self._client_wrapper.get_headers(), + timeout=60, + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(PhoneNumber, _response.json()) # type: ignore + if _response.status_code == 422: + raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + class AsyncNumbersClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -209,18 +241,15 @@ async def get_number(self, *, phone_number: str) -> PhoneNumber: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def buy_number(self, *, area_code: typing.Optional[str] = OMIT) -> PhoneNumber: + async def buy_number(self, *, request: BuyPhoneNumberRequest) -> PhoneNumber: """ Parameters: - - area_code: typing.Optional[str]. + - request: BuyPhoneNumberRequest. """ - _request: typing.Dict[str, typing.Any] = {} - if area_code is not OMIT: - _request["area_code"] = area_code _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/numbers/buy"), - json=jsonable_encoder(_request), + json=jsonable_encoder(request), headers=self._client_wrapper.get_headers(), timeout=60, ) @@ -293,3 +322,37 @@ async def cancel_number(self, *, phone_number: str) -> PhoneNumber: except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + + async def link_number( + self, *, phone_number: str, telephony_account_connection: str, outbound_only: typing.Optional[bool] = OMIT + ) -> PhoneNumber: + """ + Parameters: + - phone_number: str. + + - telephony_account_connection: str. + + - outbound_only: typing.Optional[bool]. + """ + _request: typing.Dict[str, typing.Any] = { + "phone_number": phone_number, + "telephony_account_connection": telephony_account_connection, + } + if outbound_only is not OMIT: + _request["outbound_only"] = outbound_only + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/numbers/link"), + json=jsonable_encoder(_request), + headers=self._client_wrapper.get_headers(), + timeout=60, + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(PhoneNumber, _response.json()) # type: ignore + if _response.status_code == 422: + raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/vocode/types/__init__.py b/src/vocode/types/__init__.py index 38b6301..cb771c8 100644 --- a/src/vocode/types/__init__.py +++ b/src/vocode/types/__init__.py @@ -68,6 +68,7 @@ from .agent_update_params_conversation_speed import AgentUpdateParamsConversationSpeed from .agent_update_params_endpointing_sensitivity import AgentUpdateParamsEndpointingSensitivity from .agent_update_params_initial_message import AgentUpdateParamsInitialMessage +from .agent_update_params_initial_message_delay import AgentUpdateParamsInitialMessageDelay from .agent_update_params_interrupt_sensitivity import AgentUpdateParamsInterruptSensitivity from .agent_update_params_ivr_navigation_mode import AgentUpdateParamsIvrNavigationMode from .agent_update_params_language import AgentUpdateParamsLanguage @@ -96,11 +97,14 @@ from .azure_voice_update_params_pitch import AzureVoiceUpdateParamsPitch from .azure_voice_update_params_rate import AzureVoiceUpdateParamsRate from .azure_voice_update_params_voice_name import AzureVoiceUpdateParamsVoiceName +from .buy_phone_number_request import BuyPhoneNumberRequest +from .buy_phone_number_request_telephony_provider import BuyPhoneNumberRequestTelephonyProvider from .call import Call from .call_human_detection_result import CallHumanDetectionResult from .call_on_no_human_answer import CallOnNoHumanAnswer from .call_page import CallPage from .call_status import CallStatus +from .call_telephony_provider import CallTelephonyProvider from .collect_field import CollectField from .create_call_agent_params import CreateCallAgentParams from .create_call_agent_params_actions_item import CreateCallAgentParamsActionsItem @@ -133,6 +137,10 @@ from .eleven_labs_voice_params import ElevenLabsVoiceParams from .eleven_labs_voice_update_params import ElevenLabsVoiceUpdateParams from .eleven_labs_voice_update_params_api_key import ElevenLabsVoiceUpdateParamsApiKey +from .eleven_labs_voice_update_params_model_id import ElevenLabsVoiceUpdateParamsModelId +from .eleven_labs_voice_update_params_optimize_streaming_latency import ( + ElevenLabsVoiceUpdateParamsOptimizeStreamingLatency, +) from .eleven_labs_voice_update_params_similarity_boost import ElevenLabsVoiceUpdateParamsSimilarityBoost from .eleven_labs_voice_update_params_stability import ElevenLabsVoiceUpdateParamsStability from .eleven_labs_voice_update_params_voice_id import ElevenLabsVoiceUpdateParamsVoiceId @@ -154,10 +162,14 @@ from .normalized_call import NormalizedCall from .normalized_call_human_detection_result import NormalizedCallHumanDetectionResult from .normalized_call_on_no_human_answer import NormalizedCallOnNoHumanAnswer +from .normalized_call_telephony_provider import NormalizedCallTelephonyProvider from .normalized_phone_number import NormalizedPhoneNumber +from .normalized_phone_number_telephony_account_connection import NormalizedPhoneNumberTelephonyAccountConnection +from .normalized_phone_number_telephony_provider import NormalizedPhoneNumberTelephonyProvider from .normalized_prompt import NormalizedPrompt from .phone_number import PhoneNumber from .phone_number_page import PhoneNumberPage +from .phone_number_telephony_provider import PhoneNumberTelephonyProvider from .pinecone_vector_database import PineconeVectorDatabase from .pinecone_vector_database_params import PineconeVectorDatabaseParams from .pinecone_vector_database_update_params import PineconeVectorDatabaseUpdateParams @@ -195,6 +207,8 @@ from .transfer_call_action_update_params import TransferCallActionUpdateParams from .transfer_call_action_update_params_config import TransferCallActionUpdateParamsConfig from .transfer_call_config import TransferCallConfig +from .twilio_account_connection import TwilioAccountConnection +from .twilio_credentials import TwilioCredentials from .undefined import Undefined from .update_number_request_inbound_agent import UpdateNumberRequestInboundAgent from .update_number_request_label import UpdateNumberRequestLabel @@ -292,6 +306,7 @@ "AgentUpdateParamsConversationSpeed", "AgentUpdateParamsEndpointingSensitivity", "AgentUpdateParamsInitialMessage", + "AgentUpdateParamsInitialMessageDelay", "AgentUpdateParamsInterruptSensitivity", "AgentUpdateParamsIvrNavigationMode", "AgentUpdateParamsLanguage", @@ -316,11 +331,14 @@ "AzureVoiceUpdateParamsPitch", "AzureVoiceUpdateParamsRate", "AzureVoiceUpdateParamsVoiceName", + "BuyPhoneNumberRequest", + "BuyPhoneNumberRequestTelephonyProvider", "Call", "CallHumanDetectionResult", "CallOnNoHumanAnswer", "CallPage", "CallStatus", + "CallTelephonyProvider", "CollectField", "CreateCallAgentParams", "CreateCallAgentParamsActionsItem", @@ -349,6 +367,8 @@ "ElevenLabsVoiceParams", "ElevenLabsVoiceUpdateParams", "ElevenLabsVoiceUpdateParamsApiKey", + "ElevenLabsVoiceUpdateParamsModelId", + "ElevenLabsVoiceUpdateParamsOptimizeStreamingLatency", "ElevenLabsVoiceUpdateParamsSimilarityBoost", "ElevenLabsVoiceUpdateParamsStability", "ElevenLabsVoiceUpdateParamsVoiceId", @@ -370,10 +390,14 @@ "NormalizedCall", "NormalizedCallHumanDetectionResult", "NormalizedCallOnNoHumanAnswer", + "NormalizedCallTelephonyProvider", "NormalizedPhoneNumber", + "NormalizedPhoneNumberTelephonyAccountConnection", + "NormalizedPhoneNumberTelephonyProvider", "NormalizedPrompt", "PhoneNumber", "PhoneNumberPage", + "PhoneNumberTelephonyProvider", "PineconeVectorDatabase", "PineconeVectorDatabaseParams", "PineconeVectorDatabaseUpdateParams", @@ -411,6 +435,8 @@ "TransferCallActionUpdateParams", "TransferCallActionUpdateParamsConfig", "TransferCallConfig", + "TwilioAccountConnection", + "TwilioCredentials", "Undefined", "UpdateNumberRequestInboundAgent", "UpdateNumberRequestLabel", diff --git a/src/vocode/types/agent.py b/src/vocode/types/agent.py index 5e5ecc4..28b3e1d 100644 --- a/src/vocode/types/agent.py +++ b/src/vocode/types/agent.py @@ -33,6 +33,7 @@ class Agent(pydantic.BaseModel): endpointing_sensitivity: typing.Optional[AgentEndpointingSensitivity] ivr_navigation_mode: typing.Optional[AgentIvrNavigationMode] conversation_speed: typing.Optional[float] + initial_message_delay: typing.Optional[float] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/vocode/types/agent_update_params.py b/src/vocode/types/agent_update_params.py index 951f591..795c224 100644 --- a/src/vocode/types/agent_update_params.py +++ b/src/vocode/types/agent_update_params.py @@ -11,6 +11,7 @@ from .agent_update_params_conversation_speed import AgentUpdateParamsConversationSpeed from .agent_update_params_endpointing_sensitivity import AgentUpdateParamsEndpointingSensitivity from .agent_update_params_initial_message import AgentUpdateParamsInitialMessage +from .agent_update_params_initial_message_delay import AgentUpdateParamsInitialMessageDelay from .agent_update_params_interrupt_sensitivity import AgentUpdateParamsInterruptSensitivity from .agent_update_params_ivr_navigation_mode import AgentUpdateParamsIvrNavigationMode from .agent_update_params_language import AgentUpdateParamsLanguage @@ -35,6 +36,7 @@ class AgentUpdateParams(pydantic.BaseModel): endpointing_sensitivity: typing.Optional[AgentUpdateParamsEndpointingSensitivity] ivr_navigation_mode: typing.Optional[AgentUpdateParamsIvrNavigationMode] conversation_speed: typing.Optional[AgentUpdateParamsConversationSpeed] + initial_message_delay: typing.Optional[AgentUpdateParamsInitialMessageDelay] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/vocode/types/agent_update_params_initial_message_delay.py b/src/vocode/types/agent_update_params_initial_message_delay.py new file mode 100644 index 0000000..dc5dfa1 --- /dev/null +++ b/src/vocode/types/agent_update_params_initial_message_delay.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .undefined import Undefined + +AgentUpdateParamsInitialMessageDelay = typing.Union[float, Undefined] diff --git a/src/vocode/types/buy_phone_number_request.py b/src/vocode/types/buy_phone_number_request.py new file mode 100644 index 0000000..14583eb --- /dev/null +++ b/src/vocode/types/buy_phone_number_request.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic + +from ..core.datetime_utils import serialize_datetime +from .buy_phone_number_request_telephony_provider import BuyPhoneNumberRequestTelephonyProvider + + +class BuyPhoneNumberRequest(pydantic.BaseModel): + area_code: typing.Optional[str] + telephony_provider: typing.Optional[BuyPhoneNumberRequestTelephonyProvider] + telephony_account_connection: typing.Optional[str] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/src/vocode/types/buy_phone_number_request_telephony_provider.py b/src/vocode/types/buy_phone_number_request_telephony_provider.py new file mode 100644 index 0000000..8dcd9ea --- /dev/null +++ b/src/vocode/types/buy_phone_number_request_telephony_provider.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class BuyPhoneNumberRequestTelephonyProvider(str, enum.Enum): + VONAGE = "vonage" + TWILIO = "twilio" + + def visit(self, vonage: typing.Callable[[], T_Result], twilio: typing.Callable[[], T_Result]) -> T_Result: + if self is BuyPhoneNumberRequestTelephonyProvider.VONAGE: + return vonage() + if self is BuyPhoneNumberRequestTelephonyProvider.TWILIO: + return twilio() diff --git a/src/vocode/types/call.py b/src/vocode/types/call.py index f539b58..d0676fc 100644 --- a/src/vocode/types/call.py +++ b/src/vocode/types/call.py @@ -10,6 +10,7 @@ from .call_human_detection_result import CallHumanDetectionResult from .call_on_no_human_answer import CallOnNoHumanAnswer from .call_status import CallStatus +from .call_telephony_provider import CallTelephonyProvider class Call(pydantic.BaseModel): @@ -21,9 +22,11 @@ class Call(pydantic.BaseModel): transcript: typing.Optional[str] human_detection_result: typing.Optional[CallHumanDetectionResult] do_not_call_result: typing.Optional[bool] + telephony_id: typing.Optional[str] to_number: str from_number: str agent: Agent + telephony_provider: CallTelephonyProvider agent_phone_number: str start_time: typing.Optional[dt.datetime] end_time: typing.Optional[dt.datetime] diff --git a/src/vocode/types/call_telephony_provider.py b/src/vocode/types/call_telephony_provider.py new file mode 100644 index 0000000..b91a9bd --- /dev/null +++ b/src/vocode/types/call_telephony_provider.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class CallTelephonyProvider(str, enum.Enum): + VONAGE = "vonage" + TWILIO = "twilio" + + def visit(self, vonage: typing.Callable[[], T_Result], twilio: typing.Callable[[], T_Result]) -> T_Result: + if self is CallTelephonyProvider.VONAGE: + return vonage() + if self is CallTelephonyProvider.TWILIO: + return twilio() diff --git a/src/vocode/types/create_call_agent_params.py b/src/vocode/types/create_call_agent_params.py index e9c68e1..ddd8c2c 100644 --- a/src/vocode/types/create_call_agent_params.py +++ b/src/vocode/types/create_call_agent_params.py @@ -31,6 +31,7 @@ class CreateCallAgentParams(pydantic.BaseModel): endpointing_sensitivity: typing.Optional[CreateCallAgentParamsEndpointingSensitivity] ivr_navigation_mode: typing.Optional[CreateCallAgentParamsIvrNavigationMode] conversation_speed: typing.Optional[float] + initial_message_delay: typing.Optional[float] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/vocode/types/eleven_labs_voice.py b/src/vocode/types/eleven_labs_voice.py index ee94583..1bf03c4 100644 --- a/src/vocode/types/eleven_labs_voice.py +++ b/src/vocode/types/eleven_labs_voice.py @@ -15,6 +15,8 @@ class ElevenLabsVoice(pydantic.BaseModel): stability: typing.Optional[float] similarity_boost: typing.Optional[float] api_key: typing.Optional[str] + optimize_streaming_latency: typing.Optional[int] + model_id: typing.Optional[str] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/vocode/types/eleven_labs_voice_update_params_model_id.py b/src/vocode/types/eleven_labs_voice_update_params_model_id.py new file mode 100644 index 0000000..abfdf7a --- /dev/null +++ b/src/vocode/types/eleven_labs_voice_update_params_model_id.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .undefined import Undefined + +ElevenLabsVoiceUpdateParamsModelId = typing.Union[str, Undefined] diff --git a/src/vocode/types/eleven_labs_voice_update_params_optimize_streaming_latency.py b/src/vocode/types/eleven_labs_voice_update_params_optimize_streaming_latency.py new file mode 100644 index 0000000..d99181f --- /dev/null +++ b/src/vocode/types/eleven_labs_voice_update_params_optimize_streaming_latency.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .undefined import Undefined + +ElevenLabsVoiceUpdateParamsOptimizeStreamingLatency = typing.Union[int, Undefined] diff --git a/src/vocode/types/normalized_agent.py b/src/vocode/types/normalized_agent.py index 208480a..dafa0de 100644 --- a/src/vocode/types/normalized_agent.py +++ b/src/vocode/types/normalized_agent.py @@ -30,6 +30,7 @@ class NormalizedAgent(pydantic.BaseModel): endpointing_sensitivity: typing.Optional[NormalizedAgentEndpointingSensitivity] ivr_navigation_mode: typing.Optional[NormalizedAgentIvrNavigationMode] conversation_speed: typing.Optional[float] + initial_message_delay: typing.Optional[float] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/vocode/types/normalized_call.py b/src/vocode/types/normalized_call.py index 427aa6d..c05e26e 100644 --- a/src/vocode/types/normalized_call.py +++ b/src/vocode/types/normalized_call.py @@ -9,6 +9,7 @@ from .call_status import CallStatus from .normalized_call_human_detection_result import NormalizedCallHumanDetectionResult from .normalized_call_on_no_human_answer import NormalizedCallOnNoHumanAnswer +from .normalized_call_telephony_provider import NormalizedCallTelephonyProvider class NormalizedCall(pydantic.BaseModel): @@ -20,9 +21,11 @@ class NormalizedCall(pydantic.BaseModel): transcript: typing.Optional[str] human_detection_result: typing.Optional[NormalizedCallHumanDetectionResult] do_not_call_result: typing.Optional[bool] + telephony_id: typing.Optional[str] to_number: str from_number: str agent: str + telephony_provider: NormalizedCallTelephonyProvider agent_phone_number: str start_time: typing.Optional[dt.datetime] end_time: typing.Optional[dt.datetime] diff --git a/src/vocode/types/normalized_call_telephony_provider.py b/src/vocode/types/normalized_call_telephony_provider.py new file mode 100644 index 0000000..c55c222 --- /dev/null +++ b/src/vocode/types/normalized_call_telephony_provider.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class NormalizedCallTelephonyProvider(str, enum.Enum): + VONAGE = "vonage" + TWILIO = "twilio" + + def visit(self, vonage: typing.Callable[[], T_Result], twilio: typing.Callable[[], T_Result]) -> T_Result: + if self is NormalizedCallTelephonyProvider.VONAGE: + return vonage() + if self is NormalizedCallTelephonyProvider.TWILIO: + return twilio() diff --git a/src/vocode/types/normalized_phone_number.py b/src/vocode/types/normalized_phone_number.py index 390b67f..b775816 100644 --- a/src/vocode/types/normalized_phone_number.py +++ b/src/vocode/types/normalized_phone_number.py @@ -6,6 +6,8 @@ import pydantic from ..core.datetime_utils import serialize_datetime +from .normalized_phone_number_telephony_account_connection import NormalizedPhoneNumberTelephonyAccountConnection +from .normalized_phone_number_telephony_provider import NormalizedPhoneNumberTelephonyProvider class NormalizedPhoneNumber(pydantic.BaseModel): @@ -17,6 +19,8 @@ class NormalizedPhoneNumber(pydantic.BaseModel): outbound_only: typing.Optional[bool] example_context: typing.Optional[typing.Dict[str, str]] number: str + telephony_provider: typing.Optional[NormalizedPhoneNumberTelephonyProvider] + telephony_account_connection: typing.Optional[NormalizedPhoneNumberTelephonyAccountConnection] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/vocode/types/normalized_phone_number_telephony_account_connection.py b/src/vocode/types/normalized_phone_number_telephony_account_connection.py new file mode 100644 index 0000000..b0a4e9f --- /dev/null +++ b/src/vocode/types/normalized_phone_number_telephony_account_connection.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .twilio_account_connection import TwilioAccountConnection + +NormalizedPhoneNumberTelephonyAccountConnection = typing.Union[str, TwilioAccountConnection] diff --git a/src/vocode/types/normalized_phone_number_telephony_provider.py b/src/vocode/types/normalized_phone_number_telephony_provider.py new file mode 100644 index 0000000..5ad1ddc --- /dev/null +++ b/src/vocode/types/normalized_phone_number_telephony_provider.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class NormalizedPhoneNumberTelephonyProvider(str, enum.Enum): + VONAGE = "vonage" + TWILIO = "twilio" + + def visit(self, vonage: typing.Callable[[], T_Result], twilio: typing.Callable[[], T_Result]) -> T_Result: + if self is NormalizedPhoneNumberTelephonyProvider.VONAGE: + return vonage() + if self is NormalizedPhoneNumberTelephonyProvider.TWILIO: + return twilio() diff --git a/src/vocode/types/phone_number.py b/src/vocode/types/phone_number.py index a78add8..d11b3b8 100644 --- a/src/vocode/types/phone_number.py +++ b/src/vocode/types/phone_number.py @@ -7,6 +7,8 @@ from ..core.datetime_utils import serialize_datetime from .agent import Agent +from .phone_number_telephony_provider import PhoneNumberTelephonyProvider +from .twilio_account_connection import TwilioAccountConnection class PhoneNumber(pydantic.BaseModel): @@ -18,6 +20,8 @@ class PhoneNumber(pydantic.BaseModel): outbound_only: typing.Optional[bool] example_context: typing.Optional[typing.Dict[str, str]] number: str + telephony_provider: typing.Optional[PhoneNumberTelephonyProvider] + telephony_account_connection: typing.Optional[TwilioAccountConnection] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/vocode/types/phone_number_telephony_provider.py b/src/vocode/types/phone_number_telephony_provider.py new file mode 100644 index 0000000..db52ac5 --- /dev/null +++ b/src/vocode/types/phone_number_telephony_provider.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class PhoneNumberTelephonyProvider(str, enum.Enum): + VONAGE = "vonage" + TWILIO = "twilio" + + def visit(self, vonage: typing.Callable[[], T_Result], twilio: typing.Callable[[], T_Result]) -> T_Result: + if self is PhoneNumberTelephonyProvider.VONAGE: + return vonage() + if self is PhoneNumberTelephonyProvider.TWILIO: + return twilio() diff --git a/src/vocode/types/twilio_account_connection.py b/src/vocode/types/twilio_account_connection.py new file mode 100644 index 0000000..fe596fd --- /dev/null +++ b/src/vocode/types/twilio_account_connection.py @@ -0,0 +1,30 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions + +from ..core.datetime_utils import serialize_datetime +from .twilio_credentials import TwilioCredentials + + +class TwilioAccountConnection(pydantic.BaseModel): + id: str + user_id: str + type: typing_extensions.Literal["account_connection_twilio"] + credentials: TwilioCredentials + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/src/vocode/types/twilio_credentials.py b/src/vocode/types/twilio_credentials.py new file mode 100644 index 0000000..ef3342c --- /dev/null +++ b/src/vocode/types/twilio_credentials.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic + +from ..core.datetime_utils import serialize_datetime + + +class TwilioCredentials(pydantic.BaseModel): + twilio_account_sid: str + twilio_auth_token: str + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime}