From fc99c5ec3b1b31ca5e84d2ab735ac47302d058cd Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:12:29 +0000 Subject: [PATCH] Release 0.0.47 --- src/vocode/types/action_params_request.py | 60 ++-------------- .../types/add_to_conference_action_params.py | 38 ++++------ .../add_to_conference_action_update_params.py | 40 ++++------- .../agent_update_params_actions_item_one.py | 62 ++--------------- .../types/agent_update_params_voice_one.py | 42 +---------- src/vocode/types/azure_voice_params.py | 38 ++++------ src/vocode/types/azure_voice_update_params.py | 43 +++++------- ...eate_call_agent_params_actions_item_one.py | 64 ++--------------- .../create_call_agent_params_voice_one.py | 44 +----------- src/vocode/types/dtmf_action_params.py | 39 ++++------- src/vocode/types/dtmf_action_update_params.py | 38 ++++------ src/vocode/types/eleven_labs_voice_params.py | 47 ++++++------- .../types/eleven_labs_voice_update_params.py | 67 +++++++++--------- .../types/end_conversation_action_params.py | 41 ++++------- .../end_conversation_action_update_params.py | 40 ++++------- src/vocode/types/external_action_params.py | 47 ++++--------- .../types/external_action_update_params.py | 51 ++++---------- src/vocode/types/play_ht_voice_params.py | 52 +++++++------- .../types/play_ht_voice_update_params.py | 69 ++++++++++--------- src/vocode/types/rime_voice_params.py | 37 ++++------ src/vocode/types/rime_voice_update_params.py | 49 ++++++------- src/vocode/types/set_hold_action_params.py | 38 ++++------ .../types/set_hold_action_update_params.py | 40 ++++------- .../types/transfer_call_action_params.py | 39 ++++------- .../transfer_call_action_update_params.py | 40 ++++------- src/vocode/types/voice_params_request.py | 44 +----------- .../types/voice_update_params_request.py | 38 +--------- 27 files changed, 380 insertions(+), 867 deletions(-) diff --git a/src/vocode/types/action_params_request.py b/src/vocode/types/action_params_request.py index ab00f95..b3c25c6 100644 --- a/src/vocode/types/action_params_request.py +++ b/src/vocode/types/action_params_request.py @@ -1,9 +1,6 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - from .add_to_conference_action_params import AddToConferenceActionParams from .dtmf_action_params import DtmfActionParams from .end_conversation_action_params import EndConversationActionParams @@ -11,60 +8,11 @@ from .set_hold_action_params import SetHoldActionParams from .transfer_call_action_params import TransferCallActionParams - -class ActionParamsRequest_ActionTransferCall(TransferCallActionParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class ActionParamsRequest_ActionEndConversation(EndConversationActionParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class ActionParamsRequest_ActionDtmf(DtmfActionParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class ActionParamsRequest_ActionAddToConference(AddToConferenceActionParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class ActionParamsRequest_ActionSetHold(SetHoldActionParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class ActionParamsRequest_ActionExternal(ExternalActionParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - ActionParamsRequest = typing.Union[ - TransferCallActionParams, - EndConversationActionParams, - DtmfActionParams, AddToConferenceActionParams, - SetHoldActionParams, + DtmfActionParams, + EndConversationActionParams, ExternalActionParams, + SetHoldActionParams, + TransferCallActionParams, ] diff --git a/src/vocode/types/add_to_conference_action_params.py b/src/vocode/types/add_to_conference_action_params.py index 8c0bc59..f587f60 100644 --- a/src/vocode/types/add_to_conference_action_params.py +++ b/src/vocode/types/add_to_conference_action_params.py @@ -1,33 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing -import typing_extensions - -from ..core.datetime_utils import serialize_datetime -from .add_to_conference_action_params_action_trigger import AddToConferenceActionParamsActionTrigger from .add_to_conference_config import AddToConferenceConfig - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +from .add_to_conference_action_params_action_trigger import AddToConferenceActionParamsActionTrigger +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -class AddToConferenceActionParams(pydantic.BaseModel): - type: typing_extensions.Literal["action_add_to_conference"] +class AddToConferenceActionParams(UniversalBaseModel): + type: typing.Literal["action_add_to_conference"] = "action_add_to_conference" config: AddToConferenceConfig - action_trigger: typing.Optional[AddToConferenceActionParamsActionTrigger] - - 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) + action_trigger: typing.Optional[AddToConferenceActionParamsActionTrigger] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/add_to_conference_action_update_params.py b/src/vocode/types/add_to_conference_action_update_params.py index 00c39f8..fe82f10 100644 --- a/src/vocode/types/add_to_conference_action_update_params.py +++ b/src/vocode/types/add_to_conference_action_update_params.py @@ -1,33 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing - -from ..core.datetime_utils import serialize_datetime -from .add_to_conference_action_update_params_action_trigger import AddToConferenceActionUpdateParamsActionTrigger from .add_to_conference_action_update_params_config import AddToConferenceActionUpdateParamsConfig -import typing_extensions - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - +from .add_to_conference_action_update_params_action_trigger import AddToConferenceActionUpdateParamsActionTrigger +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -class AddToConferenceActionUpdateParams(pydantic.BaseModel): - type: typing_extensions.Literal["action_add_to_conference"] - config: typing.Optional[AddToConferenceActionUpdateParamsConfig] - action_trigger: typing.Optional[AddToConferenceActionUpdateParamsActionTrigger] - 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) +class AddToConferenceActionUpdateParams(UniversalBaseModel): + type: typing.Literal["action_add_to_conference"] = "action_add_to_conference" + config: typing.Optional[AddToConferenceActionUpdateParamsConfig] = None + action_trigger: typing.Optional[AddToConferenceActionUpdateParamsActionTrigger] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/agent_update_params_actions_item_one.py b/src/vocode/types/agent_update_params_actions_item_one.py index 05da253..9e6e1cf 100644 --- a/src/vocode/types/agent_update_params_actions_item_one.py +++ b/src/vocode/types/agent_update_params_actions_item_one.py @@ -1,9 +1,6 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - from .add_to_conference_action_update_params import AddToConferenceActionUpdateParams from .dtmf_action_update_params import DtmfActionUpdateParams from .end_conversation_action_update_params import EndConversationActionUpdateParams @@ -11,62 +8,11 @@ from .set_hold_action_update_params import SetHoldActionUpdateParams from .transfer_call_action_update_params import TransferCallActionUpdateParams - -class AgentUpdateParamsActionsItemOne_ActionTransferCall( - TransferCallActionUpdateParams -): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class AgentUpdateParamsActionsItemOne_ActionEndConversation( - EndConversationActionUpdateParams -): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class AgentUpdateParamsActionsItemOne_ActionDtmf(DtmfActionUpdateParams): - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class AgentUpdateParamsActionsItemOne_ActionAddToConference( - AddToConferenceActionUpdateParams -): - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class AgentUpdateParamsActionsItemOne_ActionSetHold(SetHoldActionUpdateParams): - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class AgentUpdateParamsActionsItemOne_ActionExternal(ExternalActionUpdateParams): - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - AgentUpdateParamsActionsItemOne = typing.Union[ - TransferCallActionUpdateParams, - EndConversationActionUpdateParams, - DtmfActionUpdateParams, AddToConferenceActionUpdateParams, - SetHoldActionUpdateParams, + DtmfActionUpdateParams, + EndConversationActionUpdateParams, ExternalActionUpdateParams, + SetHoldActionUpdateParams, + TransferCallActionUpdateParams, ] diff --git a/src/vocode/types/agent_update_params_voice_one.py b/src/vocode/types/agent_update_params_voice_one.py index a6fc79e..6d5a47a 100644 --- a/src/vocode/types/agent_update_params_voice_one.py +++ b/src/vocode/types/agent_update_params_voice_one.py @@ -1,52 +1,16 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -import typing_extensions - from .azure_voice_update_params import AzureVoiceUpdateParams from .eleven_labs_voice_update_params import ElevenLabsVoiceUpdateParams from .play_ht_voice_update_params import PlayHtVoiceUpdateParams from .rime_voice_update_params import RimeVoiceUpdateParams - - -class AgentUpdateParamsVoiceOne_VoiceAzure(AzureVoiceUpdateParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class AgentUpdateParamsVoiceOne_VoiceRime(RimeVoiceUpdateParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class AgentUpdateParamsVoiceOne_VoiceElevenLabs(ElevenLabsVoiceUpdateParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class AgentUpdateParamsVoiceOne_VoicePlayHt(PlayHtVoiceUpdateParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - +from .vocode_voice_update_params import VocodeVoiceUpdateParams AgentUpdateParamsVoiceOne = typing.Union[ AzureVoiceUpdateParams, - RimeVoiceUpdateParams, ElevenLabsVoiceUpdateParams, PlayHtVoiceUpdateParams, + RimeVoiceUpdateParams, + VocodeVoiceUpdateParams, ] diff --git a/src/vocode/types/azure_voice_params.py b/src/vocode/types/azure_voice_params.py index 9adb5b0..6fb91c1 100644 --- a/src/vocode/types/azure_voice_params.py +++ b/src/vocode/types/azure_voice_params.py @@ -1,32 +1,22 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing -import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -from ..core.datetime_utils import serialize_datetime -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class AzureVoiceParams(pydantic.BaseModel): - type: typing_extensions.Literal["voice_azure"] +class AzureVoiceParams(UniversalBaseModel): + type: typing.Literal["voice_azure"] = "voice_azure" voice_name: str - pitch: typing.Optional[int] - rate: typing.Optional[int] - - 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) + pitch: typing.Optional[int] = None + rate: typing.Optional[int] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/azure_voice_update_params.py b/src/vocode/types/azure_voice_update_params.py index 35b1b42..531cf61 100644 --- a/src/vocode/types/azure_voice_update_params.py +++ b/src/vocode/types/azure_voice_update_params.py @@ -1,36 +1,25 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing - -import typing_extensions - -from ..core.datetime_utils import serialize_datetime +from .azure_voice_update_params_voice_name import AzureVoiceUpdateParamsVoiceName 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 - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -class AzureVoiceUpdateParams(pydantic.BaseModel): - type: typing_extensions.Literal["voice_azure"] - voice_name: typing.Optional[AzureVoiceUpdateParamsVoiceName] - pitch: typing.Optional[AzureVoiceUpdateParamsPitch] - rate: typing.Optional[AzureVoiceUpdateParamsRate] - 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) +class AzureVoiceUpdateParams(UniversalBaseModel): + type: typing.Literal["voice_azure"] = "voice_azure" + voice_name: typing.Optional[AzureVoiceUpdateParamsVoiceName] = None + pitch: typing.Optional[AzureVoiceUpdateParamsPitch] = None + rate: typing.Optional[AzureVoiceUpdateParamsRate] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/create_call_agent_params_actions_item_one.py b/src/vocode/types/create_call_agent_params_actions_item_one.py index 672037a..291e64f 100644 --- a/src/vocode/types/create_call_agent_params_actions_item_one.py +++ b/src/vocode/types/create_call_agent_params_actions_item_one.py @@ -1,9 +1,6 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - from .add_to_conference_action_params import AddToConferenceActionParams from .dtmf_action_params import DtmfActionParams from .end_conversation_action_params import EndConversationActionParams @@ -11,64 +8,11 @@ from .set_hold_action_params import SetHoldActionParams from .transfer_call_action_params import TransferCallActionParams - -class CreateCallAgentParamsActionsItemOne_ActionTransferCall(TransferCallActionParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class CreateCallAgentParamsActionsItemOne_ActionEndConversation( - EndConversationActionParams -): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class CreateCallAgentParamsActionsItemOne_ActionDtmf(DtmfActionParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class CreateCallAgentParamsActionsItemOne_ActionAddToConference( - AddToConferenceActionParams -): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class CreateCallAgentParamsActionsItemOne_ActionSetHold(SetHoldActionParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class CreateCallAgentParamsActionsItemOne_ActionExternal(ExternalActionParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - CreateCallAgentParamsActionsItemOne = typing.Union[ - TransferCallActionParams, - EndConversationActionParams, - DtmfActionParams, AddToConferenceActionParams, - SetHoldActionParams, + DtmfActionParams, + EndConversationActionParams, ExternalActionParams, + SetHoldActionParams, + TransferCallActionParams, ] diff --git a/src/vocode/types/create_call_agent_params_voice_one.py b/src/vocode/types/create_call_agent_params_voice_one.py index 936a8d1..7baaea7 100644 --- a/src/vocode/types/create_call_agent_params_voice_one.py +++ b/src/vocode/types/create_call_agent_params_voice_one.py @@ -1,52 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -import typing_extensions - from .azure_voice_params import AzureVoiceParams from .eleven_labs_voice_params import ElevenLabsVoiceParams from .play_ht_voice_params import PlayHtVoiceParams from .rime_voice_params import RimeVoiceParams - - -class CreateCallAgentParamsVoiceOne_VoiceAzure(AzureVoiceParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class CreateCallAgentParamsVoiceOne_VoiceRime(RimeVoiceParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class CreateCallAgentParamsVoiceOne_VoiceElevenLabs(ElevenLabsVoiceParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class CreateCallAgentParamsVoiceOne_VoicePlayHt(PlayHtVoiceParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - +from .vocode_voice_params import VocodeVoiceParams CreateCallAgentParamsVoiceOne = typing.Union[ - AzureVoiceParams, - RimeVoiceParams, - ElevenLabsVoiceParams, - PlayHtVoiceParams, + AzureVoiceParams, ElevenLabsVoiceParams, PlayHtVoiceParams, RimeVoiceParams, VocodeVoiceParams ] diff --git a/src/vocode/types/dtmf_action_params.py b/src/vocode/types/dtmf_action_params.py index 829e375..875872e 100644 --- a/src/vocode/types/dtmf_action_params.py +++ b/src/vocode/types/dtmf_action_params.py @@ -1,32 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing - -import typing_extensions - -from ..core.datetime_utils import serialize_datetime from .empty_action_config import EmptyActionConfig +from .function_call_action_trigger import FunctionCallActionTrigger +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class DtmfActionParams(pydantic.BaseModel): - type: typing_extensions.Literal["action_dtmf"] - config: typing.Optional[EmptyActionConfig] - 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) +class DtmfActionParams(UniversalBaseModel): + type: typing.Literal["action_dtmf"] = "action_dtmf" + config: typing.Optional[EmptyActionConfig] = None + action_trigger: typing.Optional[FunctionCallActionTrigger] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/dtmf_action_update_params.py b/src/vocode/types/dtmf_action_update_params.py index 99e6d2d..d7a0d6e 100644 --- a/src/vocode/types/dtmf_action_update_params.py +++ b/src/vocode/types/dtmf_action_update_params.py @@ -1,31 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing -import typing_extensions - -from ..core.datetime_utils import serialize_datetime from .dtmf_action_update_params_config import DtmfActionUpdateParamsConfig +from .dtmf_action_update_params_action_trigger import DtmfActionUpdateParamsActionTrigger +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class DtmfActionUpdateParams(pydantic.BaseModel): - type: typing_extensions.Literal["action_dtmf"] - config: typing.Optional[DtmfActionUpdateParamsConfig] - 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) +class DtmfActionUpdateParams(UniversalBaseModel): + type: typing.Literal["action_dtmf"] = "action_dtmf" + config: typing.Optional[DtmfActionUpdateParamsConfig] = None + action_trigger: typing.Optional[DtmfActionUpdateParamsActionTrigger] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/eleven_labs_voice_params.py b/src/vocode/types/eleven_labs_voice_params.py index 62ea04e..0936b3d 100644 --- a/src/vocode/types/eleven_labs_voice_params.py +++ b/src/vocode/types/eleven_labs_voice_params.py @@ -1,33 +1,26 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing -import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -from ..core.datetime_utils import serialize_datetime -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ElevenLabsVoiceParams(pydantic.BaseModel): - type: typing_extensions.Literal["voice_eleven_labs"] +class ElevenLabsVoiceParams(UniversalBaseModel): + type: typing.Literal["voice_eleven_labs"] = "voice_eleven_labs" voice_id: str - stability: typing.Optional[float] - similarity_boost: typing.Optional[float] - api_key: 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} + stability: typing.Optional[float] = None + similarity_boost: typing.Optional[float] = None + api_key: typing.Optional[str] = None + optimize_streaming_latency: typing.Optional[int] = None + model_id: typing.Optional[str] = None + experimental_input_streaming: typing.Optional[bool] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/vocode/types/eleven_labs_voice_update_params.py b/src/vocode/types/eleven_labs_voice_update_params.py index dfab47f..1426204 100644 --- a/src/vocode/types/eleven_labs_voice_update_params.py +++ b/src/vocode/types/eleven_labs_voice_update_params.py @@ -1,38 +1,37 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing - -import typing_extensions - -from ..core.datetime_utils import serialize_datetime -from .eleven_labs_voice_update_params_api_key import ElevenLabsVoiceUpdateParamsApiKey -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 - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ElevenLabsVoiceUpdateParams(pydantic.BaseModel): - type: typing_extensions.Literal["voice_eleven_labs"] - voice_id: typing.Optional[ElevenLabsVoiceUpdateParamsVoiceId] - stability: typing.Optional[ElevenLabsVoiceUpdateParamsStability] - similarity_boost: typing.Optional[ElevenLabsVoiceUpdateParamsSimilarityBoost] - api_key: typing.Optional[ElevenLabsVoiceUpdateParamsApiKey] - - 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} +from .eleven_labs_voice_update_params_stability import ElevenLabsVoiceUpdateParamsStability +from .eleven_labs_voice_update_params_similarity_boost import ElevenLabsVoiceUpdateParamsSimilarityBoost +from .eleven_labs_voice_update_params_api_key import ElevenLabsVoiceUpdateParamsApiKey +from .eleven_labs_voice_update_params_optimize_streaming_latency import ( + ElevenLabsVoiceUpdateParamsOptimizeStreamingLatency, +) +from .eleven_labs_voice_update_params_model_id import ElevenLabsVoiceUpdateParamsModelId +from .eleven_labs_voice_update_params_experimental_input_streaming import ( + ElevenLabsVoiceUpdateParamsExperimentalInputStreaming, +) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ElevenLabsVoiceUpdateParams(UniversalBaseModel): + type: typing.Literal["voice_eleven_labs"] = "voice_eleven_labs" + voice_id: typing.Optional[ElevenLabsVoiceUpdateParamsVoiceId] = None + stability: typing.Optional[ElevenLabsVoiceUpdateParamsStability] = None + similarity_boost: typing.Optional[ElevenLabsVoiceUpdateParamsSimilarityBoost] = None + api_key: typing.Optional[ElevenLabsVoiceUpdateParamsApiKey] = None + optimize_streaming_latency: typing.Optional[ElevenLabsVoiceUpdateParamsOptimizeStreamingLatency] = None + model_id: typing.Optional[ElevenLabsVoiceUpdateParamsModelId] = None + experimental_input_streaming: typing.Optional[ElevenLabsVoiceUpdateParamsExperimentalInputStreaming] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/vocode/types/end_conversation_action_params.py b/src/vocode/types/end_conversation_action_params.py index 60644c5..f4755fd 100644 --- a/src/vocode/types/end_conversation_action_params.py +++ b/src/vocode/types/end_conversation_action_params.py @@ -1,34 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing - -import typing_extensions - -from ..core.datetime_utils import serialize_datetime -from .end_conversation_action_action_trigger import EndConversationActionActionTrigger from .empty_action_config import EmptyActionConfig +from .end_conversation_action_params_action_trigger import EndConversationActionParamsActionTrigger +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class EndConversationActionParams(pydantic.BaseModel): - type: typing_extensions.Literal["action_end_conversation"] - config: typing.Optional[EmptyActionConfig] - action_trigger: typing.Optional[EndConversationActionActionTrigger] - 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) +class EndConversationActionParams(UniversalBaseModel): + type: typing.Literal["action_end_conversation"] = "action_end_conversation" + config: typing.Optional[EmptyActionConfig] = None + action_trigger: typing.Optional[EndConversationActionParamsActionTrigger] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/end_conversation_action_update_params.py b/src/vocode/types/end_conversation_action_update_params.py index c2fa8c7..0e41c8f 100644 --- a/src/vocode/types/end_conversation_action_update_params.py +++ b/src/vocode/types/end_conversation_action_update_params.py @@ -1,33 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing -import typing_extensions - -from ..core.datetime_utils import serialize_datetime -from .end_conversation_action_action_trigger import EndConversationActionActionTrigger from .end_conversation_action_update_params_config import EndConversationActionUpdateParamsConfig +from .end_conversation_action_update_params_action_trigger import EndConversationActionUpdateParamsActionTrigger +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class EndConversationActionUpdateParams(pydantic.BaseModel): - type: typing_extensions.Literal["action_end_conversation"] - config: typing.Optional[EndConversationActionUpdateParamsConfig] - action_trigger: typing.Optional[EndConversationActionActionTrigger] - 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) +class EndConversationActionUpdateParams(UniversalBaseModel): + type: typing.Literal["action_end_conversation"] = "action_end_conversation" + config: typing.Optional[EndConversationActionUpdateParamsConfig] = None + action_trigger: typing.Optional[EndConversationActionUpdateParamsActionTrigger] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/external_action_params.py b/src/vocode/types/external_action_params.py index 99554d8..2736ea2 100644 --- a/src/vocode/types/external_action_params.py +++ b/src/vocode/types/external_action_params.py @@ -1,42 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing - -import typing_extensions - -from ..core.datetime_utils import serialize_datetime from .external_action_config import ExternalActionConfig -from .external_action_params_action_trigger import ExternalActionParamsActionTrigger +from .function_call_action_trigger import FunctionCallActionTrigger +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ExternalActionParams(pydantic.BaseModel): - type: typing_extensions.Literal["action_external"] +class ExternalActionParams(UniversalBaseModel): + type: typing.Literal["action_external"] = "action_external" config: ExternalActionConfig - action_trigger: typing.Optional[ExternalActionParamsActionTrigger] - - 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) + action_trigger: typing.Optional[FunctionCallActionTrigger] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/external_action_update_params.py b/src/vocode/types/external_action_update_params.py index e0336cc..afd4088 100644 --- a/src/vocode/types/external_action_update_params.py +++ b/src/vocode/types/external_action_update_params.py @@ -1,44 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing - -import typing_extensions - -from ..core.datetime_utils import serialize_datetime -from .external_action_update_params_action_trigger import ( - ExternalActionUpdateParamsActionTrigger, -) from .external_action_update_params_config import ExternalActionUpdateParamsConfig +from .external_action_update_params_action_trigger import ExternalActionUpdateParamsActionTrigger +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ExternalActionUpdateParams(pydantic.BaseModel): - type: typing_extensions.Literal["action_external"] - config: typing.Optional[ExternalActionUpdateParamsConfig] - action_trigger: typing.Optional[ExternalActionUpdateParamsActionTrigger] - 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) +class ExternalActionUpdateParams(UniversalBaseModel): + type: typing.Literal["action_external"] = "action_external" + config: typing.Optional[ExternalActionUpdateParamsConfig] = None + action_trigger: typing.Optional[ExternalActionUpdateParamsActionTrigger] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/play_ht_voice_params.py b/src/vocode/types/play_ht_voice_params.py index 4cc6a58..7b49c98 100644 --- a/src/vocode/types/play_ht_voice_params.py +++ b/src/vocode/types/play_ht_voice_params.py @@ -1,32 +1,32 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing -import typing_extensions +from .play_ht_voice_params_version import PlayHtVoiceParamsVersion +from .play_ht_voice_params_quality import PlayHtVoiceParamsQuality +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -from ..core.datetime_utils import serialize_datetime -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class PlayHtVoiceParams(pydantic.BaseModel): - type: typing_extensions.Literal["voice_play_ht"] +class PlayHtVoiceParams(UniversalBaseModel): + type: typing.Literal["voice_play_ht"] = "voice_play_ht" voice_id: str - api_user_id: str - api_key: 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} + api_user_id: typing.Optional[str] = None + api_key: typing.Optional[str] = None + version: typing.Optional[PlayHtVoiceParamsVersion] = None + speed: typing.Optional[float] = None + quality: typing.Optional[PlayHtVoiceParamsQuality] = None + temperature: typing.Optional[float] = None + top_p: typing.Optional[float] = None + text_guidance: typing.Optional[float] = None + voice_guidance: typing.Optional[float] = None + experimental_remove_silence: typing.Optional[bool] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/vocode/types/play_ht_voice_update_params.py b/src/vocode/types/play_ht_voice_update_params.py index e74866f..2617129 100644 --- a/src/vocode/types/play_ht_voice_update_params.py +++ b/src/vocode/types/play_ht_voice_update_params.py @@ -1,36 +1,41 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing - -import typing_extensions - -from ..core.datetime_utils import serialize_datetime -from .play_ht_voice_update_params_api_key import PlayHtVoiceUpdateParamsApiKey -from .play_ht_voice_update_params_api_user_id import PlayHtVoiceUpdateParamsApiUserId from .play_ht_voice_update_params_voice_id import PlayHtVoiceUpdateParamsVoiceId - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class PlayHtVoiceUpdateParams(pydantic.BaseModel): - type: typing_extensions.Literal["voice_play_ht"] - voice_id: typing.Optional[PlayHtVoiceUpdateParamsVoiceId] - api_user_id: typing.Optional[PlayHtVoiceUpdateParamsApiUserId] - api_key: typing.Optional[PlayHtVoiceUpdateParamsApiKey] - - 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} +from .play_ht_voice_update_params_api_user_id import PlayHtVoiceUpdateParamsApiUserId +from .play_ht_voice_update_params_api_key import PlayHtVoiceUpdateParamsApiKey +from .play_ht_voice_update_params_version import PlayHtVoiceUpdateParamsVersion +from .play_ht_voice_update_params_speed import PlayHtVoiceUpdateParamsSpeed +from .play_ht_voice_update_params_quality import PlayHtVoiceUpdateParamsQuality +from .play_ht_voice_update_params_temperature import PlayHtVoiceUpdateParamsTemperature +from .play_ht_voice_update_params_top_p import PlayHtVoiceUpdateParamsTopP +from .play_ht_voice_update_params_text_guidance import PlayHtVoiceUpdateParamsTextGuidance +from .play_ht_voice_update_params_voice_guidance import PlayHtVoiceUpdateParamsVoiceGuidance +from .play_ht_voice_update_params_experimental_remove_silence import PlayHtVoiceUpdateParamsExperimentalRemoveSilence +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class PlayHtVoiceUpdateParams(UniversalBaseModel): + type: typing.Literal["voice_play_ht"] = "voice_play_ht" + voice_id: typing.Optional[PlayHtVoiceUpdateParamsVoiceId] = None + api_user_id: typing.Optional[PlayHtVoiceUpdateParamsApiUserId] = None + api_key: typing.Optional[PlayHtVoiceUpdateParamsApiKey] = None + version: typing.Optional[PlayHtVoiceUpdateParamsVersion] = None + speed: typing.Optional[PlayHtVoiceUpdateParamsSpeed] = None + quality: typing.Optional[PlayHtVoiceUpdateParamsQuality] = None + temperature: typing.Optional[PlayHtVoiceUpdateParamsTemperature] = None + top_p: typing.Optional[PlayHtVoiceUpdateParamsTopP] = None + text_guidance: typing.Optional[PlayHtVoiceUpdateParamsTextGuidance] = None + voice_guidance: typing.Optional[PlayHtVoiceUpdateParamsVoiceGuidance] = None + experimental_remove_silence: typing.Optional[PlayHtVoiceUpdateParamsExperimentalRemoveSilence] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/vocode/types/rime_voice_params.py b/src/vocode/types/rime_voice_params.py index 1a90aa0..09108ef 100644 --- a/src/vocode/types/rime_voice_params.py +++ b/src/vocode/types/rime_voice_params.py @@ -1,30 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing -import typing_extensions +from .rime_voice_params_model_id import RimeVoiceParamsModelId +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -from ..core.datetime_utils import serialize_datetime -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class RimeVoiceParams(pydantic.BaseModel): - type: typing_extensions.Literal["voice_rime"] +class RimeVoiceParams(UniversalBaseModel): + type: typing.Literal["voice_rime"] = "voice_rime" speaker: str + speed_alpha: typing.Optional[float] = None + model_id: typing.Optional[RimeVoiceParamsModelId] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/rime_voice_update_params.py b/src/vocode/types/rime_voice_update_params.py index ce41473..32abdd7 100644 --- a/src/vocode/types/rime_voice_update_params.py +++ b/src/vocode/types/rime_voice_update_params.py @@ -1,32 +1,25 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing - -import typing_extensions - -from ..core.datetime_utils import serialize_datetime from .rime_voice_update_params_speaker import RimeVoiceUpdateParamsSpeaker - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class RimeVoiceUpdateParams(pydantic.BaseModel): - type: typing_extensions.Literal["voice_rime"] - speaker: typing.Optional[RimeVoiceUpdateParamsSpeaker] - - 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} +from .rime_voice_update_params_speed_alpha import RimeVoiceUpdateParamsSpeedAlpha +from .rime_voice_update_params_model_id import RimeVoiceUpdateParamsModelId +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class RimeVoiceUpdateParams(UniversalBaseModel): + type: typing.Literal["voice_rime"] = "voice_rime" + speaker: typing.Optional[RimeVoiceUpdateParamsSpeaker] = None + speed_alpha: typing.Optional[RimeVoiceUpdateParamsSpeedAlpha] = None + model_id: typing.Optional[RimeVoiceUpdateParamsModelId] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[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/vocode/types/set_hold_action_params.py b/src/vocode/types/set_hold_action_params.py index ef58c9c..8ea8eab 100644 --- a/src/vocode/types/set_hold_action_params.py +++ b/src/vocode/types/set_hold_action_params.py @@ -1,33 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing -import typing_extensions - -from ..core.datetime_utils import serialize_datetime from .empty_action_config import EmptyActionConfig from .set_hold_action_params_action_trigger import SetHoldActionParamsActionTrigger +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class SetHoldActionParams(pydantic.BaseModel): - type: typing_extensions.Literal["action_set_hold"] - config: typing.Optional[EmptyActionConfig] - action_trigger: typing.Optional[SetHoldActionParamsActionTrigger] - 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) +class SetHoldActionParams(UniversalBaseModel): + type: typing.Literal["action_set_hold"] = "action_set_hold" + config: typing.Optional[EmptyActionConfig] = None + action_trigger: typing.Optional[SetHoldActionParamsActionTrigger] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/set_hold_action_update_params.py b/src/vocode/types/set_hold_action_update_params.py index 540bf67..3944759 100644 --- a/src/vocode/types/set_hold_action_update_params.py +++ b/src/vocode/types/set_hold_action_update_params.py @@ -1,33 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing -import typing_extensions - -from ..core.datetime_utils import serialize_datetime -from .set_hold_action_update_params_action_trigger import SetHoldActionUpdateParamsActionTrigger from .set_hold_action_update_params_config import SetHoldActionUpdateParamsConfig +from .set_hold_action_update_params_action_trigger import SetHoldActionUpdateParamsActionTrigger +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class SetHoldActionUpdateParams(pydantic.BaseModel): - type: typing_extensions.Literal["action_set_hold"] - config: typing.Optional[SetHoldActionUpdateParamsConfig] - action_trigger: typing.Optional[SetHoldActionUpdateParamsActionTrigger] - 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) +class SetHoldActionUpdateParams(UniversalBaseModel): + type: typing.Literal["action_set_hold"] = "action_set_hold" + config: typing.Optional[SetHoldActionUpdateParamsConfig] = None + action_trigger: typing.Optional[SetHoldActionUpdateParamsActionTrigger] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/transfer_call_action_params.py b/src/vocode/types/transfer_call_action_params.py index d736834..4834296 100644 --- a/src/vocode/types/transfer_call_action_params.py +++ b/src/vocode/types/transfer_call_action_params.py @@ -1,34 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing - -import typing_extensions - -from ..core.datetime_utils import serialize_datetime -from .transfer_call_action_action_trigger import TransferCallActionActionTrigger from .transfer_call_config import TransferCallConfig +from .transfer_call_action_params_action_trigger import TransferCallActionParamsActionTrigger +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class TransferCallActionParams(pydantic.BaseModel): - type: typing_extensions.Literal["action_transfer_call"] +class TransferCallActionParams(UniversalBaseModel): + type: typing.Literal["action_transfer_call"] = "action_transfer_call" config: TransferCallConfig - action_trigger: typing.Optional[TransferCallActionActionTrigger] - - 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) + action_trigger: typing.Optional[TransferCallActionParamsActionTrigger] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/transfer_call_action_update_params.py b/src/vocode/types/transfer_call_action_update_params.py index 41a7701..9ab6d38 100644 --- a/src/vocode/types/transfer_call_action_update_params.py +++ b/src/vocode/types/transfer_call_action_update_params.py @@ -1,33 +1,23 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt +from ..core.pydantic_utilities import UniversalBaseModel import typing -import typing_extensions - -from ..core.datetime_utils import serialize_datetime -from .transfer_call_action_action_trigger import TransferCallActionActionTrigger from .transfer_call_action_update_params_config import TransferCallActionUpdateParamsConfig +from .transfer_call_action_update_params_action_trigger import TransferCallActionUpdateParamsActionTrigger +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class TransferCallActionUpdateParams(pydantic.BaseModel): - type: typing_extensions.Literal["action_transfer_call"] - config: typing.Optional[TransferCallActionUpdateParamsConfig] - action_trigger: typing.Optional[TransferCallActionActionTrigger] - 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) +class TransferCallActionUpdateParams(UniversalBaseModel): + type: typing.Literal["action_transfer_call"] = "action_transfer_call" + config: typing.Optional[TransferCallActionUpdateParamsConfig] = None + action_trigger: typing.Optional[TransferCallActionUpdateParamsActionTrigger] = None - 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) + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vocode/types/voice_params_request.py b/src/vocode/types/voice_params_request.py index c1f0047..0eb34a4 100644 --- a/src/vocode/types/voice_params_request.py +++ b/src/vocode/types/voice_params_request.py @@ -1,52 +1,12 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -import typing_extensions - from .azure_voice_params import AzureVoiceParams from .eleven_labs_voice_params import ElevenLabsVoiceParams from .play_ht_voice_params import PlayHtVoiceParams from .rime_voice_params import RimeVoiceParams - - -class VoiceParamsRequest_VoiceAzure(AzureVoiceParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class VoiceParamsRequest_VoiceRime(RimeVoiceParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class VoiceParamsRequest_VoiceElevenLabs(ElevenLabsVoiceParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class VoiceParamsRequest_VoicePlayHt(PlayHtVoiceParams): - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - +from .vocode_voice_params import VocodeVoiceParams VoiceParamsRequest = typing.Union[ - AzureVoiceParams, - RimeVoiceParams, - ElevenLabsVoiceParams, - PlayHtVoiceParams, + AzureVoiceParams, ElevenLabsVoiceParams, PlayHtVoiceParams, RimeVoiceParams, VocodeVoiceParams ] diff --git a/src/vocode/types/voice_update_params_request.py b/src/vocode/types/voice_update_params_request.py index 183bc06..7b7a080 100644 --- a/src/vocode/types/voice_update_params_request.py +++ b/src/vocode/types/voice_update_params_request.py @@ -1,48 +1,16 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing - -import typing_extensions - from .azure_voice_update_params import AzureVoiceUpdateParams from .eleven_labs_voice_update_params import ElevenLabsVoiceUpdateParams from .play_ht_voice_update_params import PlayHtVoiceUpdateParams from .rime_voice_update_params import RimeVoiceUpdateParams - - -class VoiceUpdateParamsRequest_VoiceAzure(AzureVoiceUpdateParams): - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class VoiceUpdateParamsRequest_VoiceRime(RimeVoiceUpdateParams): - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class VoiceUpdateParamsRequest_VoiceElevenLabs(ElevenLabsVoiceUpdateParams): - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - - -class VoiceUpdateParamsRequest_VoicePlayHt(PlayHtVoiceUpdateParams): - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - +from .vocode_voice_update_params import VocodeVoiceUpdateParams VoiceUpdateParamsRequest = typing.Union[ AzureVoiceUpdateParams, - RimeVoiceUpdateParams, ElevenLabsVoiceUpdateParams, PlayHtVoiceUpdateParams, + RimeVoiceUpdateParams, + VocodeVoiceUpdateParams, ]