Skip to content

Commit

Permalink
Release 0.0.37
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jan 9, 2024
1 parent ec4d8f1 commit 5b71f36
Show file tree
Hide file tree
Showing 102 changed files with 1,134 additions and 353 deletions.
519 changes: 519 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "vocode-api"
version = "0.0.34"
version = "0.0.37"
description = ""
readme = "README.md"
authors = []
Expand All @@ -11,7 +11,7 @@ packages = [
[tool.poetry.dependencies]
python = "^3.7"
httpx = ">=0.21.2"
pydantic = "^1.9.2"
pydantic = ">= 1.9.2, < 2.5.0"

[tool.poetry.dev-dependencies]
mypy = "0.971"
Expand Down
48 changes: 24 additions & 24 deletions src/vocode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,6 @@
AgentEndpointingSensitivity,
AgentIvrNavigationMode,
AgentPage,
AgentParamsActionsItem,
AgentParamsActionsItemOne,
AgentParamsActionsItemOne_ActionAddToConference,
AgentParamsActionsItemOne_ActionDtmf,
AgentParamsActionsItemOne_ActionEndConversation,
AgentParamsActionsItemOne_ActionSetHold,
AgentParamsActionsItemOne_ActionTransferCall,
AgentParamsEndpointingSensitivity,
AgentParamsIvrNavigationMode,
AgentParamsOpenaiAccountConnection,
AgentParamsPrompt,
AgentParamsVectorDatabase,
AgentParamsVoice,
AgentParamsVoiceOne,
AgentParamsVoiceOne_VoiceAzure,
AgentParamsVoiceOne_VoiceElevenLabs,
AgentParamsVoiceOne_VoicePlayHt,
AgentParamsVoiceOne_VoiceRime,
AgentParamsWebhook,
AgentUpdateParams,
AgentUpdateParamsActions,
AgentUpdateParamsActionsItem,
Expand Down Expand Up @@ -156,8 +137,6 @@
CreateCallAgentParamsVoiceOne_VoicePlayHt,
CreateCallAgentParamsVoiceOne_VoiceRime,
CreateCallAgentParamsWebhook,
CreateCallRequestAgent,
CreateCallRequestOnNoHumanAnswer,
DtmfAction,
DtmfActionActionTrigger,
DtmfActionActionTrigger_ActionTriggerFunctionCall,
Expand Down Expand Up @@ -302,9 +281,6 @@
TwilioAccountConnectionUpdateParamsCredentials,
TwilioCredentials,
Undefined,
UpdateNumberRequestInboundAgent,
UpdateNumberRequestLabel,
UpdateNumberRequestOutboundOnly,
Usage,
ValidationError,
ValidationErrorLocItem,
Expand Down Expand Up @@ -340,6 +316,30 @@
)
from .errors import UnprocessableEntityError
from .resources import (
AgentParamsActionsItem,
AgentParamsActionsItemOne,
AgentParamsActionsItemOne_ActionAddToConference,
AgentParamsActionsItemOne_ActionDtmf,
AgentParamsActionsItemOne_ActionEndConversation,
AgentParamsActionsItemOne_ActionSetHold,
AgentParamsActionsItemOne_ActionTransferCall,
AgentParamsEndpointingSensitivity,
AgentParamsIvrNavigationMode,
AgentParamsOpenaiAccountConnection,
AgentParamsPrompt,
AgentParamsVectorDatabase,
AgentParamsVoice,
AgentParamsVoiceOne,
AgentParamsVoiceOne_VoiceAzure,
AgentParamsVoiceOne_VoiceElevenLabs,
AgentParamsVoiceOne_VoicePlayHt,
AgentParamsVoiceOne_VoiceRime,
AgentParamsWebhook,
CreateCallRequestAgent,
CreateCallRequestOnNoHumanAnswer,
UpdateNumberRequestInboundAgent,
UpdateNumberRequestLabel,
UpdateNumberRequestOutboundOnly,
account_connections,
actions,
agents,
Expand Down
10 changes: 6 additions & 4 deletions src/vocode/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ def __init__(
base_url: typing.Optional[str] = None,
environment: VocodeEnvironment = VocodeEnvironment.PRODUCTION,
token: typing.Union[str, typing.Callable[[], str]],
timeout: typing.Optional[float] = 60
timeout: typing.Optional[float] = 60,
httpx_client: typing.Optional[httpx.Client] = None
):
self._client_wrapper = SyncClientWrapper(
base_url=_get_base_url(base_url=base_url, environment=environment),
token=token,
httpx_client=httpx.Client(timeout=timeout),
httpx_client=httpx.Client(timeout=timeout) if httpx_client is None else httpx_client,
)
self.numbers = NumbersClient(client_wrapper=self._client_wrapper)
self.calls = CallsClient(client_wrapper=self._client_wrapper)
Expand All @@ -51,12 +52,13 @@ def __init__(
base_url: typing.Optional[str] = None,
environment: VocodeEnvironment = VocodeEnvironment.PRODUCTION,
token: typing.Union[str, typing.Callable[[], str]],
timeout: typing.Optional[float] = 60
timeout: typing.Optional[float] = 60,
httpx_client: typing.Optional[httpx.AsyncClient] = None
):
self._client_wrapper = AsyncClientWrapper(
base_url=_get_base_url(base_url=base_url, environment=environment),
token=token,
httpx_client=httpx.AsyncClient(timeout=timeout),
httpx_client=httpx.AsyncClient(timeout=timeout) if httpx_client is None else httpx_client,
)
self.numbers = AsyncNumbersClient(client_wrapper=self._client_wrapper)
self.calls = AsyncCallsClient(client_wrapper=self._client_wrapper)
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.34",
"X-Fern-SDK-Version": "0.0.37",
}
headers["Authorization"] = f"Bearer {self._get_token()}"
return headers
Expand Down
14 changes: 8 additions & 6 deletions src/vocode/core/jsonable_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
from types import GeneratorType
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union

