retell-utils 0.3.3 → 0.4.0
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/README.md +44 -0
- package/dist/agent.d.ts +471 -18
- package/dist/agent.js +180 -25
- package/dist/call.d.ts +16 -16
- package/dist/call.js +2 -2
- package/dist/chat-messages.d.ts +1 -1
- package/dist/enums.d.ts +254 -0
- package/dist/enums.js +239 -0
- package/dist/flow.d.ts +1253 -7
- package/dist/flow.js +148 -11
- package/dist/index.d.ts +7 -5
- package/dist/index.js +9 -5
- package/dist/llm.d.ts +379 -4
- package/dist/llm.js +110 -8
- package/dist/phone-number.d.ts +38 -0
- package/dist/phone-number.js +26 -0
- package/dist/phone.d.ts +6 -3
- package/dist/phone.js +10 -3
- package/dist/test-case.d.ts +15 -1
- package/dist/test-case.js +2 -1
- package/dist/transcript.d.ts +2 -2
- package/dist/utils.d.ts +18 -0
- package/dist/utils.js +63 -0
- package/dist/webhook.d.ts +16 -16
- package/package.json +2 -1
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# retell-utils
|
|
2
|
+
|
|
3
|
+
Type-safe [Zod](https://zod.dev) schemas for [Retell AI](https://www.retellai.com/) API resources.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun add retell-utils
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What's included
|
|
12
|
+
|
|
13
|
+
- **Call & chat schemas** with configurable analysis fields via factory functions (`createCallSchemas`, `createChatSchemas`)
|
|
14
|
+
- **Agent config schemas** for voice agents, chat agents, LLMs, and conversation flows
|
|
15
|
+
- **Transcript & message schemas** for voice call transcripts and chat messages
|
|
16
|
+
- **Webhook schemas** via `createWebhookSchemas`
|
|
17
|
+
- **Enums** for call status, disconnection reasons, sentiment, etc.
|
|
18
|
+
- **Phone validation** with E.164 format
|
|
19
|
+
- **Test case schemas** for Retell's agent testing
|
|
20
|
+
- **Pagination utility** for iterating Retell list endpoints
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import {
|
|
26
|
+
createCallSchemas,
|
|
27
|
+
VoiceAgentResponseSchema,
|
|
28
|
+
LlmResponseSchema,
|
|
29
|
+
} from "retell-utils"
|
|
30
|
+
|
|
31
|
+
// Create call schemas with custom analysis fields
|
|
32
|
+
const { CallSchema } = createCallSchemas({
|
|
33
|
+
callAnalysis: { sentiment: z.string(), summary: z.string() },
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
// Validate an agent API response
|
|
37
|
+
const agent = VoiceAgentResponseSchema.parse(apiResponse)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Schemas use `.passthrough()` so they won't break when Retell adds new fields.
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
MIT
|
package/dist/agent.d.ts
CHANGED
|
@@ -32,14 +32,69 @@ export declare const ResponseEngineSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
32
32
|
conversation_flow_id: z.ZodString;
|
|
33
33
|
version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
34
34
|
}, z.core.$strip>], "type">;
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
/** Pronunciation dictionary entry for guiding TTS. */
|
|
36
|
+
export declare const PronunciationEntrySchema: z.ZodObject<{
|
|
37
|
+
word: z.ZodString;
|
|
38
|
+
alphabet: z.ZodEnum<{
|
|
39
|
+
ipa: "ipa";
|
|
40
|
+
cmu: "cmu";
|
|
41
|
+
}>;
|
|
42
|
+
phoneme: z.ZodString;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
/** Post-call/chat analysis field definition (polymorphic on `type`). */
|
|
45
|
+
export declare const PostAnalysisFieldSchema: z.ZodObject<{
|
|
46
|
+
type: z.ZodEnum<{
|
|
47
|
+
string: "string";
|
|
48
|
+
number: "number";
|
|
49
|
+
boolean: "boolean";
|
|
50
|
+
enum: "enum";
|
|
51
|
+
}>;
|
|
52
|
+
name: z.ZodString;
|
|
53
|
+
description: z.ZodOptional<z.ZodString>;
|
|
54
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
55
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
/** PII scrubbing configuration. */
|
|
58
|
+
export declare const PiiConfigSchema: z.ZodObject<{
|
|
59
|
+
mode: z.ZodLiteral<"post_call">;
|
|
60
|
+
categories: z.ZodArray<z.ZodEnum<{
|
|
61
|
+
person_name: "person_name";
|
|
62
|
+
address: "address";
|
|
63
|
+
email: "email";
|
|
64
|
+
phone_number: "phone_number";
|
|
65
|
+
ssn: "ssn";
|
|
66
|
+
passport: "passport";
|
|
67
|
+
driver_license: "driver_license";
|
|
68
|
+
credit_card: "credit_card";
|
|
69
|
+
bank_account: "bank_account";
|
|
70
|
+
password: "password";
|
|
71
|
+
pin: "pin";
|
|
72
|
+
medical_id: "medical_id";
|
|
73
|
+
date_of_birth: "date_of_birth";
|
|
74
|
+
}>>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
/** Guardrail configuration for input/output topic filtering. */
|
|
77
|
+
export declare const GuardrailConfigSchema: z.ZodObject<{
|
|
78
|
+
output_topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
79
|
+
input_topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
/** Knowledge base retrieval configuration. */
|
|
82
|
+
export declare const KbConfigSchema: z.ZodObject<{
|
|
83
|
+
top_k: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
filter_score: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
/** MCP server configuration. */
|
|
87
|
+
export declare const McpConfigSchema: z.ZodObject<{
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
url: z.ZodString;
|
|
90
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
91
|
+
query_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
92
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
/** Zod schema for a voice agent response from the Retell API. */
|
|
40
95
|
export declare const VoiceAgentResponseSchema: z.ZodObject<{
|
|
41
96
|
agent_id: z.ZodString;
|
|
42
|
-
|
|
97
|
+
version: z.ZodNumber;
|
|
43
98
|
response_engine: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
44
99
|
type: z.ZodLiteral<"retell-llm">;
|
|
45
100
|
llm_id: z.ZodString;
|
|
@@ -53,23 +108,256 @@ export declare const VoiceAgentResponseSchema: z.ZodObject<{
|
|
|
53
108
|
version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
54
109
|
}, z.core.$strip>], "type">;
|
|
55
110
|
voice_id: z.ZodString;
|
|
56
|
-
version: z.ZodOptional<z.ZodNumber>;
|
|
57
|
-
is_published: z.ZodOptional<z.ZodBoolean>;
|
|
58
111
|
last_modification_timestamp: z.ZodNumber;
|
|
59
|
-
|
|
112
|
+
channel: z.ZodOptional<z.ZodLiteral<"voice">>;
|
|
113
|
+
is_published: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
agent_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
+
version_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
|
+
version_title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
117
|
+
voice_model: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
118
|
+
eleven_turbo_v2: "eleven_turbo_v2";
|
|
119
|
+
eleven_flash_v2: "eleven_flash_v2";
|
|
120
|
+
eleven_turbo_v2_5: "eleven_turbo_v2_5";
|
|
121
|
+
eleven_flash_v2_5: "eleven_flash_v2_5";
|
|
122
|
+
eleven_multilingual_v2: "eleven_multilingual_v2";
|
|
123
|
+
"sonic-2": "sonic-2";
|
|
124
|
+
"sonic-3": "sonic-3";
|
|
125
|
+
"sonic-3-latest": "sonic-3-latest";
|
|
126
|
+
"sonic-turbo": "sonic-turbo";
|
|
127
|
+
"tts-1": "tts-1";
|
|
128
|
+
"gpt-4o-mini-tts": "gpt-4o-mini-tts";
|
|
129
|
+
"speech-02-turbo": "speech-02-turbo";
|
|
130
|
+
"speech-2.8-turbo": "speech-2.8-turbo";
|
|
131
|
+
}>>>;
|
|
132
|
+
fallback_voice_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
133
|
+
voice_temperature: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
voice_speed: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
enable_dynamic_voice_speed: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
voice_emotion: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
138
|
+
calm: "calm";
|
|
139
|
+
sympathetic: "sympathetic";
|
|
140
|
+
happy: "happy";
|
|
141
|
+
sad: "sad";
|
|
142
|
+
angry: "angry";
|
|
143
|
+
fearful: "fearful";
|
|
144
|
+
surprised: "surprised";
|
|
145
|
+
}>>>;
|
|
146
|
+
responsiveness: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
interruption_sensitivity: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
enable_backchannel: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
+
backchannel_frequency: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
backchannel_words: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
151
|
+
reminder_trigger_ms: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
reminder_max_count: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
ambient_sound: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
154
|
+
"coffee-shop": "coffee-shop";
|
|
155
|
+
"convention-hall": "convention-hall";
|
|
156
|
+
"summer-outdoor": "summer-outdoor";
|
|
157
|
+
"mountain-outdoor": "mountain-outdoor";
|
|
158
|
+
"static-noise": "static-noise";
|
|
159
|
+
"call-center": "call-center";
|
|
160
|
+
}>>>;
|
|
161
|
+
ambient_sound_volume: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
language: z.ZodOptional<z.ZodEnum<{
|
|
163
|
+
"en-US": "en-US";
|
|
164
|
+
"en-IN": "en-IN";
|
|
165
|
+
"en-GB": "en-GB";
|
|
166
|
+
"en-AU": "en-AU";
|
|
167
|
+
"en-NZ": "en-NZ";
|
|
168
|
+
"de-DE": "de-DE";
|
|
169
|
+
"es-ES": "es-ES";
|
|
170
|
+
"es-419": "es-419";
|
|
171
|
+
"hi-IN": "hi-IN";
|
|
172
|
+
"fr-FR": "fr-FR";
|
|
173
|
+
"fr-CA": "fr-CA";
|
|
174
|
+
"ja-JP": "ja-JP";
|
|
175
|
+
"pt-PT": "pt-PT";
|
|
176
|
+
"pt-BR": "pt-BR";
|
|
177
|
+
"zh-CN": "zh-CN";
|
|
178
|
+
"ru-RU": "ru-RU";
|
|
179
|
+
"it-IT": "it-IT";
|
|
180
|
+
"ko-KR": "ko-KR";
|
|
181
|
+
"nl-NL": "nl-NL";
|
|
182
|
+
"nl-BE": "nl-BE";
|
|
183
|
+
"pl-PL": "pl-PL";
|
|
184
|
+
"tr-TR": "tr-TR";
|
|
185
|
+
"vi-VN": "vi-VN";
|
|
186
|
+
"ro-RO": "ro-RO";
|
|
187
|
+
"bg-BG": "bg-BG";
|
|
188
|
+
"ca-ES": "ca-ES";
|
|
189
|
+
"th-TH": "th-TH";
|
|
190
|
+
"da-DK": "da-DK";
|
|
191
|
+
"fi-FI": "fi-FI";
|
|
192
|
+
"el-GR": "el-GR";
|
|
193
|
+
"hu-HU": "hu-HU";
|
|
194
|
+
"id-ID": "id-ID";
|
|
195
|
+
"no-NO": "no-NO";
|
|
196
|
+
"sk-SK": "sk-SK";
|
|
197
|
+
"sv-SE": "sv-SE";
|
|
198
|
+
"lt-LT": "lt-LT";
|
|
199
|
+
"lv-LV": "lv-LV";
|
|
200
|
+
"cs-CZ": "cs-CZ";
|
|
201
|
+
"ms-MY": "ms-MY";
|
|
202
|
+
"af-ZA": "af-ZA";
|
|
203
|
+
"ar-SA": "ar-SA";
|
|
204
|
+
"az-AZ": "az-AZ";
|
|
205
|
+
"bs-BA": "bs-BA";
|
|
206
|
+
"cy-GB": "cy-GB";
|
|
207
|
+
"fa-IR": "fa-IR";
|
|
208
|
+
"fil-PH": "fil-PH";
|
|
209
|
+
"gl-ES": "gl-ES";
|
|
210
|
+
"he-IL": "he-IL";
|
|
211
|
+
"hr-HR": "hr-HR";
|
|
212
|
+
"hy-AM": "hy-AM";
|
|
213
|
+
"is-IS": "is-IS";
|
|
214
|
+
"kk-KZ": "kk-KZ";
|
|
215
|
+
"kn-IN": "kn-IN";
|
|
216
|
+
"mk-MK": "mk-MK";
|
|
217
|
+
"mr-IN": "mr-IN";
|
|
218
|
+
"ne-NP": "ne-NP";
|
|
219
|
+
"sl-SI": "sl-SI";
|
|
220
|
+
"sr-RS": "sr-RS";
|
|
221
|
+
"sw-KE": "sw-KE";
|
|
222
|
+
"ta-IN": "ta-IN";
|
|
223
|
+
"ur-IN": "ur-IN";
|
|
224
|
+
"yue-CN": "yue-CN";
|
|
225
|
+
"uk-UA": "uk-UA";
|
|
226
|
+
multi: "multi";
|
|
227
|
+
}>>;
|
|
228
|
+
stt_mode: z.ZodOptional<z.ZodEnum<{
|
|
229
|
+
fast: "fast";
|
|
230
|
+
accurate: "accurate";
|
|
231
|
+
}>>;
|
|
232
|
+
custom_stt_config: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
234
|
+
endpointing_ms: z.ZodOptional<z.ZodNumber>;
|
|
235
|
+
}, z.core.$strip>>;
|
|
236
|
+
vocab_specialization: z.ZodOptional<z.ZodEnum<{
|
|
237
|
+
general: "general";
|
|
238
|
+
medical: "medical";
|
|
239
|
+
}>>;
|
|
240
|
+
normalize_for_speech: z.ZodOptional<z.ZodBoolean>;
|
|
241
|
+
boosted_keywords: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
242
|
+
pronunciation_dictionary: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
243
|
+
word: z.ZodString;
|
|
244
|
+
alphabet: z.ZodEnum<{
|
|
245
|
+
ipa: "ipa";
|
|
246
|
+
cmu: "cmu";
|
|
247
|
+
}>;
|
|
248
|
+
phoneme: z.ZodString;
|
|
249
|
+
}, z.core.$strip>>>>;
|
|
250
|
+
webhook_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
251
|
+
webhook_events: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
252
|
+
call_started: "call_started";
|
|
253
|
+
call_ended: "call_ended";
|
|
254
|
+
call_analyzed: "call_analyzed";
|
|
255
|
+
transcript_updated: "transcript_updated";
|
|
256
|
+
transfer_started: "transfer_started";
|
|
257
|
+
transfer_bridged: "transfer_bridged";
|
|
258
|
+
transfer_cancelled: "transfer_cancelled";
|
|
259
|
+
transfer_ended: "transfer_ended";
|
|
260
|
+
}>>>>;
|
|
261
|
+
webhook_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
end_call_after_silence_ms: z.ZodOptional<z.ZodNumber>;
|
|
263
|
+
max_call_duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
264
|
+
begin_message_delay_ms: z.ZodOptional<z.ZodNumber>;
|
|
265
|
+
ring_duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
266
|
+
enable_voicemail_detection: z.ZodOptional<z.ZodBoolean>;
|
|
267
|
+
voicemail_message: z.ZodOptional<z.ZodString>;
|
|
268
|
+
voicemail_detection_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
269
|
+
voicemail_option: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
270
|
+
action: z.ZodObject<{
|
|
271
|
+
type: z.ZodEnum<{
|
|
272
|
+
prompt: "prompt";
|
|
273
|
+
static_text: "static_text";
|
|
274
|
+
hangup: "hangup";
|
|
275
|
+
}>;
|
|
276
|
+
text: z.ZodOptional<z.ZodString>;
|
|
277
|
+
}, z.core.$strip>;
|
|
278
|
+
}, z.core.$strip>>>;
|
|
279
|
+
ivr_option: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
280
|
+
action: z.ZodObject<{
|
|
281
|
+
type: z.ZodEnum<{
|
|
282
|
+
prompt: "prompt";
|
|
283
|
+
static_text: "static_text";
|
|
284
|
+
hangup: "hangup";
|
|
285
|
+
}>;
|
|
286
|
+
}, z.core.$strip>;
|
|
287
|
+
}, z.core.$strip>>>;
|
|
288
|
+
allow_user_dtmf: z.ZodOptional<z.ZodBoolean>;
|
|
289
|
+
user_dtmf_options: z.ZodOptional<z.ZodObject<{
|
|
290
|
+
digit_limit: z.ZodOptional<z.ZodNumber>;
|
|
291
|
+
termination_key: z.ZodOptional<z.ZodString>;
|
|
292
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
293
|
+
}, z.core.$strip>>;
|
|
294
|
+
post_call_analysis_data: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
295
|
+
type: z.ZodEnum<{
|
|
296
|
+
string: "string";
|
|
297
|
+
number: "number";
|
|
298
|
+
boolean: "boolean";
|
|
299
|
+
enum: "enum";
|
|
300
|
+
}>;
|
|
301
|
+
name: z.ZodString;
|
|
302
|
+
description: z.ZodOptional<z.ZodString>;
|
|
303
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
304
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
305
|
+
}, z.core.$strip>>>>;
|
|
306
|
+
post_call_analysis_model: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
307
|
+
"gpt-4.1": "gpt-4.1";
|
|
308
|
+
"gpt-4.1-mini": "gpt-4.1-mini";
|
|
309
|
+
"gpt-4.1-nano": "gpt-4.1-nano";
|
|
310
|
+
"gpt-5": "gpt-5";
|
|
311
|
+
"gpt-5.1": "gpt-5.1";
|
|
312
|
+
"gpt-5.2": "gpt-5.2";
|
|
313
|
+
"gpt-5-mini": "gpt-5-mini";
|
|
314
|
+
"gpt-5-nano": "gpt-5-nano";
|
|
315
|
+
"claude-4.5-sonnet": "claude-4.5-sonnet";
|
|
316
|
+
"claude-4.5-haiku": "claude-4.5-haiku";
|
|
317
|
+
"gemini-2.5-flash": "gemini-2.5-flash";
|
|
318
|
+
"gemini-2.5-flash-lite": "gemini-2.5-flash-lite";
|
|
319
|
+
"gemini-3.0-flash": "gemini-3.0-flash";
|
|
320
|
+
}>>>;
|
|
321
|
+
analysis_successful_prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
322
|
+
analysis_summary_prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
323
|
data_storage_setting: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
61
324
|
everything: "everything";
|
|
62
325
|
everything_except_pii: "everything_except_pii";
|
|
63
326
|
basic_attributes_only: "basic_attributes_only";
|
|
64
327
|
}>>>;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
328
|
+
opt_in_signed_url: z.ZodOptional<z.ZodBoolean>;
|
|
329
|
+
signed_url_expiration_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
330
|
+
denoising_mode: z.ZodOptional<z.ZodEnum<{
|
|
331
|
+
"noise-cancellation": "noise-cancellation";
|
|
332
|
+
"noise-and-background-speech-cancellation": "noise-and-background-speech-cancellation";
|
|
333
|
+
}>>;
|
|
334
|
+
pii_config: z.ZodOptional<z.ZodObject<{
|
|
335
|
+
mode: z.ZodLiteral<"post_call">;
|
|
336
|
+
categories: z.ZodArray<z.ZodEnum<{
|
|
337
|
+
person_name: "person_name";
|
|
338
|
+
address: "address";
|
|
339
|
+
email: "email";
|
|
340
|
+
phone_number: "phone_number";
|
|
341
|
+
ssn: "ssn";
|
|
342
|
+
passport: "passport";
|
|
343
|
+
driver_license: "driver_license";
|
|
344
|
+
credit_card: "credit_card";
|
|
345
|
+
bank_account: "bank_account";
|
|
346
|
+
password: "password";
|
|
347
|
+
pin: "pin";
|
|
348
|
+
medical_id: "medical_id";
|
|
349
|
+
date_of_birth: "date_of_birth";
|
|
350
|
+
}>>;
|
|
351
|
+
}, z.core.$strip>>;
|
|
352
|
+
guardrail_config: z.ZodOptional<z.ZodObject<{
|
|
353
|
+
output_topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
354
|
+
input_topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
355
|
+
}, z.core.$strip>>;
|
|
356
|
+
is_public: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
/** Zod schema for a chat agent response from the Retell API. */
|
|
70
359
|
export declare const ChatAgentResponseSchema: z.ZodObject<{
|
|
71
360
|
agent_id: z.ZodString;
|
|
72
|
-
agent_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
361
|
response_engine: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
74
362
|
type: z.ZodLiteral<"retell-llm">;
|
|
75
363
|
llm_id: z.ZodString;
|
|
@@ -82,13 +370,178 @@ export declare const ChatAgentResponseSchema: z.ZodObject<{
|
|
|
82
370
|
conversation_flow_id: z.ZodString;
|
|
83
371
|
version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
84
372
|
}, z.core.$strip>], "type">;
|
|
373
|
+
last_modification_timestamp: z.ZodNumber;
|
|
374
|
+
channel: z.ZodOptional<z.ZodLiteral<"chat">>;
|
|
85
375
|
version: z.ZodOptional<z.ZodNumber>;
|
|
86
376
|
is_published: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
-
|
|
88
|
-
|
|
377
|
+
agent_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
378
|
+
version_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
379
|
+
version_title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
380
|
+
auto_close_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
381
|
+
end_chat_after_silence_ms: z.ZodOptional<z.ZodNumber>;
|
|
382
|
+
end_call_after_silence_ms: z.ZodOptional<z.ZodNumber>;
|
|
383
|
+
language: z.ZodOptional<z.ZodEnum<{
|
|
384
|
+
"en-US": "en-US";
|
|
385
|
+
"en-IN": "en-IN";
|
|
386
|
+
"en-GB": "en-GB";
|
|
387
|
+
"en-AU": "en-AU";
|
|
388
|
+
"en-NZ": "en-NZ";
|
|
389
|
+
"de-DE": "de-DE";
|
|
390
|
+
"es-ES": "es-ES";
|
|
391
|
+
"es-419": "es-419";
|
|
392
|
+
"hi-IN": "hi-IN";
|
|
393
|
+
"fr-FR": "fr-FR";
|
|
394
|
+
"fr-CA": "fr-CA";
|
|
395
|
+
"ja-JP": "ja-JP";
|
|
396
|
+
"pt-PT": "pt-PT";
|
|
397
|
+
"pt-BR": "pt-BR";
|
|
398
|
+
"zh-CN": "zh-CN";
|
|
399
|
+
"ru-RU": "ru-RU";
|
|
400
|
+
"it-IT": "it-IT";
|
|
401
|
+
"ko-KR": "ko-KR";
|
|
402
|
+
"nl-NL": "nl-NL";
|
|
403
|
+
"nl-BE": "nl-BE";
|
|
404
|
+
"pl-PL": "pl-PL";
|
|
405
|
+
"tr-TR": "tr-TR";
|
|
406
|
+
"vi-VN": "vi-VN";
|
|
407
|
+
"ro-RO": "ro-RO";
|
|
408
|
+
"bg-BG": "bg-BG";
|
|
409
|
+
"ca-ES": "ca-ES";
|
|
410
|
+
"th-TH": "th-TH";
|
|
411
|
+
"da-DK": "da-DK";
|
|
412
|
+
"fi-FI": "fi-FI";
|
|
413
|
+
"el-GR": "el-GR";
|
|
414
|
+
"hu-HU": "hu-HU";
|
|
415
|
+
"id-ID": "id-ID";
|
|
416
|
+
"no-NO": "no-NO";
|
|
417
|
+
"sk-SK": "sk-SK";
|
|
418
|
+
"sv-SE": "sv-SE";
|
|
419
|
+
"lt-LT": "lt-LT";
|
|
420
|
+
"lv-LV": "lv-LV";
|
|
421
|
+
"cs-CZ": "cs-CZ";
|
|
422
|
+
"ms-MY": "ms-MY";
|
|
423
|
+
"af-ZA": "af-ZA";
|
|
424
|
+
"ar-SA": "ar-SA";
|
|
425
|
+
"az-AZ": "az-AZ";
|
|
426
|
+
"bs-BA": "bs-BA";
|
|
427
|
+
"cy-GB": "cy-GB";
|
|
428
|
+
"fa-IR": "fa-IR";
|
|
429
|
+
"fil-PH": "fil-PH";
|
|
430
|
+
"gl-ES": "gl-ES";
|
|
431
|
+
"he-IL": "he-IL";
|
|
432
|
+
"hr-HR": "hr-HR";
|
|
433
|
+
"hy-AM": "hy-AM";
|
|
434
|
+
"is-IS": "is-IS";
|
|
435
|
+
"kk-KZ": "kk-KZ";
|
|
436
|
+
"kn-IN": "kn-IN";
|
|
437
|
+
"mk-MK": "mk-MK";
|
|
438
|
+
"mr-IN": "mr-IN";
|
|
439
|
+
"ne-NP": "ne-NP";
|
|
440
|
+
"sl-SI": "sl-SI";
|
|
441
|
+
"sr-RS": "sr-RS";
|
|
442
|
+
"sw-KE": "sw-KE";
|
|
443
|
+
"ta-IN": "ta-IN";
|
|
444
|
+
"ur-IN": "ur-IN";
|
|
445
|
+
"yue-CN": "yue-CN";
|
|
446
|
+
"uk-UA": "uk-UA";
|
|
447
|
+
multi: "multi";
|
|
448
|
+
}>>;
|
|
449
|
+
webhook_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
450
|
+
webhook_events: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
451
|
+
call_started: "call_started";
|
|
452
|
+
call_ended: "call_ended";
|
|
453
|
+
call_analyzed: "call_analyzed";
|
|
454
|
+
transcript_updated: "transcript_updated";
|
|
455
|
+
transfer_started: "transfer_started";
|
|
456
|
+
transfer_bridged: "transfer_bridged";
|
|
457
|
+
transfer_cancelled: "transfer_cancelled";
|
|
458
|
+
transfer_ended: "transfer_ended";
|
|
459
|
+
}>>>>;
|
|
460
|
+
webhook_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
461
|
+
post_call_analysis_data: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
462
|
+
type: z.ZodEnum<{
|
|
463
|
+
string: "string";
|
|
464
|
+
number: "number";
|
|
465
|
+
boolean: "boolean";
|
|
466
|
+
enum: "enum";
|
|
467
|
+
}>;
|
|
468
|
+
name: z.ZodString;
|
|
469
|
+
description: z.ZodOptional<z.ZodString>;
|
|
470
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
471
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
472
|
+
}, z.core.$strip>>>>;
|
|
473
|
+
post_call_analysis_model: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
474
|
+
"gpt-4.1": "gpt-4.1";
|
|
475
|
+
"gpt-4.1-mini": "gpt-4.1-mini";
|
|
476
|
+
"gpt-4.1-nano": "gpt-4.1-nano";
|
|
477
|
+
"gpt-5": "gpt-5";
|
|
478
|
+
"gpt-5.1": "gpt-5.1";
|
|
479
|
+
"gpt-5.2": "gpt-5.2";
|
|
480
|
+
"gpt-5-mini": "gpt-5-mini";
|
|
481
|
+
"gpt-5-nano": "gpt-5-nano";
|
|
482
|
+
"claude-4.5-sonnet": "claude-4.5-sonnet";
|
|
483
|
+
"claude-4.5-haiku": "claude-4.5-haiku";
|
|
484
|
+
"gemini-2.5-flash": "gemini-2.5-flash";
|
|
485
|
+
"gemini-2.5-flash-lite": "gemini-2.5-flash-lite";
|
|
486
|
+
"gemini-3.0-flash": "gemini-3.0-flash";
|
|
487
|
+
}>>>;
|
|
488
|
+
post_chat_analysis_data: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
489
|
+
type: z.ZodEnum<{
|
|
490
|
+
string: "string";
|
|
491
|
+
number: "number";
|
|
492
|
+
boolean: "boolean";
|
|
493
|
+
enum: "enum";
|
|
494
|
+
}>;
|
|
495
|
+
name: z.ZodString;
|
|
496
|
+
description: z.ZodOptional<z.ZodString>;
|
|
497
|
+
examples: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
498
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
499
|
+
}, z.core.$strip>>>>;
|
|
500
|
+
post_chat_analysis_model: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
501
|
+
"gpt-4.1": "gpt-4.1";
|
|
502
|
+
"gpt-4.1-mini": "gpt-4.1-mini";
|
|
503
|
+
"gpt-4.1-nano": "gpt-4.1-nano";
|
|
504
|
+
"gpt-5": "gpt-5";
|
|
505
|
+
"gpt-5.1": "gpt-5.1";
|
|
506
|
+
"gpt-5.2": "gpt-5.2";
|
|
507
|
+
"gpt-5-mini": "gpt-5-mini";
|
|
508
|
+
"gpt-5-nano": "gpt-5-nano";
|
|
509
|
+
"claude-4.5-sonnet": "claude-4.5-sonnet";
|
|
510
|
+
"claude-4.5-haiku": "claude-4.5-haiku";
|
|
511
|
+
"gemini-2.5-flash": "gemini-2.5-flash";
|
|
512
|
+
"gemini-2.5-flash-lite": "gemini-2.5-flash-lite";
|
|
513
|
+
"gemini-3.0-flash": "gemini-3.0-flash";
|
|
514
|
+
}>>>;
|
|
515
|
+
analysis_successful_prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
516
|
+
analysis_summary_prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
89
517
|
data_storage_setting: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
90
518
|
everything: "everything";
|
|
91
519
|
everything_except_pii: "everything_except_pii";
|
|
92
520
|
basic_attributes_only: "basic_attributes_only";
|
|
93
521
|
}>>>;
|
|
94
|
-
|
|
522
|
+
opt_in_signed_url: z.ZodOptional<z.ZodBoolean>;
|
|
523
|
+
signed_url_expiration_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
524
|
+
pii_config: z.ZodOptional<z.ZodObject<{
|
|
525
|
+
mode: z.ZodLiteral<"post_call">;
|
|
526
|
+
categories: z.ZodArray<z.ZodEnum<{
|
|
527
|
+
person_name: "person_name";
|
|
528
|
+
address: "address";
|
|
529
|
+
email: "email";
|
|
530
|
+
phone_number: "phone_number";
|
|
531
|
+
ssn: "ssn";
|
|
532
|
+
passport: "passport";
|
|
533
|
+
driver_license: "driver_license";
|
|
534
|
+
credit_card: "credit_card";
|
|
535
|
+
bank_account: "bank_account";
|
|
536
|
+
password: "password";
|
|
537
|
+
pin: "pin";
|
|
538
|
+
medical_id: "medical_id";
|
|
539
|
+
date_of_birth: "date_of_birth";
|
|
540
|
+
}>>;
|
|
541
|
+
}, z.core.$strip>>;
|
|
542
|
+
guardrail_config: z.ZodOptional<z.ZodObject<{
|
|
543
|
+
output_topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
544
|
+
input_topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
545
|
+
}, z.core.$strip>>;
|
|
546
|
+
is_public: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
547
|
+
}, z.core.$strip>;
|