Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌿 Fern Regeneration -- January 15, 2025 #222

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .mock/definition/empathic-voice/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3190,3 +3190,87 @@ types:
type: string
source:
openapi: assistant-openapi.json
WebhookEventChatEnded:
properties:
event_name:
type: optional<literal<"chat_ended">>
docs: Always `chat_ended`.
end_time: integer
duration_seconds: integer
end_reason:
type: WebhookEventChatStatus
caller_number: optional<string>
custom_session_id: optional<string>
extends:
- WebhookEventBase
source:
openapi: assistant-openapi.json
WebhookEventChatStartType:
enum:
- new_chat_group
- resumed_chat_group
source:
openapi: assistant-openapi.json
WebhookEventChatStarted:
properties:
event_name:
type: optional<literal<"chat_started">>
docs: Always `chat_started`.
start_time:
type: integer
docs: Unix timestamp (in milliseconds) indicating when the session started.
chat_start_type:
type: WebhookEventChatStartType
docs: >-
Indicates whether the chat is the first in a new Chat Group
(`new_chat_group`) or the continuation of an existing chat group
(`resumed_chat_group`).
caller_number:
type: optional<string>
docs: >-
Phone number of the caller in E.164 format (e.g., `+12223333333`).
This field is included only if the Chat was created via the [Twilio
phone calling](/docs/empathic-voice-interface-evi/phone-calling)
integration.
custom_session_id:
type: optional<string>
docs: >-
User-defined session ID. Relevant only when employing a [custom
language
model](/docs/empathic-voice-interface-evi/custom-language-model) in
the EVI Config.
extends:
- WebhookEventBase
source:
openapi: assistant-openapi.json
WebhookEventChatStatus:
enum:
- ACTIVE
- USER_ENDED
- USER_TIMEOUT
- INACTIVITY_TIMEOUT
- MAX_DURATION_TIMEOUT
- ERROR
source:
openapi: assistant-openapi.json
WebhookEvent:
discriminated: false
union:
- WebhookEventChatStarted
- WebhookEventChatEnded
source:
openapi: assistant-openapi.json
WebhookEventBase:
docs: Represents the fields common to all webhook events.
properties:
chat_group_id:
type: string
docs: Unique ID of the **Chat Group** associated with the **Chat** session.
chat_id:
type: string
docs: Unique ID of the **Chat** session.
config_id:
type: optional<string>
docs: Unique ID of the EVI **Config** used for the session.
source:
openapi: assistant-openapi.json
21 changes: 21 additions & 0 deletions .mock/definition/empathic-voice/chatWebhooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
imports:
root: __package__.yml
webhooks:
chatWebhook:
method: POST
display-name: Chat Webhook
headers: {}
payload: root.WebhookEvent
examples:
- payload:
chat_group_id: chat_group_id
chat_id: chat_id
start_time: 1
chat_start_type: new_chat_group
docs: >-
Webhook events are JSON payloads to your server during an EVI chat. You
can subscribe to specific events, and set which URLs should be notified in
the
[Config](/reference/empathic-voice-interface-evi/configs/create-config#request.body.webhooks)
resource. Read the [Webhook
Guide](/docs/empathic-voice-interface-evi/webhooks) for more information.
153 changes: 80 additions & 73 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions src/hume/empathic_voice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@
ValidationError,
ValidationErrorLocItem,
WebSocketError,
WebhookEvent,
WebhookEventBase,
WebhookEventChatEnded,
WebhookEventChatStartType,
WebhookEventChatStarted,
WebhookEventChatStatus,
)
from .errors import BadRequestError
from . import chat, chat_groups, chats, configs, custom_voices, prompts, tools
Expand Down Expand Up @@ -234,6 +240,12 @@
"ValidationError",
"ValidationErrorLocItem",
"WebSocketError",
"WebhookEvent",
"WebhookEventBase",
"WebhookEventChatEnded",
"WebhookEventChatStartType",
"WebhookEventChatStarted",
"WebhookEventChatStatus",
"chat",
"chat_groups",
"chats",
Expand Down
12 changes: 12 additions & 0 deletions src/hume/empathic_voice/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@
from .validation_error import ValidationError
from .validation_error_loc_item import ValidationErrorLocItem
from .web_socket_error import WebSocketError
from .webhook_event import WebhookEvent
from .webhook_event_base import WebhookEventBase
from .webhook_event_chat_ended import WebhookEventChatEnded
from .webhook_event_chat_start_type import WebhookEventChatStartType
from .webhook_event_chat_started import WebhookEventChatStarted
from .webhook_event_chat_status import WebhookEventChatStatus

__all__ = [
"AssistantEnd",
Expand Down Expand Up @@ -228,4 +234,10 @@
"ValidationError",
"ValidationErrorLocItem",
"WebSocketError",
"WebhookEvent",
"WebhookEventBase",
"WebhookEventChatEnded",
"WebhookEventChatStartType",
"WebhookEventChatStarted",
"WebhookEventChatStatus",
]
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 .webhook_event_chat_started import WebhookEventChatStarted
from .webhook_event_chat_ended import WebhookEventChatEnded

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

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


class WebhookEventBase(UniversalBaseModel):
"""
Represents the fields common to all webhook events.
"""

chat_group_id: str = pydantic.Field()
"""
Unique ID of the **Chat Group** associated with the **Chat** session.
"""

chat_id: str = pydantic.Field()
"""
Unique ID of the **Chat** session.
"""

config_id: typing.Optional[str] = pydantic.Field(default=None)
"""
Unique ID of the EVI **Config** used for the session.
"""

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
29 changes: 29 additions & 0 deletions src/hume/empathic_voice/types/webhook_event_chat_ended.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file was auto-generated by Fern from our API Definition.

from .webhook_event_base import WebhookEventBase
import typing
import pydantic
from .webhook_event_chat_status import WebhookEventChatStatus
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class WebhookEventChatEnded(WebhookEventBase):
event_name: typing.Optional[typing.Literal["chat_ended"]] = pydantic.Field(default=None)
"""
Always `chat_ended`.
"""

end_time: int
duration_seconds: int
end_reason: WebhookEventChatStatus
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
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

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

from .webhook_event_base import WebhookEventBase
import typing
import pydantic
from .webhook_event_chat_start_type import WebhookEventChatStartType
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class WebhookEventChatStarted(WebhookEventBase):
event_name: typing.Optional[typing.Literal["chat_started"]] = pydantic.Field(default=None)
"""
Always `chat_started`.
"""

start_time: int = pydantic.Field()
"""
Unix timestamp (in milliseconds) indicating when the session started.
"""

chat_start_type: WebhookEventChatStartType = pydantic.Field()
"""
Indicates whether the chat is the first in a new Chat Group (`new_chat_group`) or the continuation of an existing chat group (`resumed_chat_group`).
"""

caller_number: typing.Optional[str] = pydantic.Field(default=None)
"""
Phone number of the caller in E.164 format (e.g., `+12223333333`). This field is included only if the Chat was created via the [Twilio phone calling](/docs/empathic-voice-interface-evi/phone-calling) integration.
"""

custom_session_id: typing.Optional[str] = pydantic.Field(default=None)
"""
User-defined session ID. Relevant only when employing a [custom language model](/docs/empathic-voice-interface-evi/custom-language-model) in the EVI Config.
"""

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/webhook_event_chat_status.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

WebhookEventChatStatus = typing.Union[
typing.Literal["ACTIVE", "USER_ENDED", "USER_TIMEOUT", "INACTIVITY_TIMEOUT", "MAX_DURATION_TIMEOUT", "ERROR"],
typing.Any,
]
Loading