Skip to content

Commit

Permalink
Release 0.0.23
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Sep 26, 2023
1 parent 6033e13 commit 9e4c972
Show file tree
Hide file tree
Showing 15 changed files with 117 additions and 7 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.22"
version = "0.0.23"
description = ""
readme = "README.md"
authors = []
Expand Down
8 changes: 8 additions & 0 deletions src/vocode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
NormalizedCall,
NormalizedCallMachineDetectionResult,
NormalizedPhoneNumber,
NormalizedPrompt,
PhoneNumber,
PhoneNumberPage,
PineconeVectorDatabase,
Expand All @@ -148,10 +149,13 @@
Prompt,
PromptPage,
PromptParams,
PromptParamsPromptTemplate,
PromptTemplate,
PromptUpdateParams,
PromptUpdateParamsCollectFields,
PromptUpdateParamsContent,
PromptUpdateParamsContextEndpoint,
PromptUpdateParamsPromptTemplate,
RimeVoice,
RimeVoiceParams,
RimeVoiceUpdateParams,
Expand Down Expand Up @@ -332,6 +336,7 @@
"NormalizedCall",
"NormalizedCallMachineDetectionResult",
"NormalizedPhoneNumber",
"NormalizedPrompt",
"PhoneNumber",
"PhoneNumberPage",
"PineconeVectorDatabase",
Expand All @@ -350,10 +355,13 @@
"Prompt",
"PromptPage",
"PromptParams",
"PromptParamsPromptTemplate",
"PromptTemplate",
"PromptUpdateParams",
"PromptUpdateParamsCollectFields",
"PromptUpdateParamsContent",
"PromptUpdateParamsContextEndpoint",
"PromptUpdateParamsPromptTemplate",
"RimeVoice",
"RimeVoiceParams",
"RimeVoiceUpdateParams",
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.22",
"X-Fern-SDK-Version": "0.0.23",
}
headers["Authorization"] = f"Bearer {self._get_token()}"
return headers
Expand Down
10 changes: 10 additions & 0 deletions src/vocode/resources/calls/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def create_call(
agent: CreateCallRequestAgent,
on_machine_answer: typing.Optional[CreateCallRequestOnMachineAnswer] = OMIT,
hipaa_compliant: typing.Optional[bool] = OMIT,
context: typing.Optional[typing.Dict[str, str]] = OMIT,
) -> Call:
"""
Parameters:
Expand All @@ -113,12 +114,16 @@ def create_call(
- on_machine_answer: typing.Optional[CreateCallRequestOnMachineAnswer].
- 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 hipaa_compliant is not OMIT:
_request["hipaa_compliant"] = hipaa_compliant
if context is not OMIT:
_request["context"] = context
_response = self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/calls/create"),
Expand Down Expand Up @@ -239,6 +244,7 @@ async def create_call(
agent: CreateCallRequestAgent,
on_machine_answer: typing.Optional[CreateCallRequestOnMachineAnswer] = OMIT,
hipaa_compliant: typing.Optional[bool] = OMIT,
context: typing.Optional[typing.Dict[str, str]] = OMIT,
) -> Call:
"""
Parameters:
Expand All @@ -251,12 +257,16 @@ async def create_call(
- on_machine_answer: typing.Optional[CreateCallRequestOnMachineAnswer].
- 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 hipaa_compliant is not OMIT:
_request["hipaa_compliant"] = hipaa_compliant
if context is not OMIT:
_request["context"] = context
_response = await self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/calls/create"),
Expand Down
8 changes: 8 additions & 0 deletions src/vocode/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
from .normalized_call import NormalizedCall
from .normalized_call_machine_detection_result import NormalizedCallMachineDetectionResult
from .normalized_phone_number import NormalizedPhoneNumber
from .normalized_prompt import NormalizedPrompt
from .phone_number import PhoneNumber
from .phone_number_page import PhoneNumberPage
from .pinecone_vector_database import PineconeVectorDatabase
Expand All @@ -171,10 +172,13 @@
from .prompt import Prompt
from .prompt_page import PromptPage
from .prompt_params import PromptParams
from .prompt_params_prompt_template import PromptParamsPromptTemplate
from .prompt_template import PromptTemplate
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 .prompt_update_params_prompt_template import PromptUpdateParamsPromptTemplate
from .rime_voice import RimeVoice
from .rime_voice_params import RimeVoiceParams
from .rime_voice_update_params import RimeVoiceUpdateParams
Expand Down Expand Up @@ -359,6 +363,7 @@
"NormalizedCall",
"NormalizedCallMachineDetectionResult",
"NormalizedPhoneNumber",
"NormalizedPrompt",
"PhoneNumber",
"PhoneNumberPage",
"PineconeVectorDatabase",
Expand All @@ -377,10 +382,13 @@
"Prompt",
"PromptPage",
"PromptParams",
"PromptParamsPromptTemplate",
"PromptTemplate",
"PromptUpdateParams",
"PromptUpdateParamsCollectFields",
"PromptUpdateParamsContent",
"PromptUpdateParamsContextEndpoint",
"PromptUpdateParamsPromptTemplate",
"RimeVoice",
"RimeVoiceParams",
"RimeVoiceUpdateParams",
Expand Down
31 changes: 31 additions & 0 deletions src/vocode/types/normalized_prompt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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 NormalizedPrompt(pydantic.BaseModel):
id: str
user_id: str
content: typing.Optional[str]
collect_fields: typing.Optional[typing.List[CollectField]]
context_endpoint: typing.Optional[str]
prompt_template: 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}
4 changes: 4 additions & 0 deletions src/vocode/types/plan_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,20 @@ class PlanType(str, enum.Enum):
PLAN_FREE = "plan_free"
PLAN_DEVELOPER = "plan_developer"
PLAN_ENTERPRISE = "plan_enterprise"
PLAN_UNLIMITED = "plan_unlimited"