from pydantic import BaseModel
from pydantic.json import ENCODERS_BY_TYPE
try:
import pydantic.v1 as pydantic # type: ignore
except ImportError:
import pydantic # type: ignore

from .datetime_utils import serialize_datetime

Expand All @@ -34,7 +36,7 @@ def generate_encoders_by_class_tuples(
return encoders_by_class_tuples


encoders_by_class_tuples = generate_encoders_by_class_tuples(ENCODERS_BY_TYPE)
encoders_by_class_tuples = generate_encoders_by_class_tuples(pydantic.json.ENCODERS_BY_TYPE)


def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any:
Expand All @@ -46,7 +48,7 @@ def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any]
for encoder_type, encoder_instance in custom_encoder.items():
if isinstance(obj, encoder_type):
return encoder_instance(obj)
if isinstance(obj, BaseModel):
if isinstance(obj, pydantic.BaseModel):
encoder = getattr(obj.__config__, "json_encoders", {})
if custom_encoder:
encoder.update(custom_encoder)
Expand Down Expand Up @@ -82,8 +84,8 @@ def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any]
encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder))
return encoded_list

if type(obj) in ENCODERS_BY_TYPE:
return ENCODERS_BY_TYPE[type(obj)](obj)
if type(obj) in pydantic.json.ENCODERS_BY_TYPE:
return pydantic.json.ENCODERS_BY_TYPE[type(obj)](obj)
for encoder, classes_tuple in encoders_by_class_tuples.items():
if isinstance(obj, classes_tuple):
return encoder(obj)
Expand Down
47 changes: 47 additions & 0 deletions src/vocode/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,55 @@
# This file was auto-generated by Fern from our API Definition.

from . import account_connections, actions, agents, calls, numbers, prompts, usage, vector_databases, voices, webhooks
from .agents import (
AgentParamsActionsItem,
AgentParamsActionsItemOne,
AgentParamsActionsItemOne_ActionAddToConference,
AgentParamsActionsItemOne_ActionDtmf,
AgentParamsActionsItemOne_ActionEndConversation,
AgentParamsActionsItemOne_ActionSetHold,
AgentParamsActionsItemOne_ActionTransferCall,
AgentParamsEndpointingSensitivity,
AgentParamsIvrNavigationMode,
AgentParamsOpenaiAccountConnection,
AgentParamsPrompt,
AgentParamsVectorDatabase,
AgentParamsVoice,
AgentParamsVoiceOne,
AgentParamsVoiceOne_VoiceAzure,
AgentParamsVoiceOne_VoiceElevenLabs,
AgentParamsVoiceOne_VoicePlayHt,
AgentParamsVoiceOne_VoiceRime,
AgentParamsWebhook,
)
from .calls import CreateCallRequestAgent, CreateCallRequestOnNoHumanAnswer
from .numbers import UpdateNumberRequestInboundAgent, UpdateNumberRequestLabel, UpdateNumberRequestOutboundOnly

