Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
twitchard committed Jan 15, 2025
1 parent 5acfaf4 commit 9781bc7
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/hume/empathic_voice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
AudioOutput,
BuiltInTool,
BuiltinToolConfig,
ChatEndedEvent,
ChatMessage,
ChatMessageToolResult,
ChatMetadata,
ChatStartType,
ChatStartedEvent,
ChatStatusEnum,
Context,
ContextType,
EmotionScores,
Expand Down Expand Up @@ -113,6 +117,9 @@
ValidationError,
ValidationErrorLocItem,
WebSocketError,
WebhookBaseEvent,
WebhookEvent,
WebhookEventType,
)
from .errors import BadRequestError
from . import chat, chat_groups, chats, configs, custom_voices, prompts, tools
Expand All @@ -128,9 +135,13 @@
"BadRequestError",
"BuiltInTool",
"BuiltinToolConfig",
"ChatEndedEvent",
"ChatMessage",
"ChatMessageToolResult",
"ChatMetadata",
"ChatStartType",
"ChatStartedEvent",
"ChatStatusEnum",
"Context",
"ContextType",
"EmotionScores",
Expand Down Expand Up @@ -234,6 +245,9 @@
"ValidationError",
"ValidationErrorLocItem",
"WebSocketError",
"WebhookBaseEvent",
"WebhookEvent",
"WebhookEventType",
"chat",
"chat_groups",
"chats",
Expand Down
14 changes: 14 additions & 0 deletions src/hume/empathic_voice/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
from .audio_output import AudioOutput
from .built_in_tool import BuiltInTool
from .builtin_tool_config import BuiltinToolConfig
from .chat_ended_event import ChatEndedEvent
from .chat_message import ChatMessage
from .chat_message_tool_result import ChatMessageToolResult
from .chat_metadata import ChatMetadata
from .chat_start_type import ChatStartType
from .chat_started_event import ChatStartedEvent
from .chat_status_enum import ChatStatusEnum
from .context import Context
from .context_type import ContextType
from .emotion_scores import EmotionScores
Expand Down Expand Up @@ -114,6 +118,9 @@
from .validation_error import ValidationError
from .validation_error_loc_item import ValidationErrorLocItem
from .web_socket_error import WebSocketError
from .webhook_base_event import WebhookBaseEvent
from .webhook_event import WebhookEvent
from .webhook_event_type import WebhookEventType

__all__ = [
"AssistantEnd",
Expand All @@ -124,9 +131,13 @@
"AudioOutput",
"BuiltInTool",
"BuiltinToolConfig",
"ChatEndedEvent",
"ChatMessage",
"ChatMessageToolResult",
"ChatMetadata",
"ChatStartType",
"ChatStartedEvent",
"ChatStatusEnum",
"Context",
"ContextType",
"EmotionScores",
Expand Down Expand Up @@ -228,4 +239,7 @@
"ValidationError",
"ValidationErrorLocItem",
"WebSocketError",
"WebhookBaseEvent",
"WebhookEvent",
"WebhookEventType",
]
24 changes: 24 additions & 0 deletions src/hume/empathic_voice/types/chat_ended_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file was auto-generated by Fern from our API Definition.

from .webhook_base_event import WebhookBaseEvent
from .chat_status_enum import ChatStatusEnum
import typing
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ChatEndedEvent(WebhookBaseEvent):
end_time: int
duration_seconds: int
end_reason: ChatStatusEnum
caller_number: typing.Optional[str] = None
custom_session_id: typing.Optional[str] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
5 changes: 5 additions & 0 deletions src/hume/empathic_voice/types/chat_start_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file was auto-generated by Fern from our API Definition.

import typing

ChatStartType = typing.Union[typing.Literal["new_chat_group", "resumed_chat_group"], typing.Any]
23 changes: 23 additions & 0 deletions src/hume/empathic_voice/types/chat_started_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file was auto-generated by Fern from our API Definition.

from .webhook_base_event import WebhookBaseEvent
from .chat_start_type import ChatStartType
import typing
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ChatStartedEvent(WebhookBaseEvent):
start_time: int
chat_start_type: ChatStartType
caller_number: typing.Optional[str] = None
custom_session_id: typing.Optional[str] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
8 changes: 8 additions & 0 deletions src/hume/empathic_voice/types/chat_status_enum.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

ChatStatusEnum = typing.Union[
typing.Literal["ACTIVE", "USER_ENDED", "USER_TIMEOUT", "INACTIVITY_TIMEOUT", "MAX_DURATION_TIMEOUT", "ERROR"],
typing.Any,
]
28 changes: 28 additions & 0 deletions src/hume/empathic_voice/types/webhook_base_event.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.

from ...core.pydantic_utilities import UniversalBaseModel
from .webhook_event_type import WebhookEventType
import typing
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class WebhookBaseEvent(UniversalBaseModel):
"""
Represents a webhook event job to be queued to the webhook delivery service.
Internal fields like 'url' and 'is_active' are excluded from serialization.
"""

event_name: WebhookEventType
chat_group_id: str
chat_id: str
config_id: typing.Optional[str] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
7 changes: 7 additions & 0 deletions src/hume/empathic_voice/types/webhook_event.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 .chat_started_event import ChatStartedEvent
from .chat_ended_event import ChatEndedEvent

WebhookEvent = typing.Union[ChatStartedEvent, ChatEndedEvent]
5 changes: 5 additions & 0 deletions src/hume/empathic_voice/types/webhook_event_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file was auto-generated by Fern from our API Definition.

import typing

WebhookEventType = typing.Union[typing.Literal["chat_started", "chat_ended"], typing.Any]

0 comments on commit 9781bc7

Please sign in to comment.