def visit(
self,
plan_free: typing.Callable[[], T_Result],
plan_developer: typing.Callable[[], T_Result],
plan_enterprise: typing.Callable[[], T_Result],
plan_unlimited: typing.Callable[[], T_Result],
) -> T_Result:
if self is PlanType.PLAN_FREE:
return plan_free()
if self is PlanType.PLAN_DEVELOPER:
return plan_developer()
if self is PlanType.PLAN_ENTERPRISE:
return plan_enterprise()
if self is PlanType.PLAN_UNLIMITED:
return plan_unlimited()
4 changes: 3 additions & 1 deletion src/vocode/types/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@

from ..core.datetime_utils import serialize_datetime
from .collect_field import CollectField
from .prompt_template import PromptTemplate


class Prompt(pydantic.BaseModel):
id: str
user_id: str
content: str
content: typing.Optional[str]
collect_fields: typing.Optional[typing.List[CollectField]]
context_endpoint: typing.Optional[str]
prompt_template: typing.Optional[PromptTemplate]

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
4 changes: 2 additions & 2 deletions src/vocode/types/prompt_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import pydantic

from ..core.datetime_utils import serialize_datetime
from .prompt import Prompt
from .normalized_prompt import NormalizedPrompt


class PromptPage(pydantic.BaseModel):
items: typing.List[Prompt]
items: typing.List[NormalizedPrompt]
page: int
size: int
has_more: bool
Expand Down
4 changes: 3 additions & 1 deletion src/vocode/types/prompt_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@

from ..core.datetime_utils import serialize_datetime
from .collect_field import CollectField
from .prompt_params_prompt_template import PromptParamsPromptTemplate


class PromptParams(pydantic.BaseModel):
content: str
content: typing.Optional[str]
collect_fields: typing.Optional[typing.List[CollectField]]
context_endpoint: typing.Optional[str]
prompt_template: typing.Optional[PromptParamsPromptTemplate]

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

import typing

from .prompt_template import PromptTemplate

PromptParamsPromptTemplate = typing.Union[str, PromptTemplate]
28 changes: 28 additions & 0 deletions src/vocode/types/prompt_template.py
Original file line number Diff line number Diff line change
@@ -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


class PromptTemplate(pydantic.BaseModel):
id: str
user_id: str
label: typing.Optional[str]
required_context_keys: typing.List[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}
2 changes: 2 additions & 0 deletions src/vocode/types/prompt_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
from .prompt_update_params_collect_fields import PromptUpdateParamsCollectFields
from .prompt_update_params_content import PromptUpdateParamsContent
from .prompt_update_params_context_endpoint import PromptUpdateParamsContextEndpoint
from .prompt_update_params_prompt_template import PromptUpdateParamsPromptTemplate


class PromptUpdateParams(pydantic.BaseModel):
content: typing.Optional[PromptUpdateParamsContent]
collect_fields: typing.Optional[PromptUpdateParamsCollectFields]
context_endpoint: typing.Optional[PromptUpdateParamsContextEndpoint]
prompt_template: typing.Optional[PromptUpdateParamsPromptTemplate]

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

import typing

from .prompt_template import PromptTemplate
from .undefined import Undefined

PromptUpdateParamsPromptTemplate = typing.Union[str, PromptTemplate, Undefined]
2 changes: 1 addition & 1 deletion src/vocode/types/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Usage(pydantic.BaseModel):
user_id: str
plan_type: PlanType
monthly_usage_minutes: int
monthly_usage_limit_minutes: int
monthly_usage_limit_minutes: typing.Optional[int]

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

0 comments on commit 9e4c972

Please sign in to comment.