__all__ = [
"AgentParamsActionsItem",
"AgentParamsActionsItemOne",
"AgentParamsActionsItemOne_ActionAddToConference",
"AgentParamsActionsItemOne_ActionDtmf",
"AgentParamsActionsItemOne_ActionEndConversation",
"AgentParamsActionsItemOne_ActionSetHold",
"AgentParamsActionsItemOne_ActionTransferCall",
"AgentParamsEndpointingSensitivity",
"AgentParamsIvrNavigationMode",
"AgentParamsOpenaiAccountConnection",
"AgentParamsPrompt",
"AgentParamsVectorDatabase",
"AgentParamsVoice",
"AgentParamsVoiceOne",
"AgentParamsVoiceOne_VoiceAzure",
"AgentParamsVoiceOne_VoiceElevenLabs",
"AgentParamsVoiceOne_VoicePlayHt",
"AgentParamsVoiceOne_VoiceRime",
"AgentParamsWebhook",
"CreateCallRequestAgent",
"CreateCallRequestOnNoHumanAnswer",
"UpdateNumberRequestInboundAgent",
"UpdateNumberRequestLabel",
"UpdateNumberRequestOutboundOnly",
"account_connections",
"actions",
"agents",
Expand Down
7 changes: 5 additions & 2 deletions src/vocode/resources/account_connections/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import urllib.parse
from json.decoder import JSONDecodeError

import pydantic

from ...core.api_error import ApiError
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ...core.jsonable_encoder import jsonable_encoder
Expand All @@ -17,6 +15,11 @@
from ...types.account_connection_update_params_request import AccountConnectionUpdateParamsRequest
from ...types.http_validation_error import HttpValidationError

try:
import pydantic.v1 as pydantic # type: ignore
except ImportError:
import pydantic # type: ignore

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)

Expand Down
7 changes: 5 additions & 2 deletions src/vocode/resources/actions/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import urllib.parse
from json.decoder import JSONDecodeError

import pydantic

from ...core.api_error import ApiError
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ...core.jsonable_encoder import jsonable_encoder
Expand All @@ -17,6 +15,11 @@
from ...types.action_update_params_request import ActionUpdateParamsRequest
from ...types.http_validation_error import HttpValidationError

try:
import pydantic.v1 as pydantic # type: ignore
except ImportError:
import pydantic # type: ignore

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)

Expand Down
43 changes: 43 additions & 0 deletions src/vocode/resources/agents/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,45 @@
# This file was auto-generated by Fern from our API Definition.

from .types import (
AgentParamsActionsItem,
AgentParamsActionsItemOne,
AgentParamsActionsItemOne_ActionAddToConference,
AgentParamsActionsItemOne_ActionDtmf,
AgentParamsActionsItemOne_ActionEndConversation,
AgentParamsActionsItemOne_ActionSetHold,
AgentParamsActionsItemOne_ActionTransferCall,
AgentParamsEndpointingSensitivity,
AgentParamsIvrNavigationMode,
AgentParamsOpenaiAccountConnection,
AgentParamsPrompt,
AgentParamsVectorDatabase,
AgentParamsVoice,
AgentParamsVoiceOne,
AgentParamsVoiceOne_VoiceAzure,
AgentParamsVoiceOne_VoiceElevenLabs,
AgentParamsVoiceOne_VoicePlayHt,
AgentParamsVoiceOne_VoiceRime,
AgentParamsWebhook,
)

__all__ = [
"AgentParamsActionsItem",
"AgentParamsActionsItemOne",
"AgentParamsActionsItemOne_ActionAddToConference",
"AgentParamsActionsItemOne_ActionDtmf",
"AgentParamsActionsItemOne_ActionEndConversation",
"AgentParamsActionsItemOne_ActionSetHold",
"AgentParamsActionsItemOne_ActionTransferCall",
"AgentParamsEndpointingSensitivity",
"AgentParamsIvrNavigationMode",
"AgentParamsOpenaiAccountConnection",
"AgentParamsPrompt",
"AgentParamsVectorDatabase",
"AgentParamsVoice",
"AgentParamsVoiceOne",
"AgentParamsVoiceOne_VoiceAzure",
"AgentParamsVoiceOne_VoiceElevenLabs",
"AgentParamsVoiceOne_VoicePlayHt",
"AgentParamsVoiceOne_VoiceRime",
"AgentParamsWebhook",
]
23 changes: 13 additions & 10 deletions src/vocode/resources/agents/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,30 @@
import urllib.parse
from json.decoder import JSONDecodeError

import pydantic

from ...core.api_error import ApiError
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ...core.jsonable_encoder import jsonable_encoder
from ...core.remove_none_from_dict import remove_none_from_dict
from ...errors.unprocessable_entity_error import UnprocessableEntityError
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_ivr_navigation_mode import AgentParamsIvrNavigationMode
from ...types.agent_params_openai_account_connection import AgentParamsOpenaiAccountConnection
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
from ...types.agent_update_params import AgentUpdateParams
from ...types.http_validation_error import HttpValidationError
from ...types.interrupt_sensitivity import InterruptSensitivity
from ...types.language import Language
from .types.agent_params_actions_item import AgentParamsActionsItem
from .types.agent_params_endpointing_sensitivity import AgentParamsEndpointingSensitivity
from .types.agent_params_ivr_navigation_mode import AgentParamsIvrNavigationMode
from .types.agent_params_openai_account_connection import AgentParamsOpenaiAccountConnection
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

try:
import pydantic.v1 as pydantic # type: ignore
except ImportError:
import pydantic # type: ignore

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
Expand Down
Loading

0 comments on commit 5b71f36

Please sign in to comment.