Skip to content

Commit

Permalink
Release 0.0.24
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Oct 5, 2023
1 parent 9e4c972 commit 055b096
Show file tree
Hide file tree
Showing 17 changed files with 120 additions and 72 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.23"
version = "0.0.24"
description = ""
readme = "README.md"
authors = []
Expand Down
16 changes: 10 additions & 6 deletions src/vocode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
AzureVoiceUpdateParamsRate,
AzureVoiceUpdateParamsVoiceName,
Call,
CallMachineDetectionResult,
CallHumanDetectionResult,
CallOnNoHumanAnswer,
CallPage,
CallStatus,
CollectField,
Expand All @@ -100,7 +101,7 @@
CreateCallAgentParamsVoiceOne_VoiceRime,
CreateCallAgentParamsWebhook,
CreateCallRequestAgent,
CreateCallRequestOnMachineAnswer,
CreateCallRequestOnNoHumanAnswer,
DtmfAction,
DtmfActionParams,
DtmfActionUpdateParams,
Expand Down Expand Up @@ -128,7 +129,8 @@
NormalizedAgentPrompt,
NormalizedAgentVectorDatabase,
NormalizedCall,
NormalizedCallMachineDetectionResult,
NormalizedCallHumanDetectionResult,
NormalizedCallOnNoHumanAnswer,
NormalizedPhoneNumber,
NormalizedPrompt,
PhoneNumber,
Expand Down Expand Up @@ -284,7 +286,8 @@
"AzureVoiceUpdateParamsRate",
"AzureVoiceUpdateParamsVoiceName",
"Call",
"CallMachineDetectionResult",
"CallHumanDetectionResult",
"CallOnNoHumanAnswer",
"CallPage",
"CallStatus",
"CollectField",
Expand All @@ -306,7 +309,7 @@
"CreateCallAgentParamsVoiceOne_VoiceRime",
"CreateCallAgentParamsWebhook",
"CreateCallRequestAgent",
"CreateCallRequestOnMachineAnswer",
"CreateCallRequestOnNoHumanAnswer",
"DtmfAction",
"DtmfActionParams",
"DtmfActionUpdateParams",
Expand Down Expand Up @@ -334,7 +337,8 @@
"NormalizedAgentPrompt",
"NormalizedAgentVectorDatabase",
"NormalizedCall",
"NormalizedCallMachineDetectionResult",
"NormalizedCallHumanDetectionResult",
"NormalizedCallOnNoHumanAnswer",
"NormalizedPhoneNumber",
"NormalizedPrompt",
"PhoneNumber",
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.23",
"X-Fern-SDK-Version": "0.0.24",
}
headers["Authorization"] = f"Bearer {self._get_token()}"
return headers
Expand Down
26 changes: 13 additions & 13 deletions src/vocode/resources/calls/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +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.create_call_request_on_no_human_answer import CreateCallRequestOnNoHumanAnswer
from ...types.http_validation_error import HttpValidationError

