From 8b93d4c91f60bb8d1666c925b8cbed781f436c46 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Sat, 26 Aug 2023 06:32:14 +0000 Subject: [PATCH] Release 0.0.16 --- pyproject.toml | 2 +- src/vocode/__init__.py | 22 ++++++++++++++ src/vocode/core/client_wrapper.py | 2 +- src/vocode/resources/agents/client.py | 9 +++--- src/vocode/types/__init__.py | 22 ++++++++++++++ src/vocode/types/agent.py | 3 +- src/vocode/types/agent_params_prompt.py | 7 +++++ .../types/agent_update_params_prompt.py | 3 +- src/vocode/types/collect_field.py | 29 ++++++++++++++++++ src/vocode/types/collect_field_field_type.py | 19 ++++++++++++ src/vocode/types/create_call_agent_params.py | 3 +- .../types/create_call_agent_params_prompt.py | 7 +++++ src/vocode/types/normalized_agent.py | 3 +- src/vocode/types/normalized_agent_prompt.py | 7 +++++ src/vocode/types/prompt.py | 30 +++++++++++++++++++ src/vocode/types/prompt_params.py | 28 +++++++++++++++++ src/vocode/types/prompt_update_params.py | 30 +++++++++++++++++++ .../prompt_update_params_collect_fields.py | 8 +++++ .../types/prompt_update_params_content.py | 7 +++++ .../prompt_update_params_context_endpoint.py | 7 +++++ 20 files changed, 238 insertions(+), 10 deletions(-) create mode 100644 src/vocode/types/agent_params_prompt.py create mode 100644 src/vocode/types/collect_field.py create mode 100644 src/vocode/types/collect_field_field_type.py create mode 100644 src/vocode/types/create_call_agent_params_prompt.py create mode 100644 src/vocode/types/normalized_agent_prompt.py create mode 100644 src/vocode/types/prompt.py create mode 100644 src/vocode/types/prompt_params.py create mode 100644 src/vocode/types/prompt_update_params.py create mode 100644 src/vocode/types/prompt_update_params_collect_fields.py create mode 100644 src/vocode/types/prompt_update_params_content.py create mode 100644 src/vocode/types/prompt_update_params_context_endpoint.py diff --git a/pyproject.toml b/pyproject.toml index 15d6dee..8c4f4ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "vocode-api" -version = "0.0.15" +version = "0.0.16" description = "" readme = "README.md" authors = [] diff --git a/src/vocode/__init__.py b/src/vocode/__init__.py index 4e812af..2671ec6 100644 --- a/src/vocode/__init__.py +++ b/src/vocode/__init__.py @@ -29,6 +29,7 @@ AgentParamsActionsItemOne_ActionDtmf, AgentParamsActionsItemOne_ActionEndConversation, AgentParamsActionsItemOne_ActionTransferCall, + AgentParamsPrompt, AgentParamsVectorDatabase, AgentParamsVoice, AgentParamsVoiceOne, @@ -71,12 +72,15 @@ Call, CallPage, CallStatus, + CollectField, + CollectFieldFieldType, CreateCallAgentParams, CreateCallAgentParamsActionsItem, CreateCallAgentParamsActionsItemOne, CreateCallAgentParamsActionsItemOne_ActionDtmf, CreateCallAgentParamsActionsItemOne_ActionEndConversation, CreateCallAgentParamsActionsItemOne_ActionTransferCall, + CreateCallAgentParamsPrompt, CreateCallAgentParamsVectorDatabase, CreateCallAgentParamsVoice, CreateCallAgentParamsVoiceOne, @@ -108,6 +112,7 @@ InterruptSensitivity, Language, NormalizedAgent, + NormalizedAgentPrompt, NormalizedAgentVectorDatabase, NormalizedCall, NormalizedPhoneNumber, @@ -126,6 +131,12 @@ PlayHtVoiceUpdateParamsApiKey, PlayHtVoiceUpdateParamsApiUserId, PlayHtVoiceUpdateParamsVoiceId, + Prompt, + PromptParams, + PromptUpdateParams, + PromptUpdateParamsCollectFields, + PromptUpdateParamsContent, + PromptUpdateParamsContextEndpoint, RimeVoice, RimeVoiceParams, RimeVoiceUpdateParams, @@ -203,6 +214,7 @@ "AgentParamsActionsItemOne_ActionDtmf", "AgentParamsActionsItemOne_ActionEndConversation", "AgentParamsActionsItemOne_ActionTransferCall", + "AgentParamsPrompt", "AgentParamsVectorDatabase", "AgentParamsVoice", "AgentParamsVoiceOne", @@ -245,12 +257,15 @@ "Call", "CallPage", "CallStatus", + "CollectField", + "CollectFieldFieldType", "CreateCallAgentParams", "CreateCallAgentParamsActionsItem", "CreateCallAgentParamsActionsItemOne", "CreateCallAgentParamsActionsItemOne_ActionDtmf", "CreateCallAgentParamsActionsItemOne_ActionEndConversation", "CreateCallAgentParamsActionsItemOne_ActionTransferCall", + "CreateCallAgentParamsPrompt", "CreateCallAgentParamsVectorDatabase", "CreateCallAgentParamsVoice", "CreateCallAgentParamsVoiceOne", @@ -282,6 +297,7 @@ "InterruptSensitivity", "Language", "NormalizedAgent", + "NormalizedAgentPrompt", "NormalizedAgentVectorDatabase", "NormalizedCall", "NormalizedPhoneNumber", @@ -300,6 +316,12 @@ "PlayHtVoiceUpdateParamsApiKey", "PlayHtVoiceUpdateParamsApiUserId", "PlayHtVoiceUpdateParamsVoiceId", + "Prompt", + "PromptParams", + "PromptUpdateParams", + "PromptUpdateParamsCollectFields", + "PromptUpdateParamsContent", + "PromptUpdateParamsContextEndpoint", "RimeVoice", "RimeVoiceParams", "RimeVoiceUpdateParams", diff --git a/src/vocode/core/client_wrapper.py b/src/vocode/core/client_wrapper.py index 8df2532..c6c2abb 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.15", + "X-Fern-SDK-Version": "0.0.16", } 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 79b6cce..0f564a3 100644 --- a/src/vocode/resources/agents/client.py +++ b/src/vocode/resources/agents/client.py @@ -14,6 +14,7 @@ from ...types.agent import Agent from ...types.agent_page import AgentPage from ...types.agent_params_actions_item import AgentParamsActionsItem +from ...types.agent_params_prompt import AgentParamsPrompt from ...types.agent_params_vector_database import AgentParamsVectorDatabase from ...types.agent_params_voice import AgentParamsVoice from ...types.agent_params_webhook import AgentParamsWebhook @@ -79,7 +80,7 @@ def list_agents(self, *, page: typing.Optional[int] = None, size: typing.Optiona def create_agent( self, *, - prompt: str, + prompt: AgentParamsPrompt, language: typing.Optional[Language] = OMIT, actions: typing.Optional[typing.List[AgentParamsActionsItem]] = OMIT, voice: AgentParamsVoice, @@ -91,7 +92,7 @@ def create_agent( ) -> Agent: """ Parameters: - - prompt: str. + - prompt: AgentParamsPrompt. - language: typing.Optional[Language]. @@ -220,7 +221,7 @@ async def list_agents(self, *, page: typing.Optional[int] = None, size: typing.O async def create_agent( self, *, - prompt: str, + prompt: AgentParamsPrompt, language: typing.Optional[Language] = OMIT, actions: typing.Optional[typing.List[AgentParamsActionsItem]] = OMIT, voice: AgentParamsVoice, @@ -232,7 +233,7 @@ async def create_agent( ) -> Agent: """ Parameters: - - prompt: str. + - prompt: AgentParamsPrompt. - language: typing.Optional[Language]. diff --git a/src/vocode/types/__init__.py b/src/vocode/types/__init__.py index 0d3c30d..591c3fe 100644 --- a/src/vocode/types/__init__.py +++ b/src/vocode/types/__init__.py @@ -40,6 +40,7 @@ AgentParamsActionsItemOne_ActionEndConversation, AgentParamsActionsItemOne_ActionTransferCall, ) +from .agent_params_prompt import AgentParamsPrompt from .agent_params_vector_database import AgentParamsVectorDatabase from .agent_params_voice import AgentParamsVoice from .agent_params_voice_one import ( @@ -90,6 +91,8 @@ from .call import Call from .call_page import CallPage from .call_status import CallStatus +from .collect_field import CollectField +from .collect_field_field_type import CollectFieldFieldType from .create_call_agent_params import CreateCallAgentParams from .create_call_agent_params_actions_item import CreateCallAgentParamsActionsItem from .create_call_agent_params_actions_item_one import ( @@ -98,6 +101,7 @@ CreateCallAgentParamsActionsItemOne_ActionEndConversation, CreateCallAgentParamsActionsItemOne_ActionTransferCall, ) +from .create_call_agent_params_prompt import CreateCallAgentParamsPrompt from .create_call_agent_params_vector_database import CreateCallAgentParamsVectorDatabase from .create_call_agent_params_voice import CreateCallAgentParamsVoice from .create_call_agent_params_voice_one import ( @@ -131,6 +135,7 @@ from .interrupt_sensitivity import InterruptSensitivity from .language import Language from .normalized_agent import NormalizedAgent +from .normalized_agent_prompt import NormalizedAgentPrompt from .normalized_agent_vector_database import NormalizedAgentVectorDatabase from .normalized_call import NormalizedCall from .normalized_phone_number import NormalizedPhoneNumber @@ -149,6 +154,12 @@ 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 +from .prompt import Prompt +from .prompt_params import PromptParams +from .prompt_update_params import PromptUpdateParams +from .prompt_update_params_collect_fields import PromptUpdateParamsCollectFields +from .prompt_update_params_content import PromptUpdateParamsContent +from .prompt_update_params_context_endpoint import PromptUpdateParamsContextEndpoint from .rime_voice import RimeVoice from .rime_voice_params import RimeVoiceParams from .rime_voice_update_params import RimeVoiceUpdateParams @@ -230,6 +241,7 @@ "AgentParamsActionsItemOne_ActionDtmf", "AgentParamsActionsItemOne_ActionEndConversation", "AgentParamsActionsItemOne_ActionTransferCall", + "AgentParamsPrompt", "AgentParamsVectorDatabase", "AgentParamsVoice", "AgentParamsVoiceOne", @@ -272,12 +284,15 @@ "Call", "CallPage", "CallStatus", + "CollectField", + "CollectFieldFieldType", "CreateCallAgentParams", "CreateCallAgentParamsActionsItem", "CreateCallAgentParamsActionsItemOne", "CreateCallAgentParamsActionsItemOne_ActionDtmf", "CreateCallAgentParamsActionsItemOne_ActionEndConversation", "CreateCallAgentParamsActionsItemOne_ActionTransferCall", + "CreateCallAgentParamsPrompt", "CreateCallAgentParamsVectorDatabase", "CreateCallAgentParamsVoice", "CreateCallAgentParamsVoiceOne", @@ -309,6 +324,7 @@ "InterruptSensitivity", "Language", "NormalizedAgent", + "NormalizedAgentPrompt", "NormalizedAgentVectorDatabase", "NormalizedCall", "NormalizedPhoneNumber", @@ -327,6 +343,12 @@ "PlayHtVoiceUpdateParamsApiKey", "PlayHtVoiceUpdateParamsApiUserId", "PlayHtVoiceUpdateParamsVoiceId", + "Prompt", + "PromptParams", + "PromptUpdateParams", + "PromptUpdateParamsCollectFields", + "PromptUpdateParamsContent", + "PromptUpdateParamsContextEndpoint", "RimeVoice", "RimeVoiceParams", "RimeVoiceUpdateParams", diff --git a/src/vocode/types/agent.py b/src/vocode/types/agent.py index aa775d8..8ac154e 100644 --- a/src/vocode/types/agent.py +++ b/src/vocode/types/agent.py @@ -11,13 +11,14 @@ from .interrupt_sensitivity import InterruptSensitivity from .language import Language from .pinecone_vector_database import PineconeVectorDatabase +from .prompt import Prompt from .webhook import Webhook class Agent(pydantic.BaseModel): id: str user_id: str - prompt: str + prompt: Prompt language: typing.Optional[Language] actions: typing.List[AgentActionsItem] voice: AgentVoice diff --git a/src/vocode/types/agent_params_prompt.py b/src/vocode/types/agent_params_prompt.py new file mode 100644 index 0000000..bfd3991 --- /dev/null +++ b/src/vocode/types/agent_params_prompt.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .prompt_params import PromptParams + +AgentParamsPrompt = typing.Union[str, PromptParams] diff --git a/src/vocode/types/agent_update_params_prompt.py b/src/vocode/types/agent_update_params_prompt.py index 0467de3..4acdb52 100644 --- a/src/vocode/types/agent_update_params_prompt.py +++ b/src/vocode/types/agent_update_params_prompt.py @@ -2,6 +2,7 @@ import typing +from .prompt_update_params import PromptUpdateParams from .undefined import Undefined -AgentUpdateParamsPrompt = typing.Union[str, Undefined] +AgentUpdateParamsPrompt = typing.Union[str, PromptUpdateParams, Undefined] diff --git a/src/vocode/types/collect_field.py b/src/vocode/types/collect_field.py new file mode 100644 index 0000000..ace217c --- /dev/null +++ b/src/vocode/types/collect_field.py @@ -0,0 +1,29 @@ +# 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 .collect_field_field_type import CollectFieldFieldType + + +class CollectField(pydantic.BaseModel): + field_type: CollectFieldFieldType + label: str + name: str + description: 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/collect_field_field_type.py b/src/vocode/types/collect_field_field_type.py new file mode 100644 index 0000000..265cc28 --- /dev/null +++ b/src/vocode/types/collect_field_field_type.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class CollectFieldFieldType(str, enum.Enum): + FIELD_TYPE_EMAIL = "field_type_email" + FIELD_TYPE_ADDRESS = "field_type_address" + + def visit( + self, field_type_email: typing.Callable[[], T_Result], field_type_address: typing.Callable[[], T_Result] + ) -> T_Result: + if self is CollectFieldFieldType.FIELD_TYPE_EMAIL: + return field_type_email() + if self is CollectFieldFieldType.FIELD_TYPE_ADDRESS: + return field_type_address() diff --git a/src/vocode/types/create_call_agent_params.py b/src/vocode/types/create_call_agent_params.py index 96eedd6..712c131 100644 --- a/src/vocode/types/create_call_agent_params.py +++ b/src/vocode/types/create_call_agent_params.py @@ -7,6 +7,7 @@ from ..core.datetime_utils import serialize_datetime from .create_call_agent_params_actions_item import CreateCallAgentParamsActionsItem +from .create_call_agent_params_prompt import CreateCallAgentParamsPrompt from .create_call_agent_params_vector_database import CreateCallAgentParamsVectorDatabase from .create_call_agent_params_voice import CreateCallAgentParamsVoice from .create_call_agent_params_webhook import CreateCallAgentParamsWebhook @@ -15,7 +16,7 @@ class CreateCallAgentParams(pydantic.BaseModel): - prompt: str + prompt: CreateCallAgentParamsPrompt language: typing.Optional[Language] actions: typing.Optional[typing.List[CreateCallAgentParamsActionsItem]] voice: typing.Optional[CreateCallAgentParamsVoice] diff --git a/src/vocode/types/create_call_agent_params_prompt.py b/src/vocode/types/create_call_agent_params_prompt.py new file mode 100644 index 0000000..cdfc80d --- /dev/null +++ b/src/vocode/types/create_call_agent_params_prompt.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .prompt_params import PromptParams + +CreateCallAgentParamsPrompt = typing.Union[str, PromptParams] diff --git a/src/vocode/types/normalized_agent.py b/src/vocode/types/normalized_agent.py index 7129367..acb221f 100644 --- a/src/vocode/types/normalized_agent.py +++ b/src/vocode/types/normalized_agent.py @@ -8,13 +8,14 @@ from ..core.datetime_utils import serialize_datetime from .interrupt_sensitivity import InterruptSensitivity from .language import Language +from .normalized_agent_prompt import NormalizedAgentPrompt from .normalized_agent_vector_database import NormalizedAgentVectorDatabase class NormalizedAgent(pydantic.BaseModel): id: str user_id: str - prompt: str + prompt: NormalizedAgentPrompt language: typing.Optional[Language] actions: typing.List[str] voice: str diff --git a/src/vocode/types/normalized_agent_prompt.py b/src/vocode/types/normalized_agent_prompt.py new file mode 100644 index 0000000..beabf44 --- /dev/null +++ b/src/vocode/types/normalized_agent_prompt.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .prompt_params import PromptParams + +NormalizedAgentPrompt = typing.Union[str, PromptParams] diff --git a/src/vocode/types/prompt.py b/src/vocode/types/prompt.py new file mode 100644 index 0000000..775a98d --- /dev/null +++ b/src/vocode/types/prompt.py @@ -0,0 +1,30 @@ +# 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 .collect_field import CollectField + + +class Prompt(pydantic.BaseModel): + id: str + user_id: str + content: str + collect_fields: typing.Optional[typing.List[CollectField]] + context_endpoint: 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/prompt_params.py b/src/vocode/types/prompt_params.py new file mode 100644 index 0000000..4145dbd --- /dev/null +++ b/src/vocode/types/prompt_params.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 .collect_field import CollectField + + +class PromptParams(pydantic.BaseModel): + content: str + collect_fields: typing.Optional[typing.List[CollectField]] + context_endpoint: 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/prompt_update_params.py b/src/vocode/types/prompt_update_params.py new file mode 100644 index 0000000..3b5dd64 --- /dev/null +++ b/src/vocode/types/prompt_update_params.py @@ -0,0 +1,30 @@ +# 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 .prompt_update_params_collect_fields import PromptUpdateParamsCollectFields +from .prompt_update_params_content import PromptUpdateParamsContent +from .prompt_update_params_context_endpoint import PromptUpdateParamsContextEndpoint + + +class PromptUpdateParams(pydantic.BaseModel): + content: typing.Optional[PromptUpdateParamsContent] + collect_fields: typing.Optional[PromptUpdateParamsCollectFields] + context_endpoint: typing.Optional[PromptUpdateParamsContextEndpoint] + + 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/prompt_update_params_collect_fields.py b/src/vocode/types/prompt_update_params_collect_fields.py new file mode 100644 index 0000000..7cfcffd --- /dev/null +++ b/src/vocode/types/prompt_update_params_collect_fields.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .collect_field import CollectField +from .undefined import Undefined + +PromptUpdateParamsCollectFields = typing.Union[typing.List[CollectField], Undefined] diff --git a/src/vocode/types/prompt_update_params_content.py b/src/vocode/types/prompt_update_params_content.py new file mode 100644 index 0000000..f2f7a3d --- /dev/null +++ b/src/vocode/types/prompt_update_params_content.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .undefined import Undefined + +PromptUpdateParamsContent = typing.Union[str, Undefined] diff --git a/src/vocode/types/prompt_update_params_context_endpoint.py b/src/vocode/types/prompt_update_params_context_endpoint.py new file mode 100644 index 0000000..ee9b9db --- /dev/null +++ b/src/vocode/types/prompt_update_params_context_endpoint.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .undefined import Undefined + +PromptUpdateParamsContextEndpoint = typing.Union[str, Undefined]