retell-sdk 2.2.2 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/example.js +61 -7
- package/example.js.map +1 -1
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js.map +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +5 -1
- package/lib/security.js.map +1 -1
- package/models/components/agent.d.ts +62 -0
- package/models/components/agent.d.ts.map +1 -1
- package/models/components/agent.js +95 -15
- package/models/components/agent.js.map +1 -1
- package/models/components/agentpromptparams.d.ts.map +1 -1
- package/models/components/agentpromptparams.js.map +1 -1
- package/models/components/calldetail.d.ts.map +1 -1
- package/models/components/calldetail.js +18 -6
- package/models/components/calldetail.js.map +1 -1
- package/models/components/callphonenumber.d.ts.map +1 -1
- package/models/components/callphonenumber.js.map +1 -1
- package/models/components/phonenumber.d.ts.map +1 -1
- package/models/components/phonenumber.js.map +1 -1
- package/models/components/security.d.ts.map +1 -1
- package/models/errors/createagent.d.ts.map +1 -1
- package/models/errors/createagent.js +36 -12
- package/models/errors/createagent.js.map +1 -1
- package/models/errors/createphonecall.d.ts.map +1 -1
- package/models/errors/createphonecall.js +54 -18
- package/models/errors/createphonecall.js.map +1 -1
- package/models/errors/createphonenumber.d.ts.map +1 -1
- package/models/errors/createphonenumber.js +42 -14
- package/models/errors/createphonenumber.js.map +1 -1
- package/models/errors/deleteagent.d.ts.map +1 -1
- package/models/errors/deleteagent.js +36 -12
- package/models/errors/deleteagent.js.map +1 -1
- package/models/errors/deletephonenumber.d.ts.map +1 -1
- package/models/errors/deletephonenumber.js +33 -11
- package/models/errors/deletephonenumber.js.map +1 -1
- package/models/errors/getagent.d.ts.map +1 -1
- package/models/errors/getagent.js +36 -12
- package/models/errors/getagent.js.map +1 -1
- package/models/errors/getcall.d.ts.map +1 -1
- package/models/errors/getcall.js +30 -10
- package/models/errors/getcall.js.map +1 -1
- package/models/errors/getphonenumber.d.ts.map +1 -1
- package/models/errors/getphonenumber.js +36 -12
- package/models/errors/getphonenumber.js.map +1 -1
- package/models/errors/listagents.d.ts.map +1 -1
- package/models/errors/listagents.js +15 -5
- package/models/errors/listagents.js.map +1 -1
- package/models/errors/listcalls.d.ts.map +1 -1
- package/models/errors/listcalls.js +24 -8
- package/models/errors/listcalls.js.map +1 -1
- package/models/errors/listphonenumbers.d.ts.map +1 -1
- package/models/errors/listphonenumbers.js +27 -9
- package/models/errors/listphonenumbers.js.map +1 -1
- package/models/errors/updateagent.d.ts.map +1 -1
- package/models/errors/updateagent.js +36 -12
- package/models/errors/updateagent.js.map +1 -1
- package/models/errors/updatephoneagent.d.ts.map +1 -1
- package/models/errors/updatephoneagent.js +36 -12
- package/models/errors/updatephoneagent.js.map +1 -1
- package/models/operations/createagent.d.ts +7 -0
- package/models/operations/createagent.d.ts.map +1 -1
- package/models/operations/createagent.js +18 -4
- package/models/operations/createagent.js.map +1 -1
- package/models/operations/createphonecall.d.ts.map +1 -1
- package/models/operations/createphonecall.js +18 -6
- package/models/operations/createphonecall.js.map +1 -1
- package/models/operations/createphonenumber.d.ts.map +1 -1
- package/models/operations/createphonenumber.js +6 -2
- package/models/operations/createphonenumber.js.map +1 -1
- package/models/operations/createwebcall.d.ts.map +1 -1
- package/models/operations/deleteagent.d.ts.map +1 -1
- package/models/operations/deleteagent.js.map +1 -1
- package/models/operations/deletephonenumber.d.ts.map +1 -1
- package/models/operations/deletephonenumber.js.map +1 -1
- package/models/operations/getagent.d.ts.map +1 -1
- package/models/operations/getagent.js.map +1 -1
- package/models/operations/getcall.d.ts.map +1 -1
- package/models/operations/getcall.js.map +1 -1
- package/models/operations/getphonenumber.d.ts.map +1 -1
- package/models/operations/getphonenumber.js +6 -2
- package/models/operations/getphonenumber.js.map +1 -1
- package/models/operations/listagents.d.ts.map +1 -1
- package/models/operations/listagents.js.map +1 -1
- package/models/operations/listcalls.d.ts.map +1 -1
- package/models/operations/listcalls.js +6 -2
- package/models/operations/listcalls.js.map +1 -1
- package/models/operations/listphonenumbers.d.ts.map +1 -1
- package/models/operations/listphonenumbers.js +6 -2
- package/models/operations/listphonenumbers.js.map +1 -1
- package/models/operations/updateagent.d.ts +7 -0
- package/models/operations/updateagent.d.ts.map +1 -1
- package/models/operations/updateagent.js +22 -4
- package/models/operations/updateagent.js.map +1 -1
- package/models/operations/updatephoneagent.d.ts.map +1 -1
- package/models/operations/updatephoneagent.js +6 -2
- package/models/operations/updatephoneagent.js.map +1 -1
- package/package.json +1 -1
- package/sdk/liveClient.d.ts.map +1 -1
- package/sdk/liveClient.js +7 -2
- package/sdk/liveClient.js.map +1 -1
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +22 -5
- package/sdk/sdk.js.map +1 -1
- package/src/example.ts +122 -65
- package/src/lib/config.ts +32 -32
- package/src/lib/sdks.ts +91 -82
- package/src/lib/security.ts +133 -118
- package/src/models/components/agent.ts +482 -303
- package/src/models/components/agentpromptparams.ts +46 -38
- package/src/models/components/calldetail.ts +137 -125
- package/src/models/components/callphonenumber.ts +46 -38
- package/src/models/components/phonenumber.ts +69 -68
- package/src/models/components/security.ts +1 -1
- package/src/models/errors/createagent.ts +359 -311
- package/src/models/errors/createphonecall.ts +537 -472
- package/src/models/errors/createphonenumber.ts +447 -395
- package/src/models/errors/deleteagent.ts +359 -311
- package/src/models/errors/deletephonenumber.ts +357 -315
- package/src/models/errors/getagent.ts +358 -302
- package/src/models/errors/getcall.ts +348 -294
- package/src/models/errors/getphonenumber.ts +357 -312
- package/src/models/errors/listagents.ts +174 -147
- package/src/models/errors/listcalls.ts +251 -211
- package/src/models/errors/listphonenumbers.ts +252 -217
- package/src/models/errors/updateagent.ts +359 -311
- package/src/models/errors/updatephoneagent.ts +357 -312
- package/src/models/operations/createagent.ts +166 -119
- package/src/models/operations/createphonecall.ts +283 -238
- package/src/models/operations/createphonenumber.ts +118 -98
- package/src/models/operations/createwebcall.ts +13 -13
- package/src/models/operations/deleteagent.ts +94 -78
- package/src/models/operations/deletephonenumber.ts +94 -78
- package/src/models/operations/getagent.ts +104 -88
- package/src/models/operations/getcall.ts +101 -88
- package/src/models/operations/getphonenumber.ts +108 -88
- package/src/models/operations/listagents.ts +68 -60
- package/src/models/operations/listcalls.ts +238 -213
- package/src/models/operations/listphonenumbers.ts +72 -60
- package/src/models/operations/updateagent.ts +227 -163
- package/src/models/operations/updatephoneagent.ts +160 -132
- package/src/sdk/liveClient.ts +11 -7
- package/src/sdk/sdk.ts +1313 -1160
|
@@ -4,353 +4,532 @@
|
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
export type Function = {
|
|
8
|
+
/**
|
|
9
|
+
* Link to the url where the function call parameters would sent to as a json body. Most likely your server endpoint you expose for this function.
|
|
10
|
+
*/
|
|
11
|
+
url: string;
|
|
12
|
+
/**
|
|
13
|
+
* A description of what the function does, used by the model to choose when and how to call the function. Recommended to populate this for better results.
|
|
14
|
+
*/
|
|
15
|
+
description?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* The parameters the functions accepts, described as a JSON Schema object for type object
|
|
22
|
+
*/
|
|
23
|
+
parameters?:
|
|
24
|
+
| {
|
|
25
|
+
/**
|
|
26
|
+
* The type of parameters is object.
|
|
27
|
+
*/
|
|
28
|
+
type: "object";
|
|
29
|
+
/**
|
|
30
|
+
* Defines what properties are required for the parameters.
|
|
31
|
+
*/
|
|
32
|
+
required?: string[] | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Key-value pairs object where each key is the name of a property and each value is a schema used to validate that property.
|
|
35
|
+
*/
|
|
36
|
+
properties: Record<string, any>;
|
|
37
|
+
}
|
|
38
|
+
| undefined;
|
|
39
|
+
};
|
|
17
40
|
|
|
18
41
|
/** @internal */
|
|
19
|
-
export namespace
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
42
|
+
export namespace Function$ {
|
|
43
|
+
export type Inbound = {
|
|
44
|
+
url: string;
|
|
45
|
+
description?: string | undefined;
|
|
46
|
+
name: string;
|
|
47
|
+
parameters?:
|
|
48
|
+
| {
|
|
49
|
+
type: "object";
|
|
50
|
+
required?: string[] | undefined;
|
|
51
|
+
properties: Record<string, any>;
|
|
52
|
+
}
|
|
53
|
+
| undefined;
|
|
54
|
+
};
|
|
24
55
|
|
|
25
|
-
|
|
56
|
+
export const inboundSchema: z.ZodType<Function, z.ZodTypeDef, Inbound> = z
|
|
57
|
+
.object({
|
|
58
|
+
url: z.string(),
|
|
59
|
+
description: z.string().optional(),
|
|
60
|
+
name: z.string(),
|
|
61
|
+
parameters: z
|
|
26
62
|
.object({
|
|
27
|
-
|
|
28
|
-
|
|
63
|
+
type: z.literal("object"),
|
|
64
|
+
required: z.array(z.string()).optional(),
|
|
65
|
+
properties: z.record(z.any()),
|
|
29
66
|
})
|
|
30
|
-
.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
67
|
+
.optional(),
|
|
68
|
+
})
|
|
69
|
+
.transform((v) => {
|
|
70
|
+
return {
|
|
71
|
+
url: v.url,
|
|
72
|
+
...(v.description === undefined
|
|
73
|
+
? null
|
|
74
|
+
: { description: v.description }),
|
|
75
|
+
name: v.name,
|
|
76
|
+
...(v.parameters === undefined ? null : { parameters: v.parameters }),
|
|
77
|
+
};
|
|
78
|
+
});
|
|
36
79
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
80
|
+
export type Outbound = {
|
|
81
|
+
url: string;
|
|
82
|
+
description?: string | undefined;
|
|
83
|
+
name: string;
|
|
84
|
+
parameters?:
|
|
85
|
+
| {
|
|
86
|
+
type: "object";
|
|
87
|
+
required?: string[] | undefined;
|
|
88
|
+
properties: Record<string, any>;
|
|
89
|
+
}
|
|
90
|
+
| undefined;
|
|
91
|
+
};
|
|
41
92
|
|
|
42
|
-
|
|
93
|
+
export const outboundSchema: z.ZodType<Function, z.ZodTypeDef, Inbound> = z
|
|
94
|
+
.object({
|
|
95
|
+
url: z.string(),
|
|
96
|
+
description: z.string().optional(),
|
|
97
|
+
name: z.string(),
|
|
98
|
+
parameters: z
|
|
43
99
|
.object({
|
|
44
|
-
|
|
45
|
-
|
|
100
|
+
type: z.literal("object"),
|
|
101
|
+
required: z.array(z.string()).optional(),
|
|
102
|
+
properties: z.record(z.any()),
|
|
46
103
|
})
|
|
47
|
-
.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
104
|
+
.optional(),
|
|
105
|
+
})
|
|
106
|
+
.transform((v) => {
|
|
107
|
+
return {
|
|
108
|
+
url: v.url,
|
|
109
|
+
...(v.description === undefined
|
|
110
|
+
? null
|
|
111
|
+
: { description: v.description }),
|
|
112
|
+
name: v.name,
|
|
113
|
+
...(v.parameters === undefined ? null : { parameters: v.parameters }),
|
|
114
|
+
};
|
|
115
|
+
});
|
|
53
116
|
}
|
|
54
117
|
|
|
55
|
-
export type
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
118
|
+
export type RetellLlmSetting = {
|
|
119
|
+
/**
|
|
120
|
+
* Retell picked LLM based conversation response.
|
|
121
|
+
*/
|
|
122
|
+
provider: "retell";
|
|
123
|
+
/**
|
|
124
|
+
* The prompt agent will follow. Can use `${YOUR_PARAM_NAME}` to represent dynamic data that would get injected at each call.
|
|
125
|
+
*/
|
|
126
|
+
prompt: string;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/** @internal */
|
|
130
|
+
export namespace RetellLlmSetting$ {
|
|
131
|
+
export type Inbound = {
|
|
132
|
+
provider: "retell";
|
|
133
|
+
prompt: string;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const inboundSchema: z.ZodType<
|
|
137
|
+
RetellLlmSetting,
|
|
138
|
+
z.ZodTypeDef,
|
|
139
|
+
Inbound
|
|
140
|
+
> = z
|
|
141
|
+
.object({
|
|
142
|
+
provider: z.literal("retell"),
|
|
143
|
+
prompt: z.string(),
|
|
144
|
+
})
|
|
145
|
+
.transform((v) => {
|
|
146
|
+
return {
|
|
147
|
+
provider: v.provider,
|
|
148
|
+
prompt: v.prompt,
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
export type Outbound = {
|
|
153
|
+
provider: "retell";
|
|
154
|
+
prompt: string;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export const outboundSchema: z.ZodType<
|
|
158
|
+
Outbound,
|
|
159
|
+
z.ZodTypeDef,
|
|
160
|
+
RetellLlmSetting
|
|
161
|
+
> = z
|
|
162
|
+
.object({
|
|
163
|
+
provider: z.literal("retell"),
|
|
164
|
+
prompt: z.string(),
|
|
165
|
+
})
|
|
166
|
+
.transform((v) => {
|
|
167
|
+
return {
|
|
168
|
+
provider: v.provider,
|
|
169
|
+
prompt: v.prompt,
|
|
170
|
+
};
|
|
171
|
+
});
|
|
68
172
|
}
|
|
69
173
|
|
|
174
|
+
export type CustomLlmSetting = {
|
|
175
|
+
/**
|
|
176
|
+
* Custom response system, usually your custom LLM. Note that you may see a higher latency if provided server is slow.
|
|
177
|
+
*/
|
|
178
|
+
provider: "custom";
|
|
179
|
+
/**
|
|
180
|
+
* The URL we will call for getting response, usually your server.
|
|
181
|
+
*/
|
|
182
|
+
url: string;
|
|
183
|
+
/**
|
|
184
|
+
* Whether the provided URL support return response via Server Sent Events.
|
|
185
|
+
*/
|
|
186
|
+
stream: boolean;
|
|
187
|
+
};
|
|
188
|
+
|
|
70
189
|
/** @internal */
|
|
71
190
|
export namespace CustomLlmSetting$ {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
191
|
+
export type Inbound = {
|
|
192
|
+
provider: "custom";
|
|
193
|
+
url: string;
|
|
194
|
+
stream: boolean;
|
|
195
|
+
};
|
|
77
196
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
197
|
+
export const inboundSchema: z.ZodType<
|
|
198
|
+
CustomLlmSetting,
|
|
199
|
+
z.ZodTypeDef,
|
|
200
|
+
Inbound
|
|
201
|
+
> = z
|
|
202
|
+
.object({
|
|
203
|
+
provider: z.literal("custom"),
|
|
204
|
+
url: z.string(),
|
|
205
|
+
stream: z.boolean(),
|
|
206
|
+
})
|
|
207
|
+
.transform((v) => {
|
|
208
|
+
return {
|
|
209
|
+
provider: v.provider,
|
|
210
|
+
url: v.url,
|
|
211
|
+
stream: v.stream,
|
|
212
|
+
};
|
|
213
|
+
});
|
|
91
214
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
215
|
+
export type Outbound = {
|
|
216
|
+
provider: "custom";
|
|
217
|
+
url: string;
|
|
218
|
+
stream: boolean;
|
|
219
|
+
};
|
|
97
220
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
221
|
+
export const outboundSchema: z.ZodType<
|
|
222
|
+
Outbound,
|
|
223
|
+
z.ZodTypeDef,
|
|
224
|
+
CustomLlmSetting
|
|
225
|
+
> = z
|
|
226
|
+
.object({
|
|
227
|
+
provider: z.literal("custom"),
|
|
228
|
+
url: z.string(),
|
|
229
|
+
stream: z.boolean(),
|
|
230
|
+
})
|
|
231
|
+
.transform((v) => {
|
|
232
|
+
return {
|
|
233
|
+
provider: v.provider,
|
|
234
|
+
url: v.url,
|
|
235
|
+
stream: v.stream,
|
|
236
|
+
};
|
|
237
|
+
});
|
|
111
238
|
}
|
|
112
239
|
|
|
113
240
|
export type InteractionSettingRequest = {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
241
|
+
/**
|
|
242
|
+
* Whether the agent begins the call with a pre-defined message. When this is false, the agent will still start the call, but with a dynamic message. If you wish for user to be the first to talk, set this to true and set `begin_message` as empty string.
|
|
243
|
+
*/
|
|
244
|
+
enableBeginMessage?: boolean | undefined;
|
|
245
|
+
/**
|
|
246
|
+
* Pre-defined message for agent to say in the begining of call. Only used when `enable_begin_message` is true. When empty, agent would wait for user to talk first.
|
|
247
|
+
*/
|
|
248
|
+
beginMessage?: string | undefined;
|
|
249
|
+
/**
|
|
250
|
+
* Whether the agent can end a call. If false, the agent would never end a call.
|
|
251
|
+
*/
|
|
252
|
+
enableEndCall?: boolean | undefined;
|
|
253
|
+
/**
|
|
254
|
+
* Whether the agent attempts to end the call with a pre-defined message. When this is false, the agent might still be the last one speaking in the call, but the massage can be dynamic.
|
|
255
|
+
*/
|
|
256
|
+
enableEndMessage?: boolean | undefined;
|
|
257
|
+
/**
|
|
258
|
+
* Pre-defined message for agent to say when agent ends the call. Only used when `enable_end_call` and `enable_end_message` is true. If you wish for agent to hang up without saying anything, set this to empty string.
|
|
259
|
+
*/
|
|
260
|
+
endMessage?: string | undefined;
|
|
261
|
+
};
|
|
135
262
|
|
|
136
263
|
/** @internal */
|
|
137
264
|
export namespace InteractionSettingRequest$ {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
265
|
+
export type Inbound = {
|
|
266
|
+
enable_begin_message?: boolean | undefined;
|
|
267
|
+
begin_message?: string | undefined;
|
|
268
|
+
enable_end_call?: boolean | undefined;
|
|
269
|
+
enable_end_message?: boolean | undefined;
|
|
270
|
+
end_message?: string | undefined;
|
|
271
|
+
};
|
|
145
272
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
273
|
+
export const inboundSchema: z.ZodType<
|
|
274
|
+
InteractionSettingRequest,
|
|
275
|
+
z.ZodTypeDef,
|
|
276
|
+
Inbound
|
|
277
|
+
> = z
|
|
278
|
+
.object({
|
|
279
|
+
enable_begin_message: z.boolean().optional(),
|
|
280
|
+
begin_message: z.string().optional(),
|
|
281
|
+
enable_end_call: z.boolean().optional(),
|
|
282
|
+
enable_end_message: z.boolean().optional(),
|
|
283
|
+
end_message: z.string().optional(),
|
|
284
|
+
})
|
|
285
|
+
.transform((v) => {
|
|
286
|
+
return {
|
|
287
|
+
...(v.enable_begin_message === undefined
|
|
288
|
+
? null
|
|
289
|
+
: { enableBeginMessage: v.enable_begin_message }),
|
|
290
|
+
...(v.begin_message === undefined
|
|
291
|
+
? null
|
|
292
|
+
: { beginMessage: v.begin_message }),
|
|
293
|
+
...(v.enable_end_call === undefined
|
|
294
|
+
? null
|
|
295
|
+
: { enableEndCall: v.enable_end_call }),
|
|
296
|
+
...(v.enable_end_message === undefined
|
|
297
|
+
? null
|
|
298
|
+
: { enableEndMessage: v.enable_end_message }),
|
|
299
|
+
...(v.end_message === undefined ? null : { endMessage: v.end_message }),
|
|
300
|
+
};
|
|
301
|
+
});
|
|
163
302
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
303
|
+
export type Outbound = {
|
|
304
|
+
enable_begin_message?: boolean | undefined;
|
|
305
|
+
begin_message?: string | undefined;
|
|
306
|
+
enable_end_call?: boolean | undefined;
|
|
307
|
+
enable_end_message?: boolean | undefined;
|
|
308
|
+
end_message?: string | undefined;
|
|
309
|
+
};
|
|
171
310
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
311
|
+
export const outboundSchema: z.ZodType<
|
|
312
|
+
Outbound,
|
|
313
|
+
z.ZodTypeDef,
|
|
314
|
+
InteractionSettingRequest
|
|
315
|
+
> = z
|
|
316
|
+
.object({
|
|
317
|
+
enableBeginMessage: z.boolean().optional(),
|
|
318
|
+
beginMessage: z.string().optional(),
|
|
319
|
+
enableEndCall: z.boolean().optional(),
|
|
320
|
+
enableEndMessage: z.boolean().optional(),
|
|
321
|
+
endMessage: z.string().optional(),
|
|
322
|
+
})
|
|
323
|
+
.transform((v) => {
|
|
324
|
+
return {
|
|
325
|
+
...(v.enableBeginMessage === undefined
|
|
326
|
+
? null
|
|
327
|
+
: { enable_begin_message: v.enableBeginMessage }),
|
|
328
|
+
...(v.beginMessage === undefined
|
|
329
|
+
? null
|
|
330
|
+
: { begin_message: v.beginMessage }),
|
|
331
|
+
...(v.enableEndCall === undefined
|
|
332
|
+
? null
|
|
333
|
+
: { enable_end_call: v.enableEndCall }),
|
|
334
|
+
...(v.enableEndMessage === undefined
|
|
335
|
+
? null
|
|
336
|
+
: { enable_end_message: v.enableEndMessage }),
|
|
337
|
+
...(v.endMessage === undefined ? null : { end_message: v.endMessage }),
|
|
338
|
+
};
|
|
339
|
+
});
|
|
189
340
|
}
|
|
190
341
|
|
|
191
342
|
export type InteractionSettingResponse = {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
343
|
+
/**
|
|
344
|
+
* Whether the agent begins the call with a pre-defined message. When this is false, the agent will still start the call, but with a dynamic message. If you wish for user to be the first to talk, set this to true and set `begin_message` as empty string.
|
|
345
|
+
*/
|
|
346
|
+
enableBeginMessage: boolean;
|
|
347
|
+
/**
|
|
348
|
+
* Pre-defined message for agent to say in the begining of call. Only used when `enable_begin_message` is true. When empty, agent would wait for user to talk first.
|
|
349
|
+
*/
|
|
350
|
+
beginMessage?: string | undefined;
|
|
351
|
+
/**
|
|
352
|
+
* Whether the agent can end a call. If false, the agent would never end a call.
|
|
353
|
+
*/
|
|
354
|
+
enableEndCall: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* Whether the agent attempts to end the call with a pre-defined message. When this is false, the agent might still be the last one speaking in the call, but the massage can be dynamic.
|
|
357
|
+
*/
|
|
358
|
+
enableEndMessage: boolean;
|
|
359
|
+
/**
|
|
360
|
+
* Pre-defined message for agent to say when agent ends the call. Only used when `enable_end_call` and `enable_end_message` is true. If you wish for agent to hang up without saying anything, set this to empty string.
|
|
361
|
+
*/
|
|
362
|
+
endMessage?: string | undefined;
|
|
363
|
+
};
|
|
213
364
|
|
|
214
365
|
/** @internal */
|
|
215
366
|
export namespace InteractionSettingResponse$ {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
367
|
+
export type Inbound = {
|
|
368
|
+
enable_begin_message: boolean;
|
|
369
|
+
begin_message?: string | undefined;
|
|
370
|
+
enable_end_call: boolean;
|
|
371
|
+
enable_end_message: boolean;
|
|
372
|
+
end_message?: string | undefined;
|
|
373
|
+
};
|
|
223
374
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
375
|
+
export const inboundSchema: z.ZodType<
|
|
376
|
+
InteractionSettingResponse,
|
|
377
|
+
z.ZodTypeDef,
|
|
378
|
+
Inbound
|
|
379
|
+
> = z
|
|
380
|
+
.object({
|
|
381
|
+
enable_begin_message: z.boolean(),
|
|
382
|
+
begin_message: z.string().optional(),
|
|
383
|
+
enable_end_call: z.boolean(),
|
|
384
|
+
enable_end_message: z.boolean(),
|
|
385
|
+
end_message: z.string().optional(),
|
|
386
|
+
})
|
|
387
|
+
.transform((v) => {
|
|
388
|
+
return {
|
|
389
|
+
enableBeginMessage: v.enable_begin_message,
|
|
390
|
+
...(v.begin_message === undefined
|
|
391
|
+
? null
|
|
392
|
+
: { beginMessage: v.begin_message }),
|
|
393
|
+
enableEndCall: v.enable_end_call,
|
|
394
|
+
enableEndMessage: v.enable_end_message,
|
|
395
|
+
...(v.end_message === undefined ? null : { endMessage: v.end_message }),
|
|
396
|
+
};
|
|
397
|
+
});
|
|
241
398
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
399
|
+
export type Outbound = {
|
|
400
|
+
enable_begin_message: boolean;
|
|
401
|
+
begin_message?: string | undefined;
|
|
402
|
+
enable_end_call: boolean;
|
|
403
|
+
enable_end_message: boolean;
|
|
404
|
+
end_message?: string | undefined;
|
|
405
|
+
};
|
|
249
406
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
407
|
+
export const outboundSchema: z.ZodType<
|
|
408
|
+
Outbound,
|
|
409
|
+
z.ZodTypeDef,
|
|
410
|
+
InteractionSettingResponse
|
|
411
|
+
> = z
|
|
412
|
+
.object({
|
|
413
|
+
enableBeginMessage: z.boolean(),
|
|
414
|
+
beginMessage: z.string().optional(),
|
|
415
|
+
enableEndCall: z.boolean(),
|
|
416
|
+
enableEndMessage: z.boolean(),
|
|
417
|
+
endMessage: z.string().optional(),
|
|
418
|
+
})
|
|
419
|
+
.transform((v) => {
|
|
420
|
+
return {
|
|
421
|
+
enable_begin_message: v.enableBeginMessage,
|
|
422
|
+
...(v.beginMessage === undefined
|
|
423
|
+
? null
|
|
424
|
+
: { begin_message: v.beginMessage }),
|
|
425
|
+
enable_end_call: v.enableEndCall,
|
|
426
|
+
enable_end_message: v.enableEndMessage,
|
|
427
|
+
...(v.endMessage === undefined ? null : { end_message: v.endMessage }),
|
|
428
|
+
};
|
|
429
|
+
});
|
|
267
430
|
}
|
|
268
431
|
|
|
269
432
|
export type Agent = {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
433
|
+
/**
|
|
434
|
+
* Unique id of agent.
|
|
435
|
+
*/
|
|
436
|
+
agentId: string;
|
|
437
|
+
/**
|
|
438
|
+
* The name of the agent. Only used for your own reference.
|
|
439
|
+
*/
|
|
440
|
+
agentName?: string | undefined;
|
|
441
|
+
/*
|
|
442
|
+
* Determines how to generate the response in the call. Currently supports using our in-house LLM response system or your own custom
|
|
443
|
+
* response generation system.
|
|
444
|
+
*/
|
|
445
|
+
llmSetting: RetellLlmSetting | CustomLlmSetting;
|
|
446
|
+
/**
|
|
447
|
+
* Setting combination that controls interaction flow, like begin and end logic.
|
|
448
|
+
*/
|
|
449
|
+
interactionSetting: InteractionSettingResponse;
|
|
450
|
+
/**
|
|
451
|
+
* Unique voice id used for the agent. Find list of available voices in documentation.
|
|
452
|
+
*/
|
|
453
|
+
voiceId: string;
|
|
454
|
+
/**
|
|
455
|
+
* Last modification timestamp (milliseconds since epoch). Either the time of last update or creation if no updates available.
|
|
456
|
+
*/
|
|
457
|
+
lastModificationTimestamp: number;
|
|
458
|
+
/**
|
|
459
|
+
* Functions are the actions that the agent can perform, like booking appointments, retriving information, etc. By setting this field, either OpenAI's function calling feature or your own custom LLM's logic would determine when the function shall get called, and our server would make the call.
|
|
460
|
+
*/
|
|
461
|
+
functions?: Function[] | undefined;
|
|
295
462
|
};
|
|
296
463
|
|
|
297
464
|
/** @internal */
|
|
298
465
|
export namespace Agent$ {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
466
|
+
export type Inbound = {
|
|
467
|
+
agent_id: string;
|
|
468
|
+
agent_name?: string | undefined;
|
|
469
|
+
llm_setting: RetellLlmSetting$.Inbound | CustomLlmSetting$.Inbound;
|
|
470
|
+
interaction_setting: InteractionSettingResponse$.Inbound;
|
|
471
|
+
voice_id: string;
|
|
472
|
+
last_modification_timestamp: number;
|
|
473
|
+
functions?: Function[] | undefined;
|
|
474
|
+
};
|
|
307
475
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
476
|
+
export const inboundSchema: z.ZodType<Agent, z.ZodTypeDef, Inbound> = z
|
|
477
|
+
.object({
|
|
478
|
+
agent_id: z.string(),
|
|
479
|
+
agent_name: z.string().optional(),
|
|
480
|
+
llm_setting: z.union([
|
|
481
|
+
RetellLlmSetting$.inboundSchema,
|
|
482
|
+
CustomLlmSetting$.inboundSchema,
|
|
483
|
+
]),
|
|
484
|
+
interaction_setting: InteractionSettingResponse$.inboundSchema,
|
|
485
|
+
voice_id: z.string(),
|
|
486
|
+
last_modification_timestamp: z.number().int(),
|
|
487
|
+
functions: z.array(Function$.inboundSchema).optional(),
|
|
488
|
+
})
|
|
489
|
+
.transform((v) => {
|
|
490
|
+
return {
|
|
491
|
+
agentId: v.agent_id,
|
|
492
|
+
...(v.agent_name === undefined ? null : { agentName: v.agent_name }),
|
|
493
|
+
llmSetting: v.llm_setting,
|
|
494
|
+
interactionSetting: v.interaction_setting,
|
|
495
|
+
voiceId: v.voice_id,
|
|
496
|
+
lastModificationTimestamp: v.last_modification_timestamp,
|
|
497
|
+
...(v.functions === undefined ? null : { functions: v.functions }),
|
|
498
|
+
};
|
|
499
|
+
});
|
|
327
500
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
501
|
+
export type Outbound = {
|
|
502
|
+
agent_id: string;
|
|
503
|
+
agent_name?: string | undefined;
|
|
504
|
+
llm_setting: RetellLlmSetting$.Outbound | CustomLlmSetting$.Outbound;
|
|
505
|
+
interaction_setting: InteractionSettingResponse$.Outbound;
|
|
506
|
+
voice_id: string;
|
|
507
|
+
last_modification_timestamp: number;
|
|
508
|
+
functions?: Function[] | undefined;
|
|
509
|
+
};
|
|
336
510
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
511
|
+
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, Agent> = z
|
|
512
|
+
.object({
|
|
513
|
+
agentId: z.string(),
|
|
514
|
+
agentName: z.string().optional(),
|
|
515
|
+
llmSetting: z.union([
|
|
516
|
+
RetellLlmSetting$.outboundSchema,
|
|
517
|
+
CustomLlmSetting$.outboundSchema,
|
|
518
|
+
]),
|
|
519
|
+
interactionSetting: InteractionSettingResponse$.outboundSchema,
|
|
520
|
+
voiceId: z.string(),
|
|
521
|
+
lastModificationTimestamp: z.number().int(),
|
|
522
|
+
functions: z.array(Function$.inboundSchema).optional(),
|
|
523
|
+
})
|
|
524
|
+
.transform((v) => {
|
|
525
|
+
return {
|
|
526
|
+
agent_id: v.agentId,
|
|
527
|
+
...(v.agentName === undefined ? null : { agent_name: v.agentName }),
|
|
528
|
+
llm_setting: v.llmSetting,
|
|
529
|
+
interaction_setting: v.interactionSetting,
|
|
530
|
+
voice_id: v.voiceId,
|
|
531
|
+
last_modification_timestamp: v.lastModificationTimestamp,
|
|
532
|
+
...(v.functions === undefined ? null : { functions: v.functions }),
|
|
533
|
+
};
|
|
534
|
+
});
|
|
356
535
|
}
|