# this is used as the default value for optional parameters
Expand Down Expand Up @@ -99,7 +99,7 @@ def create_call(
from_number: str,
to_number: str,
agent: CreateCallRequestAgent,
on_machine_answer: typing.Optional[CreateCallRequestOnMachineAnswer] = OMIT,
on_no_human_answer: typing.Optional[CreateCallRequestOnNoHumanAnswer] = OMIT,
hipaa_compliant: typing.Optional[bool] = OMIT,
context: typing.Optional[typing.Dict[str, str]] = OMIT,
) -> Call:
Expand All @@ -111,15 +111,15 @@ def create_call(
- agent: CreateCallRequestAgent.
- on_machine_answer: typing.Optional[CreateCallRequestOnMachineAnswer].
- on_no_human_answer: typing.Optional[CreateCallRequestOnNoHumanAnswer].
- hipaa_compliant: typing.Optional[bool].
- context: typing.Optional[typing.Dict[str, str]].
"""
_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
if on_no_human_answer is not OMIT:
_request["on_no_human_answer"] = on_no_human_answer
if hipaa_compliant is not OMIT:
_request["hipaa_compliant"] = hipaa_compliant
if context is not OMIT:
Expand All @@ -141,7 +141,7 @@ def create_call(
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def get_recording(self, *, id: str) -> typing.Any:
def get_recording(self, *, id: str) -> None:
"""
Parameters:
- id: str.
Expand All @@ -154,7 +154,7 @@ def get_recording(self, *, id: str) -> typing.Any:
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
Expand Down Expand Up @@ -242,7 +242,7 @@ async def create_call(
from_number: str,
to_number: str,
agent: CreateCallRequestAgent,
on_machine_answer: typing.Optional[CreateCallRequestOnMachineAnswer] = OMIT,
on_no_human_answer: typing.Optional[CreateCallRequestOnNoHumanAnswer] = OMIT,
hipaa_compliant: typing.Optional[bool] = OMIT,
context: typing.Optional[typing.Dict[str, str]] = OMIT,
) -> Call:
Expand All @@ -254,15 +254,15 @@ async def create_call(
- agent: CreateCallRequestAgent.
- on_machine_answer: typing.Optional[CreateCallRequestOnMachineAnswer].
- on_no_human_answer: typing.Optional[CreateCallRequestOnNoHumanAnswer].
- hipaa_compliant: typing.Optional[bool].
- context: typing.Optional[typing.Dict[str, str]].
"""
_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
if on_no_human_answer is not OMIT:
_request["on_no_human_answer"] = on_no_human_answer
if hipaa_compliant is not OMIT:
_request["hipaa_compliant"] = hipaa_compliant
if context is not OMIT:
Expand All @@ -284,7 +284,7 @@ async def create_call(
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def get_recording(self, *, id: str) -> typing.Any:
async def get_recording(self, *, id: str) -> None:
"""
Parameters:
- id: str.
Expand All @@ -297,7 +297,7 @@ async def get_recording(self, *, id: str) -> typing.Any:
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
Expand Down
16 changes: 10 additions & 6 deletions src/vocode/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
from .azure_voice_update_params_rate import AzureVoiceUpdateParamsRate
from .azure_voice_update_params_voice_name import AzureVoiceUpdateParamsVoiceName
from .call import Call
from .call_machine_detection_result import CallMachineDetectionResult
from .call_human_detection_result import CallHumanDetectionResult
from .call_on_no_human_answer import CallOnNoHumanAnswer
from .call_page import CallPage
from .call_status import CallStatus
from .collect_field import CollectField
Expand All @@ -123,7 +124,7 @@
)
from .create_call_agent_params_webhook import CreateCallAgentParamsWebhook
from .create_call_request_agent import CreateCallRequestAgent
from .create_call_request_on_machine_answer import CreateCallRequestOnMachineAnswer
from .create_call_request_on_no_human_answer import CreateCallRequestOnNoHumanAnswer
from .dtmf_action import DtmfAction
from .dtmf_action_params import DtmfActionParams
from .dtmf_action_update_params import DtmfActionUpdateParams
Expand Down Expand Up @@ -151,7 +152,8 @@
from .normalized_agent_prompt import NormalizedAgentPrompt
from .normalized_agent_vector_database import NormalizedAgentVectorDatabase
from .normalized_call import NormalizedCall
from .normalized_call_machine_detection_result import NormalizedCallMachineDetectionResult
from .normalized_call_human_detection_result import NormalizedCallHumanDetectionResult
from .normalized_call_on_no_human_answer import NormalizedCallOnNoHumanAnswer
from .normalized_phone_number import NormalizedPhoneNumber
from .normalized_prompt import NormalizedPrompt
from .phone_number import PhoneNumber
Expand Down Expand Up @@ -311,7 +313,8 @@
"AzureVoiceUpdateParamsRate",
"AzureVoiceUpdateParamsVoiceName",
"Call",
"CallMachineDetectionResult",
"CallHumanDetectionResult",
"CallOnNoHumanAnswer",
"CallPage",
"CallStatus",
"CollectField",
Expand All @@ -333,7 +336,7 @@
"CreateCallAgentParamsVoiceOne_VoiceRime",
"CreateCallAgentParamsWebhook",
"CreateCallRequestAgent",
"CreateCallRequestOnMachineAnswer",
"CreateCallRequestOnNoHumanAnswer",
"DtmfAction",
"DtmfActionParams",
"DtmfActionUpdateParams",
Expand Down Expand Up @@ -361,7 +364,8 @@
"NormalizedAgentPrompt",
"NormalizedAgentVectorDatabase",
"NormalizedCall",
"NormalizedCallMachineDetectionResult",
"NormalizedCallHumanDetectionResult",
"NormalizedCallOnNoHumanAnswer",
"NormalizedPhoneNumber",
"NormalizedPrompt",
"PhoneNumber",
Expand Down
6 changes: 4 additions & 2 deletions src/vocode/types/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

from ..core.datetime_utils import serialize_datetime
from .agent import Agent
from .call_machine_detection_result import CallMachineDetectionResult
from .call_human_detection_result import CallHumanDetectionResult
from .call_on_no_human_answer import CallOnNoHumanAnswer
from .call_status import CallStatus


Expand All @@ -18,14 +19,15 @@ class Call(pydantic.BaseModel):
error_message: typing.Optional[str]
recording_available: typing.Optional[bool]
transcript: typing.Optional[str]
machine_detection_result: typing.Optional[CallMachineDetectionResult]
human_detection_result: typing.Optional[CallHumanDetectionResult]
to_number: str
from_number: str
agent: Agent
agent_phone_number: str
start_time: typing.Optional[dt.datetime]
end_time: typing.Optional[dt.datetime]
hipaa_compliant: typing.Optional[bool]
on_no_human_answer: typing.Optional[CallOnNoHumanAnswer]

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
17 changes: 17 additions & 0 deletions src/vocode/types/call_human_detection_result.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class CallHumanDetectionResult(str, enum.Enum):
HUMAN = "human"
NO_HUMAN = "no_human"

def visit(self, human: typing.Callable[[], T_Result], no_human: typing.Callable[[], T_Result]) -> T_Result:
if self is CallHumanDetectionResult.HUMAN:
return human()
if self is CallHumanDetectionResult.NO_HUMAN:
return no_human()
17 changes: 0 additions & 17 deletions src/vocode/types/call_machine_detection_result.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
T_Result = typing.TypeVar("T_Result")


class CreateCallRequestOnMachineAnswer(str, enum.Enum):
class CallOnNoHumanAnswer(str, enum.Enum):
CONTINUE = "continue"
HANGUP = "hangup"

def visit(self, continue_: typing.Callable[[], T_Result], hangup: typing.Callable[[], T_Result]) -> T_Result:
if self is CreateCallRequestOnMachineAnswer.CONTINUE:
if self is CallOnNoHumanAnswer.CONTINUE:
return continue_()
if self is CreateCallRequestOnMachineAnswer.HANGUP:
if self is CallOnNoHumanAnswer.HANGUP:
return hangup()
17 changes: 17 additions & 0 deletions src/vocode/types/create_call_request_on_no_human_answer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class CreateCallRequestOnNoHumanAnswer(str, enum.Enum):
CONTINUE = "continue"
HANGUP = "hangup"

def visit(self, continue_: typing.Callable[[], T_Result], hangup: typing.Callable[[], T_Result]) -> T_Result:
if self is CreateCallRequestOnNoHumanAnswer.CONTINUE:
return continue_()
if self is CreateCallRequestOnNoHumanAnswer.HANGUP:
return hangup()
8 changes: 4 additions & 4 deletions src/vocode/types/event_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class EventType(str, enum.Enum):
EVENT_PHONE_CALL_ENDED = "event_phone_call_ended"
EVENT_TRANSCRIPT = "event_transcript"
EVENT_RECORDING = "event_recording"
EVENT_MACHINE_DETECTION = "event_machine_detection"
EVENT_HUMAN_DETECTION = "event_human_detection"

def visit(
self,
Expand All @@ -27,7 +27,7 @@ def visit(
event_phone_call_ended: typing.Callable[[], T_Result],
event_transcript: typing.Callable[[], T_Result],
event_recording: typing.Callable[[], T_Result],
event_machine_detection: typing.Callable[[], T_Result],
event_human_detection: typing.Callable[[], T_Result],
) -> T_Result:
if self is EventType.EVENT_MESSAGE:
return event_message()
Expand All @@ -41,5 +41,5 @@ def visit(
return event_transcript()
if self is EventType.EVENT_RECORDING:
return event_recording()
if self is EventType.EVENT_MACHINE_DETECTION:
return event_machine_detection()
if self is EventType.EVENT_HUMAN_DETECTION:
return event_human_detection()
6 changes: 4 additions & 2 deletions src/vocode/types/normalized_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

from ..core.datetime_utils import serialize_datetime
from .call_status import CallStatus
from .normalized_call_machine_detection_result import NormalizedCallMachineDetectionResult
from .normalized_call_human_detection_result import NormalizedCallHumanDetectionResult
from .normalized_call_on_no_human_answer import NormalizedCallOnNoHumanAnswer


class NormalizedCall(pydantic.BaseModel):
Expand All @@ -17,14 +18,15 @@ class NormalizedCall(pydantic.BaseModel):
error_message: typing.Optional[str]
recording_available: typing.Optional[bool]
transcript: typing.Optional[str]
machine_detection_result: typing.Optional[NormalizedCallMachineDetectionResult]
human_detection_result: typing.Optional[NormalizedCallHumanDetectionResult]
to_number: str
from_number: str
agent: str
agent_phone_number: str
start_time: typing.Optional[dt.datetime]
end_time: typing.Optional[dt.datetime]
hipaa_compliant: typing.Optional[bool]
on_no_human_answer: typing.Optional[NormalizedCallOnNoHumanAnswer]

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
Loading

0 comments on commit 055b096

Please sign in to comment.