Skip to content

Commit

Permalink
Release 0.0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Sep 6, 2023
1 parent 49d2593 commit 4f97e9c
Show file tree
Hide file tree
Showing 25 changed files with 255 additions and 32 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "vocode-api"
version = "0.0.18"
version = "0.0.19"
description = ""
readme = "README.md"
authors = []
Expand Down
20 changes: 18 additions & 2 deletions src/vocode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
AgentActionsItem_ActionDtmf,
AgentActionsItem_ActionEndConversation,
AgentActionsItem_ActionTransferCall,
AgentEndpointingSensitivity,
AgentPage,
AgentParamsActionsItem,
AgentParamsActionsItemOne,
AgentParamsActionsItemOne_ActionDtmf,
AgentParamsActionsItemOne_ActionEndConversation,
AgentParamsActionsItemOne_ActionTransferCall,
AgentParamsEndpointingSensitivity,
AgentParamsPrompt,
AgentParamsVectorDatabase,
AgentParamsVoice,
Expand All @@ -46,9 +48,11 @@
AgentUpdateParamsActionsItemOne_ActionEndConversation,
AgentUpdateParamsActionsItemOne_ActionTransferCall,
AgentUpdateParamsContextEndpoint,
AgentUpdateParamsEndpointingSensitivity,
AgentUpdateParamsInitialMessage,
AgentUpdateParamsInterruptSensitivity,
AgentUpdateParamsLanguage,
AgentUpdateParamsNoiseSuppression,
AgentUpdateParamsPrompt,
AgentUpdateParamsVectorDatabase,
AgentUpdateParamsVoice,
Expand All @@ -70,16 +74,17 @@
AzureVoiceUpdateParamsRate,
AzureVoiceUpdateParamsVoiceName,
Call,
CallMachineDetectionResult,
CallPage,
CallStatus,
CollectField,
CollectFieldFieldType,
CreateCallAgentParams,
CreateCallAgentParamsActionsItem,
CreateCallAgentParamsActionsItemOne,
CreateCallAgentParamsActionsItemOne_ActionDtmf,
CreateCallAgentParamsActionsItemOne_ActionEndConversation,
CreateCallAgentParamsActionsItemOne_ActionTransferCall,
CreateCallAgentParamsEndpointingSensitivity,
CreateCallAgentParamsPrompt,
CreateCallAgentParamsVectorDatabase,
CreateCallAgentParamsVoice,
Expand All @@ -90,6 +95,7 @@
CreateCallAgentParamsVoiceOne_VoiceRime,
CreateCallAgentParamsWebhook,
CreateCallRequestAgent,
CreateCallRequestOnMachineAnswer,
DtmfAction,
DtmfActionParams,
DtmfActionUpdateParams,
Expand All @@ -112,9 +118,11 @@
InterruptSensitivity,
Language,
NormalizedAgent,
NormalizedAgentEndpointingSensitivity,
NormalizedAgentPrompt,
NormalizedAgentVectorDatabase,
NormalizedCall,
NormalizedCallMachineDetectionResult,
NormalizedPhoneNumber,
PhoneNumber,
PhoneNumberPage,
Expand Down Expand Up @@ -210,12 +218,14 @@
"AgentActionsItem_ActionDtmf",
"AgentActionsItem_ActionEndConversation",
"AgentActionsItem_ActionTransferCall",
"AgentEndpointingSensitivity",
"AgentPage",
"AgentParamsActionsItem",
"AgentParamsActionsItemOne",
"AgentParamsActionsItemOne_ActionDtmf",
"AgentParamsActionsItemOne_ActionEndConversation",
"AgentParamsActionsItemOne_ActionTransferCall",
"AgentParamsEndpointingSensitivity",
"AgentParamsPrompt",
"AgentParamsVectorDatabase",
"AgentParamsVoice",
Expand All @@ -233,9 +243,11 @@
"AgentUpdateParamsActionsItemOne_ActionEndConversation",
"AgentUpdateParamsActionsItemOne_ActionTransferCall",
"AgentUpdateParamsContextEndpoint",
"AgentUpdateParamsEndpointingSensitivity",
"AgentUpdateParamsInitialMessage",
"AgentUpdateParamsInterruptSensitivity",
"AgentUpdateParamsLanguage",
"AgentUpdateParamsNoiseSuppression",
"AgentUpdateParamsPrompt",
"AgentUpdateParamsVectorDatabase",
"AgentUpdateParamsVoice",
Expand All @@ -257,16 +269,17 @@
"AzureVoiceUpdateParamsRate",
"AzureVoiceUpdateParamsVoiceName",
"Call",
"CallMachineDetectionResult",
"CallPage",
"CallStatus",
"CollectField",
"CollectFieldFieldType",
"CreateCallAgentParams",
"CreateCallAgentParamsActionsItem",
"CreateCallAgentParamsActionsItemOne",
"CreateCallAgentParamsActionsItemOne_ActionDtmf",
"CreateCallAgentParamsActionsItemOne_ActionEndConversation",
"CreateCallAgentParamsActionsItemOne_ActionTransferCall",
"CreateCallAgentParamsEndpointingSensitivity",
"CreateCallAgentParamsPrompt",
"CreateCallAgentParamsVectorDatabase",
"CreateCallAgentParamsVoice",
Expand All @@ -277,6 +290,7 @@
"CreateCallAgentParamsVoiceOne_VoiceRime",
"CreateCallAgentParamsWebhook",
"CreateCallRequestAgent",
"CreateCallRequestOnMachineAnswer",
"DtmfAction",
"DtmfActionParams",
"DtmfActionUpdateParams",
Expand All @@ -299,9 +313,11 @@
"InterruptSensitivity",
"Language",
"NormalizedAgent",
"NormalizedAgentEndpointingSensitivity",
"NormalizedAgentPrompt",
"NormalizedAgentVectorDatabase",
"NormalizedCall",
"NormalizedCallMachineDetectionResult",
"NormalizedPhoneNumber",
"PhoneNumber",
"PhoneNumberPage",
Expand Down
2 changes: 1 addition & 1 deletion src/vocode/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.18",
"X-Fern-SDK-Version": "0.0.19",
}
headers["Authorization"] = f"Bearer {self._get_token()}"
return headers
Expand Down
21 changes: 21 additions & 0 deletions src/vocode/resources/agents/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_endpointing_sensitivity import AgentParamsEndpointingSensitivity
from ...types.agent_params_prompt import AgentParamsPrompt
from ...types.agent_params_vector_database import AgentParamsVectorDatabase
from ...types.agent_params_voice import AgentParamsVoice
Expand Down Expand Up @@ -89,6 +90,8 @@ def create_agent(
vector_database: typing.Optional[AgentParamsVectorDatabase] = OMIT,
interrupt_sensitivity: typing.Optional[InterruptSensitivity] = OMIT,
context_endpoint: typing.Optional[str] = OMIT,
noise_suppression: typing.Optional[bool] = OMIT,
endpointing_sensitivity: typing.Optional[AgentParamsEndpointingSensitivity] = OMIT,
) -> Agent:
"""
Parameters:
Expand All @@ -109,6 +112,10 @@ def create_agent(
- interrupt_sensitivity: typing.Optional[InterruptSensitivity].
- context_endpoint: typing.Optional[str].
- noise_suppression: typing.Optional[bool].
- endpointing_sensitivity: typing.Optional[AgentParamsEndpointingSensitivity].
"""
_request: typing.Dict[str, typing.Any] = {"prompt": prompt, "voice": voice}
if language is not OMIT:
Expand All @@ -125,6 +132,10 @@ def create_agent(
_request["interrupt_sensitivity"] = interrupt_sensitivity
if context_endpoint is not OMIT:
_request["context_endpoint"] = context_endpoint
if noise_suppression is not OMIT:
_request["noise_suppression"] = noise_suppression
if endpointing_sensitivity is not OMIT:
_request["endpointing_sensitivity"] = endpointing_sensitivity
_response = self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/agents/create"),
Expand Down Expand Up @@ -230,6 +241,8 @@ async def create_agent(
vector_database: typing.Optional[AgentParamsVectorDatabase] = OMIT,
interrupt_sensitivity: typing.Optional[InterruptSensitivity] = OMIT,
context_endpoint: typing.Optional[str] = OMIT,
noise_suppression: typing.Optional[bool] = OMIT,
endpointing_sensitivity: typing.Optional[AgentParamsEndpointingSensitivity] = OMIT,
) -> Agent:
"""
Parameters:
Expand All @@ -250,6 +263,10 @@ async def create_agent(
- interrupt_sensitivity: typing.Optional[InterruptSensitivity].
- context_endpoint: typing.Optional[str].
- noise_suppression: typing.Optional[bool].
- endpointing_sensitivity: typing.Optional[AgentParamsEndpointingSensitivity].
"""
_request: typing.Dict[str, typing.Any] = {"prompt": prompt, "voice": voice}
if language is not OMIT:
Expand All @@ -266,6 +283,10 @@ async def create_agent(
_request["interrupt_sensitivity"] = interrupt_sensitivity
if context_endpoint is not OMIT:
_request["context_endpoint"] = context_endpoint
if noise_suppression is not OMIT:
_request["noise_suppression"] = noise_suppression
if endpointing_sensitivity is not OMIT:
_request["endpointing_sensitivity"] = endpointing_sensitivity
_response = await self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/agents/create"),
Expand Down
33 changes: 29 additions & 4 deletions src/vocode/resources/calls/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from ...types.call import Call
from ...types.call_page import CallPage
from ...types.create_call_request_agent import CreateCallRequestAgent
from ...types.create_call_request_on_machine_answer import CreateCallRequestOnMachineAnswer
from ...types.http_validation_error import HttpValidationError

# this is used as the default value for optional parameters
Expand Down Expand Up @@ -92,19 +93,31 @@ def end_call(self, *, id: str) -> Call:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def create_call(self, *, from_number: str, to_number: str, agent: CreateCallRequestAgent) -> Call:
def create_call(
self,
*,
from_number: str,
to_number: str,
agent: CreateCallRequestAgent,
on_machine_answer: typing.Optional[CreateCallRequestOnMachineAnswer] = OMIT,
) -> Call:
"""
Parameters:
- from_number: str.
- to_number: str.
- agent: CreateCallRequestAgent.
- on_machine_answer: typing.Optional[CreateCallRequestOnMachineAnswer].
"""
_request: typing.Dict[str, typing.Any] = {"from_number": from_number, "to_number": to_number, "agent": agent}
if on_machine_answer is not OMIT:
_request["on_machine_answer"] = on_machine_answer
_response = self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/calls/create"),
json=jsonable_encoder({"from_number": from_number, "to_number": to_number, "agent": agent}),
json=jsonable_encoder(_request),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -213,19 +226,31 @@ async def end_call(self, *, id: str) -> Call:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def create_call(self, *, from_number: str, to_number: str, agent: CreateCallRequestAgent) -> Call:
async def create_call(
self,
*,
from_number: str,
to_number: str,
agent: CreateCallRequestAgent,
on_machine_answer: typing.Optional[CreateCallRequestOnMachineAnswer] = OMIT,
) -> Call:
"""
Parameters:
- from_number: str.
- to_number: str.
- agent: CreateCallRequestAgent.
- on_machine_answer: typing.Optional[CreateCallRequestOnMachineAnswer].
"""
_request: typing.Dict[str, typing.Any] = {"from_number": from_number, "to_number": to_number, "agent": agent}
if on_machine_answer is not OMIT:
_request["on_machine_answer"] = on_machine_answer
_response = await self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/calls/create"),
json=jsonable_encoder({"from_number": from_number, "to_number": to_number, "agent": agent}),
json=jsonable_encoder(_request),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down
Loading

0 comments on commit 4f97e9c

Please sign in to comment.