Skip to content

Commit 3709fdb

Browse files
🌿 Fern Regeneration -- January 15, 2025 (#254)
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
1 parent fe55346 commit 3709fdb

17 files changed

+358
-6
lines changed

.mock/definition/empathic-voice/__package__.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3190,3 +3190,87 @@ types:
31903190
type: string
31913191
source:
31923192
openapi: assistant-openapi.json
3193+
WebhookEventChatEnded:
3194+
properties:
3195+
event_name:
3196+
type: optional<literal<"chat_ended">>
3197+
docs: Always `chat_ended`.
3198+
end_time: integer
3199+
duration_seconds: integer
3200+
end_reason:
3201+
type: WebhookEventChatStatus
3202+
caller_number: optional<string>
3203+
custom_session_id: optional<string>
3204+
extends:
3205+
- WebhookEventBase
3206+
source:
3207+
openapi: assistant-openapi.json
3208+
WebhookEventChatStartType:
3209+
enum:
3210+
- new_chat_group
3211+
- resumed_chat_group
3212+
source:
3213+
openapi: assistant-openapi.json
3214+
WebhookEventChatStarted:
3215+
properties:
3216+
event_name:
3217+
type: optional<literal<"chat_started">>
3218+
docs: Always `chat_started`.
3219+
start_time:
3220+
type: integer
3221+
docs: Unix timestamp (in milliseconds) indicating when the session started.
3222+
chat_start_type:
3223+
type: WebhookEventChatStartType
3224+
docs: >-
3225+
Indicates whether the chat is the first in a new Chat Group
3226+
(`new_chat_group`) or the continuation of an existing chat group
3227+
(`resumed_chat_group`).
3228+
caller_number:
3229+
type: optional<string>
3230+
docs: >-
3231+
Phone number of the caller in E.164 format (e.g., `+12223333333`).
3232+
This field is included only if the Chat was created via the [Twilio
3233+
phone calling](/docs/empathic-voice-interface-evi/phone-calling)
3234+
integration.
3235+
custom_session_id:
3236+
type: optional<string>
3237+
docs: >-
3238+
User-defined session ID. Relevant only when employing a [custom
3239+
language
3240+
model](/docs/empathic-voice-interface-evi/custom-language-model) in
3241+
the EVI Config.
3242+
extends:
3243+
- WebhookEventBase
3244+
source:
3245+
openapi: assistant-openapi.json
3246+
WebhookEventChatStatus:
3247+
enum:
3248+
- ACTIVE
3249+
- USER_ENDED
3250+
- USER_TIMEOUT
3251+
- INACTIVITY_TIMEOUT
3252+
- MAX_DURATION_TIMEOUT
3253+
- ERROR
3254+
source:
3255+
openapi: assistant-openapi.json
3256+
WebhookEvent:
3257+
discriminated: false
3258+
union:
3259+
- WebhookEventChatStarted
3260+
- WebhookEventChatEnded
3261+
source:
3262+
openapi: assistant-openapi.json
3263+
WebhookEventBase:
3264+
docs: Represents the fields common to all webhook events.
3265+
properties:
3266+
chat_group_id:
3267+
type: string
3268+
docs: Unique ID of the **Chat Group** associated with the **Chat** session.
3269+
chat_id:
3270+
type: string
3271+
docs: Unique ID of the **Chat** session.
3272+
config_id:
3273+
type: optional<string>
3274+
docs: Unique ID of the EVI **Config** used for the session.
3275+
source:
3276+
openapi: assistant-openapi.json
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
imports:
2+
root: __package__.yml
3+
webhooks:
4+
chatWebhook:
5+
method: POST
6+
display-name: Chat Webhook
7+
headers: {}
8+
payload: root.WebhookEvent
9+
examples:
10+
- payload:
11+
chat_group_id: chat_group_id
12+
chat_id: chat_id
13+
start_time: 1
14+
chat_start_type: new_chat_group
15+
docs: >-
16+
Webhook events are JSON payloads to your server during an EVI chat. You
17+
can subscribe to specific events, and set which URLs should be notified in
18+
the
19+
[Config](/reference/empathic-voice-interface-evi/configs/create-config#request.body.webhooks)
20+
resource. Read the [Webhook
21+
Guide](/docs/empathic-voice-interface-evi/webhooks) for more information.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as Hume from "../../../index";
6+
7+
export type WebhookEvent = Hume.empathicVoice.WebhookEventChatStarted | Hume.empathicVoice.WebhookEventChatEnded;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
/**
6+
* Represents the fields common to all webhook events.
7+
*/
8+
export interface WebhookEventBase {
9+
/** Unique ID of the **Chat Group** associated with the **Chat** session. */
10+
chatGroupId: string;
11+
/** Unique ID of the **Chat** session. */
12+
chatId: string;
13+
/** Unique ID of the EVI **Config** used for the session. */
14+
configId?: string;
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as Hume from "../../../index";
6+
7+
export interface WebhookEventChatEnded extends Hume.empathicVoice.WebhookEventBase {
8+
/** Always `chat_ended`. */
9+
eventName?: "chat_ended";
10+
endTime: number;
11+
durationSeconds: number;
12+
endReason: Hume.empathicVoice.WebhookEventChatStatus;
13+
callerNumber?: string;
14+
customSessionId?: string;
15+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
export type WebhookEventChatStartType = "new_chat_group" | "resumed_chat_group";
6+
7+
export const WebhookEventChatStartType = {
8+
NewChatGroup: "new_chat_group",
9+
ResumedChatGroup: "resumed_chat_group",
10+
} as const;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as Hume from "../../../index";
6+
7+
export interface WebhookEventChatStarted extends Hume.empathicVoice.WebhookEventBase {
8+
/** Always `chat_started`. */
9+
eventName?: "chat_started";
10+
/** Unix timestamp (in milliseconds) indicating when the session started. */
11+
startTime: number;
12+
/** 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`). */
13+
chatStartType: Hume.empathicVoice.WebhookEventChatStartType;
14+
/** 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. */
15+
callerNumber?: string;
16+
/** User-defined session ID. Relevant only when employing a [custom language model](/docs/empathic-voice-interface-evi/custom-language-model) in the EVI Config. */
17+
customSessionId?: string;
18+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
export type WebhookEventChatStatus =
6+
| "ACTIVE"
7+
| "USER_ENDED"
8+
| "USER_TIMEOUT"
9+
| "INACTIVITY_TIMEOUT"
10+
| "MAX_DURATION_TIMEOUT"
11+
| "ERROR";
12+
13+
export const WebhookEventChatStatus = {
14+
Active: "ACTIVE",
15+
UserEnded: "USER_ENDED",
16+
UserTimeout: "USER_TIMEOUT",
17+
InactivityTimeout: "INACTIVITY_TIMEOUT",
18+
MaxDurationTimeout: "MAX_DURATION_TIMEOUT",
19+
Error: "ERROR",
20+
} as const;

src/api/resources/empathicVoice/types/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,9 @@ export * from "./FunctionCallResponseInput";
110110
export * from "./HttpValidationError";
111111
export * from "./ValidationErrorLocItem";
112112
export * from "./ValidationError";
113+
export * from "./WebhookEventChatEnded";
114+
export * from "./WebhookEventChatStartType";
115+
export * from "./WebhookEventChatStarted";
116+
export * from "./WebhookEventChatStatus";
117+
export * from "./WebhookEvent";
118+
export * from "./WebhookEventBase";
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as serializers from "../../../index";
6+
import * as Hume from "../../../../api/index";
7+
import * as core from "../../../../core";
8+
import { WebhookEventChatStarted } from "./WebhookEventChatStarted";
9+
import { WebhookEventChatEnded } from "./WebhookEventChatEnded";
10+
11+
export const WebhookEvent: core.serialization.Schema<
12+
serializers.empathicVoice.WebhookEvent.Raw,
13+
Hume.empathicVoice.WebhookEvent
14+
> = core.serialization.undiscriminatedUnion([WebhookEventChatStarted, WebhookEventChatEnded]);
15+
16+
export declare namespace WebhookEvent {
17+
type Raw = WebhookEventChatStarted.Raw | WebhookEventChatEnded.Raw;
18+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as serializers from "../../../index";
6+
import * as Hume from "../../../../api/index";
7+
import * as core from "../../../../core";
8+
9+
export const WebhookEventBase: core.serialization.ObjectSchema<
10+
serializers.empathicVoice.WebhookEventBase.Raw,
11+
Hume.empathicVoice.WebhookEventBase
12+
> = core.serialization.object({
13+
chatGroupId: core.serialization.property("chat_group_id", core.serialization.string()),
14+
chatId: core.serialization.property("chat_id", core.serialization.string()),
15+
configId: core.serialization.property("config_id", core.serialization.string().optional()),
16+
});
17+
18+
export declare namespace WebhookEventBase {
19+
interface Raw {
20+
chat_group_id: string;
21+
chat_id: string;
22+
config_id?: string | null;
23+
}
24+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as serializers from "../../../index";
6+
import * as Hume from "../../../../api/index";
7+
import * as core from "../../../../core";
8+
import { WebhookEventChatStatus } from "./WebhookEventChatStatus";
9+
import { WebhookEventBase } from "./WebhookEventBase";
10+
11+
export const WebhookEventChatEnded: core.serialization.ObjectSchema<
12+
serializers.empathicVoice.WebhookEventChatEnded.Raw,
13+
Hume.empathicVoice.WebhookEventChatEnded
14+
> = core.serialization
15+
.object({
16+
eventName: core.serialization.property("event_name", core.serialization.stringLiteral("chat_ended").optional()),
17+
endTime: core.serialization.property("end_time", core.serialization.number()),
18+
durationSeconds: core.serialization.property("duration_seconds", core.serialization.number()),
19+
endReason: core.serialization.property("end_reason", WebhookEventChatStatus),
20+
callerNumber: core.serialization.property("caller_number", core.serialization.string().optional()),
21+
customSessionId: core.serialization.property("custom_session_id", core.serialization.string().optional()),
22+
})
23+
.extend(WebhookEventBase);
24+
25+
export declare namespace WebhookEventChatEnded {
26+
interface Raw extends WebhookEventBase.Raw {
27+
event_name?: "chat_ended" | null;
28+
end_time: number;
29+
duration_seconds: number;
30+
end_reason: WebhookEventChatStatus.Raw;
31+
caller_number?: string | null;
32+
custom_session_id?: string | null;
33+
}
34+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as serializers from "../../../index";
6+
import * as Hume from "../../../../api/index";
7+
import * as core from "../../../../core";
8+
9+
export const WebhookEventChatStartType: core.serialization.Schema<
10+
serializers.empathicVoice.WebhookEventChatStartType.Raw,
11+
Hume.empathicVoice.WebhookEventChatStartType
12+
> = core.serialization.enum_(["new_chat_group", "resumed_chat_group"]);
13+
14+
export declare namespace WebhookEventChatStartType {
15+
type Raw = "new_chat_group" | "resumed_chat_group";
16+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as serializers from "../../../index";
6+
import * as Hume from "../../../../api/index";
7+
import * as core from "../../../../core";
8+
import { WebhookEventChatStartType } from "./WebhookEventChatStartType";
9+
import { WebhookEventBase } from "./WebhookEventBase";
10+
11+
export const WebhookEventChatStarted: core.serialization.ObjectSchema<
12+
serializers.empathicVoice.WebhookEventChatStarted.Raw,
13+
Hume.empathicVoice.WebhookEventChatStarted
14+
> = core.serialization
15+
.object({
16+
eventName: core.serialization.property(
17+
"event_name",
18+
core.serialization.stringLiteral("chat_started").optional()
19+
),
20+
startTime: core.serialization.property("start_time", core.serialization.number()),
21+
chatStartType: core.serialization.property("chat_start_type", WebhookEventChatStartType),
22+
callerNumber: core.serialization.property("caller_number", core.serialization.string().optional()),
23+
customSessionId: core.serialization.property("custom_session_id", core.serialization.string().optional()),
24+
})
25+
.extend(WebhookEventBase);
26+
27+
export declare namespace WebhookEventChatStarted {
28+
interface Raw extends WebhookEventBase.Raw {
29+
event_name?: "chat_started" | null;
30+
start_time: number;
31+
chat_start_type: WebhookEventChatStartType.Raw;
32+
caller_number?: string | null;
33+
custom_session_id?: string | null;
34+
}
35+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as serializers from "../../../index";
6+
import * as Hume from "../../../../api/index";
7+
import * as core from "../../../../core";
8+
9+
export const WebhookEventChatStatus: core.serialization.Schema<
10+
serializers.empathicVoice.WebhookEventChatStatus.Raw,
11+
Hume.empathicVoice.WebhookEventChatStatus
12+
> = core.serialization.enum_([
13+
"ACTIVE",
14+
"USER_ENDED",
15+
"USER_TIMEOUT",
16+
"INACTIVITY_TIMEOUT",
17+
"MAX_DURATION_TIMEOUT",
18+
"ERROR",
19+
]);
20+
21+
export declare namespace WebhookEventChatStatus {
22+
type Raw = "ACTIVE" | "USER_ENDED" | "USER_TIMEOUT" | "INACTIVITY_TIMEOUT" | "MAX_DURATION_TIMEOUT" | "ERROR";
23+
}

src/serialization/resources/empathicVoice/types/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,9 @@ export * from "./FunctionCallResponseInput";
110110
export * from "./HttpValidationError";
111111
export * from "./ValidationErrorLocItem";
112112
export * from "./ValidationError";
113+
export * from "./WebhookEventChatEnded";
114+
export * from "./WebhookEventChatStartType";
115+
export * from "./WebhookEventChatStarted";
116+
export * from "./WebhookEventChatStatus";
117+
export * from "./WebhookEvent";
118+
export * from "./WebhookEventBase";

0 commit comments

Comments
 (0)