retell-utils 0.3.3 → 0.4.1
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 +74 -74
- package/dist/call.js +4 -4
- 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 +10 -10
- package/dist/transcript.js +4 -4
- package/dist/utils.d.ts +18 -0
- package/dist/utils.js +63 -0
- package/dist/webhook.d.ts +74 -74
- package/package.json +2 -1
package/dist/flow.js
CHANGED
|
@@ -1,15 +1,152 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { KbConfigSchema, McpConfigSchema } from "./agent.js";
|
|
3
|
+
import { EquationCombinatorSchema, EquationOperatorSchema, FlowInstructionTypeSchema, FlowNodeTypeSchema, FlowTransitionConditionTypeSchema, LlmModelSchema, StartSpeakerSchema, } from "./enums.js";
|
|
4
|
+
import { LlmToolSchema, TransferDestinationSchema, TransferOptionSchema, } from "./llm.js";
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Shared sub-schemas
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
/** Display position in the visual editor. */
|
|
9
|
+
const DisplayPositionSchema = z.object({
|
|
10
|
+
x: z.number(),
|
|
11
|
+
y: z.number(),
|
|
12
|
+
});
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Flow nodes & edges
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
/** A single equation within an equation-type transition condition. */
|
|
17
|
+
export const FlowEquationSchema = z.object({
|
|
18
|
+
left: z.string(),
|
|
19
|
+
operator: EquationOperatorSchema,
|
|
20
|
+
/** Right side is not required for "exists" and "not_exist" operators. */
|
|
21
|
+
right: z.string().optional(),
|
|
22
|
+
});
|
|
23
|
+
/** Transition condition on a flow edge. */
|
|
24
|
+
export const FlowTransitionConditionSchema = z.object({
|
|
25
|
+
type: FlowTransitionConditionTypeSchema.optional(),
|
|
26
|
+
prompt: z.string().optional(),
|
|
27
|
+
equations: z.array(FlowEquationSchema).optional(),
|
|
28
|
+
operator: EquationCombinatorSchema.optional(),
|
|
29
|
+
});
|
|
30
|
+
/** Schema for a flow edge (transition between nodes). */
|
|
31
|
+
export const FlowEdgeSchema = z.object({
|
|
32
|
+
id: z.string().optional(),
|
|
33
|
+
destination_node_id: z.string().optional(),
|
|
34
|
+
transition_condition: FlowTransitionConditionSchema.optional(),
|
|
35
|
+
});
|
|
36
|
+
/** A single turn in a fine-tune example transcript. */
|
|
37
|
+
const FinetuneTranscriptTurnSchema = z.object({
|
|
38
|
+
role: z.string(),
|
|
39
|
+
content: z.string().optional(),
|
|
40
|
+
});
|
|
41
|
+
/** Fine-tune example for conversation or transition behavior. */
|
|
42
|
+
const FinetuneExampleSchema = z.object({
|
|
43
|
+
id: z.string().optional(),
|
|
44
|
+
destination_node_id: z.string().optional(),
|
|
45
|
+
transcript: z.array(FinetuneTranscriptTurnSchema).optional(),
|
|
46
|
+
});
|
|
47
|
+
/** Global node setting (when this node should be entered). */
|
|
48
|
+
const GlobalNodeSettingSchema = z.object({
|
|
49
|
+
condition: z.string().optional(),
|
|
50
|
+
positive_finetune_examples: z.array(FinetuneExampleSchema).optional(),
|
|
51
|
+
negative_finetune_examples: z.array(FinetuneExampleSchema).optional(),
|
|
52
|
+
});
|
|
53
|
+
/** Schema for a conversation flow node with all known fields explicit. */
|
|
54
|
+
export const FlowNodeSchema = z.object({
|
|
55
|
+
// Common
|
|
56
|
+
id: z.string().optional(),
|
|
57
|
+
name: z.string().optional(),
|
|
58
|
+
type: FlowNodeTypeSchema.optional(),
|
|
59
|
+
instruction: z
|
|
60
|
+
.object({
|
|
61
|
+
type: FlowInstructionTypeSchema.optional(),
|
|
62
|
+
text: z.string().optional(),
|
|
63
|
+
})
|
|
64
|
+
.optional(),
|
|
65
|
+
display_position: DisplayPositionSchema.nullable().optional(),
|
|
66
|
+
// Edges
|
|
67
|
+
edges: z.array(FlowEdgeSchema).optional(),
|
|
68
|
+
edge: FlowEdgeSchema.optional(),
|
|
69
|
+
else_edge: FlowEdgeSchema.optional(),
|
|
70
|
+
skip_response_edge: FlowEdgeSchema.optional(),
|
|
71
|
+
// Conversation node fields
|
|
72
|
+
start_speaker: StartSpeakerSchema.optional(),
|
|
73
|
+
global_node_setting: GlobalNodeSettingSchema.optional(),
|
|
74
|
+
finetune_transition_examples: z
|
|
75
|
+
.array(FinetuneExampleSchema)
|
|
76
|
+
.nullable()
|
|
77
|
+
.optional(),
|
|
78
|
+
finetune_conversation_examples: z
|
|
79
|
+
.array(FinetuneExampleSchema)
|
|
80
|
+
.nullable()
|
|
81
|
+
.optional(),
|
|
82
|
+
// Function node fields
|
|
83
|
+
tool_id: z.string().optional(),
|
|
84
|
+
tool_type: z.string().optional(),
|
|
85
|
+
speak_during_execution: z.boolean().optional(),
|
|
86
|
+
wait_for_result: z.boolean().optional(),
|
|
87
|
+
// Transfer node fields
|
|
88
|
+
transfer_destination: TransferDestinationSchema.optional(),
|
|
89
|
+
transfer_option: TransferOptionSchema.optional(),
|
|
90
|
+
});
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// Flow components
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
/** A local component embedded within a conversation flow. */
|
|
95
|
+
export const FlowComponentSchema = z.object({
|
|
96
|
+
name: z.string().optional(),
|
|
97
|
+
nodes: z.array(FlowNodeSchema).optional(),
|
|
98
|
+
tools: z.array(LlmToolSchema).nullable().optional(),
|
|
99
|
+
mcps: z.array(McpConfigSchema).nullable().optional(),
|
|
100
|
+
start_node_id: z.string().optional(),
|
|
101
|
+
begin_tag_display_position: DisplayPositionSchema.nullable().optional(),
|
|
102
|
+
});
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
// Model choice
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
/** Model selection configuration for conversation flows. */
|
|
107
|
+
const FlowModelChoiceSchema = z.object({
|
|
108
|
+
type: z.literal("cascading"),
|
|
109
|
+
model: LlmModelSchema,
|
|
110
|
+
high_priority: z.boolean().optional(),
|
|
111
|
+
});
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
// Conversation flow response
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
115
|
+
/** Zod schema for a conversation flow response from the Retell API. */
|
|
116
|
+
export const ConversationFlowResponseSchema = z.object({
|
|
117
|
+
// Required
|
|
8
118
|
conversation_flow_id: z.string(),
|
|
9
119
|
version: z.number(),
|
|
10
|
-
|
|
11
|
-
|
|
120
|
+
// Model
|
|
121
|
+
model_choice: FlowModelChoiceSchema.optional(),
|
|
122
|
+
model_temperature: z.number().nullable().optional(),
|
|
123
|
+
tool_call_strict_mode: z.boolean().nullable().optional(),
|
|
124
|
+
// Knowledge base
|
|
125
|
+
knowledge_base_ids: z.array(z.string()).nullable().optional(),
|
|
126
|
+
kb_config: KbConfigSchema.optional(),
|
|
127
|
+
// Conversation
|
|
128
|
+
start_speaker: StartSpeakerSchema.optional(),
|
|
129
|
+
begin_after_user_silence_ms: z.number().nullable().optional(),
|
|
12
130
|
global_prompt: z.string().nullable().optional(),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.
|
|
131
|
+
is_published: z.boolean().optional(),
|
|
132
|
+
// Tools
|
|
133
|
+
tools: z.array(LlmToolSchema).nullable().optional(),
|
|
134
|
+
// Components
|
|
135
|
+
components: z.array(FlowComponentSchema).nullable().optional(),
|
|
136
|
+
// Nodes
|
|
137
|
+
nodes: z.array(FlowNodeSchema).nullable().optional(),
|
|
138
|
+
start_node_id: z.string().nullable().optional(),
|
|
139
|
+
// Dynamic variables
|
|
140
|
+
default_dynamic_variables: z
|
|
141
|
+
.record(z.string(), z.string())
|
|
142
|
+
.nullable()
|
|
143
|
+
.optional(),
|
|
144
|
+
// Layout
|
|
145
|
+
begin_tag_display_position: DisplayPositionSchema.nullable().optional(),
|
|
146
|
+
// MCP
|
|
147
|
+
mcps: z.array(McpConfigSchema).nullable().optional(),
|
|
148
|
+
// Transfer
|
|
149
|
+
is_transfer_llm: z.boolean().nullable().optional(),
|
|
150
|
+
// Undocumented but returned by the API
|
|
151
|
+
flex_mode: z.boolean().optional(),
|
|
152
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
export { CallStatusSchema, ChatStatusSchema, ChatTypeSchema, DataStorageSettingSchema, DisconnectionReasonSchema, UserSentimentSchema, } from "./enums.js";
|
|
1
|
+
export { AgentLanguageSchema, AmbientSoundSchema, CallStatusSchema, ChatStatusSchema, ChatTypeSchema, DataStorageSettingSchema, DenoisingModeSchema, DisconnectionReasonSchema, EquationCombinatorSchema, EquationOperatorSchema, FlowInstructionTypeSchema, FlowNodeTypeSchema, FlowTransitionConditionTypeSchema, LlmModelSchema, LlmToolTypeSchema, ToolHttpMethodSchema, ToolParameterTypeSchema, PiiCategorySchema, PronunciationAlphabetSchema, S2sModelSchema, StartSpeakerSchema, SttModeSchema, UserSentimentSchema, VocabSpecializationSchema, VoiceEmotionSchema, VoicemailActionTypeSchema, VoiceModelSchema, WebhookEventSchema, } from "./enums.js";
|
|
2
2
|
export { CallLatencySchema, LatencyMetricSchema } from "./latency.js";
|
|
3
3
|
export { CallCostSchema, ChatCostSchema, LlmTokenUsageSchema, ProductCostSchema, } from "./cost.js";
|
|
4
4
|
export { DTMFSchema, NodeTransitionSchema, TimestampedUtteranceSchema, ToolCallInvocationSchema, ToolCallResultSchema, TranscriptEntrySchema, UtteranceSchema, WordTimestampSchema, } from "./transcript.js";
|
|
5
5
|
export { ChatMessageEntrySchema, ChatMessageSchema, ChatNodeTransitionSchema, ChatStateTransitionSchema, ChatToolCallInvocationSchema, ChatToolCallResultSchema, } from "./chat-messages.js";
|
|
6
|
-
export { E164PhoneSchema, e164OrNullSchema } from "./phone.js";
|
|
6
|
+
export { e164PhoneSchema as E164PhoneSchema, e164OrNullSchema } from "./phone.js";
|
|
7
|
+
export { PhoneNumberAgentEntrySchema, PhoneNumberResponseSchema, } from "./phone-number.js";
|
|
7
8
|
export { createCallAnalysisSchema, createChatAnalysisSchema } from "./analysis.js";
|
|
8
9
|
export { type CallSchemaConfig, CallSchemas, callSchemaDefaults, createCallSchemas, } from "./call.js";
|
|
9
10
|
export { type ChatSchemaConfig, ChatSchemas, chatSchemaDefaults, createChatSchemas, } from "./chat.js";
|
|
10
11
|
export { WebhookSchemas, createWebhookSchemas } from "./webhook.js";
|
|
11
|
-
export { ChatAgentResponseSchema, ResponseEngineConversationFlowSchema, ResponseEngineCustomLlmSchema, ResponseEngineRetellLlmSchema, ResponseEngineSchema, VoiceAgentResponseSchema, } from "./agent.js";
|
|
12
|
-
export { LlmResponseSchema } from "./llm.js";
|
|
13
|
-
export { ConversationFlowResponseSchema } from "./flow.js";
|
|
12
|
+
export { ChatAgentResponseSchema, GuardrailConfigSchema, KbConfigSchema, McpConfigSchema, PiiConfigSchema, PostAnalysisFieldSchema, PronunciationEntrySchema, ResponseEngineConversationFlowSchema, ResponseEngineCustomLlmSchema, ResponseEngineRetellLlmSchema, ResponseEngineSchema, VoiceAgentResponseSchema, } from "./agent.js";
|
|
13
|
+
export { LlmResponseSchema, LlmStateEdgeSchema, LlmStateSchema, LlmToolSchema, TransferDestinationSchema, TransferOptionSchema, } from "./llm.js";
|
|
14
|
+
export { ConversationFlowResponseSchema, FlowComponentSchema, FlowEdgeSchema, FlowEquationSchema, FlowNodeSchema, FlowTransitionConditionSchema, } from "./flow.js";
|
|
14
15
|
export { InputMatchRuleSchema, TestCaseDefinitionSchema, TestCaseResponseEngineSchema, ToolMockSchema, } from "./test-case.js";
|
|
15
16
|
export { retellPagination } from "./pagination.js";
|
|
17
|
+
export { pluralize, resolveFilePlaceholders, toSnakeCase } from "./utils.js";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Enums
|
|
2
|
-
export { CallStatusSchema, ChatStatusSchema, ChatTypeSchema, DataStorageSettingSchema, DisconnectionReasonSchema, UserSentimentSchema, } from "./enums.js";
|
|
2
|
+
export { AgentLanguageSchema, AmbientSoundSchema, CallStatusSchema, ChatStatusSchema, ChatTypeSchema, DataStorageSettingSchema, DenoisingModeSchema, DisconnectionReasonSchema, EquationCombinatorSchema, EquationOperatorSchema, FlowInstructionTypeSchema, FlowNodeTypeSchema, FlowTransitionConditionTypeSchema, LlmModelSchema, LlmToolTypeSchema, ToolHttpMethodSchema, ToolParameterTypeSchema, PiiCategorySchema, PronunciationAlphabetSchema, S2sModelSchema, StartSpeakerSchema, SttModeSchema, UserSentimentSchema, VocabSpecializationSchema, VoiceEmotionSchema, VoicemailActionTypeSchema, VoiceModelSchema, WebhookEventSchema, } from "./enums.js";
|
|
3
3
|
// Latency
|
|
4
4
|
export { CallLatencySchema, LatencyMetricSchema } from "./latency.js";
|
|
5
5
|
// Cost
|
|
@@ -9,7 +9,9 @@ export { DTMFSchema, NodeTransitionSchema, TimestampedUtteranceSchema, ToolCallI
|
|
|
9
9
|
// Chat message entries
|
|
10
10
|
export { ChatMessageEntrySchema, ChatMessageSchema, ChatNodeTransitionSchema, ChatStateTransitionSchema, ChatToolCallInvocationSchema, ChatToolCallResultSchema, } from "./chat-messages.js";
|
|
11
11
|
// Phone number validation
|
|
12
|
-
export { E164PhoneSchema, e164OrNullSchema } from "./phone.js";
|
|
12
|
+
export { e164PhoneSchema as E164PhoneSchema, e164OrNullSchema } from "./phone.js";
|
|
13
|
+
// Phone number API response
|
|
14
|
+
export { PhoneNumberAgentEntrySchema, PhoneNumberResponseSchema, } from "./phone-number.js";
|
|
13
15
|
// Analysis
|
|
14
16
|
export { createCallAnalysisSchema, createChatAnalysisSchema } from "./analysis.js";
|
|
15
17
|
// Call schemas + factory
|
|
@@ -19,12 +21,14 @@ export { ChatSchemas, chatSchemaDefaults, createChatSchemas, } from "./chat.js";
|
|
|
19
21
|
// Webhook schemas + factory
|
|
20
22
|
export { WebhookSchemas, createWebhookSchemas } from "./webhook.js";
|
|
21
23
|
// Agent config schemas
|
|
22
|
-
export { ChatAgentResponseSchema, ResponseEngineConversationFlowSchema, ResponseEngineCustomLlmSchema, ResponseEngineRetellLlmSchema, ResponseEngineSchema, VoiceAgentResponseSchema, } from "./agent.js";
|
|
24
|
+
export { ChatAgentResponseSchema, GuardrailConfigSchema, KbConfigSchema, McpConfigSchema, PiiConfigSchema, PostAnalysisFieldSchema, PronunciationEntrySchema, ResponseEngineConversationFlowSchema, ResponseEngineCustomLlmSchema, ResponseEngineRetellLlmSchema, ResponseEngineSchema, VoiceAgentResponseSchema, } from "./agent.js";
|
|
23
25
|
// LLM config schemas
|
|
24
|
-
export { LlmResponseSchema } from "./llm.js";
|
|
26
|
+
export { LlmResponseSchema, LlmStateEdgeSchema, LlmStateSchema, LlmToolSchema, TransferDestinationSchema, TransferOptionSchema, } from "./llm.js";
|
|
25
27
|
// Conversation flow config schemas
|
|
26
|
-
export { ConversationFlowResponseSchema } from "./flow.js";
|
|
28
|
+
export { ConversationFlowResponseSchema, FlowComponentSchema, FlowEdgeSchema, FlowEquationSchema, FlowNodeSchema, FlowTransitionConditionSchema, } from "./flow.js";
|
|
27
29
|
// Test case schemas
|
|
28
30
|
export { InputMatchRuleSchema, TestCaseDefinitionSchema, TestCaseResponseEngineSchema, ToolMockSchema, } from "./test-case.js";
|
|
29
31
|
// Pagination utility
|
|
30
32
|
export { retellPagination } from "./pagination.js";
|
|
33
|
+
// General utilities
|
|
34
|
+
export { pluralize, resolveFilePlaceholders, toSnakeCase } from "./utils.js";
|
package/dist/llm.d.ts
CHANGED
|
@@ -1,13 +1,388 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
/** Transfer destination configuration. */
|
|
3
|
+
export declare const TransferDestinationSchema: z.ZodObject<{
|
|
4
|
+
type: z.ZodOptional<z.ZodString>;
|
|
5
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
6
|
+
number: z.ZodOptional<z.ZodString>;
|
|
7
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
/** Transfer option configuration (warm/cold transfer behavior). */
|
|
10
|
+
export declare const TransferOptionSchema: z.ZodObject<{
|
|
11
|
+
type: z.ZodOptional<z.ZodString>;
|
|
12
|
+
option: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
type: z.ZodOptional<z.ZodString>;
|
|
14
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
public_handoff_option: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
type: z.ZodOptional<z.ZodString>;
|
|
18
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
private_handoff_option: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
type: z.ZodOptional<z.ZodString>;
|
|
22
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
on_hold_music: z.ZodOptional<z.ZodString>;
|
|
25
|
+
opt_out_initial_message: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
opt_out_human_detection: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
agent_detection_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
show_transferee_as_caller: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
enable_bridge_audio_cue: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
}, z.core.$strip>;
|
|
2
31
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
32
|
+
* Schema for an LLM tool. Tools are highly polymorphic (end_call,
|
|
33
|
+
* transfer_call, custom, cal, etc.) so we explicitly declare all known fields
|
|
34
|
+
* and use catchall to preserve any we haven't seen yet.
|
|
5
35
|
*/
|
|
36
|
+
export declare const LlmToolSchema: z.ZodObject<{
|
|
37
|
+
type: z.ZodEnum<{
|
|
38
|
+
transfer_call: "transfer_call";
|
|
39
|
+
press_digit: "press_digit";
|
|
40
|
+
agent_swap: "agent_swap";
|
|
41
|
+
mcp: "mcp";
|
|
42
|
+
end_call: "end_call";
|
|
43
|
+
check_availability_cal: "check_availability_cal";
|
|
44
|
+
book_appointment_cal: "book_appointment_cal";
|
|
45
|
+
custom: "custom";
|
|
46
|
+
extract_dynamic_variable: "extract_dynamic_variable";
|
|
47
|
+
send_sms: "send_sms";
|
|
48
|
+
}>;
|
|
49
|
+
name: z.ZodOptional<z.ZodString>;
|
|
50
|
+
description: z.ZodOptional<z.ZodString>;
|
|
51
|
+
tool_id: z.ZodOptional<z.ZodString>;
|
|
52
|
+
url: z.ZodOptional<z.ZodString>;
|
|
53
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
GET: "GET";
|
|
55
|
+
POST: "POST";
|
|
56
|
+
PATCH: "PATCH";
|
|
57
|
+
PUT: "PUT";
|
|
58
|
+
DELETE: "DELETE";
|
|
59
|
+
}>>;
|
|
60
|
+
parameter_type: z.ZodOptional<z.ZodEnum<{
|
|
61
|
+
json: "json";
|
|
62
|
+
form: "form";
|
|
63
|
+
}>>;
|
|
64
|
+
parameters: z.ZodOptional<z.ZodUnknown>;
|
|
65
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
66
|
+
query_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
67
|
+
args_at_root: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
response_variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
70
|
+
speak_during_execution: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
speak_after_execution: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
execution_message_description: z.ZodOptional<z.ZodString>;
|
|
73
|
+
transfer_destination: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
type: z.ZodOptional<z.ZodString>;
|
|
75
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
76
|
+
number: z.ZodOptional<z.ZodString>;
|
|
77
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, z.core.$strip>>;
|
|
79
|
+
transfer_option: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
type: z.ZodOptional<z.ZodString>;
|
|
81
|
+
option: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
type: z.ZodOptional<z.ZodString>;
|
|
83
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, z.core.$strip>>;
|
|
85
|
+
public_handoff_option: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
type: z.ZodOptional<z.ZodString>;
|
|
87
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
private_handoff_option: z.ZodOptional<z.ZodObject<{
|
|
90
|
+
type: z.ZodOptional<z.ZodString>;
|
|
91
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
on_hold_music: z.ZodOptional<z.ZodString>;
|
|
94
|
+
opt_out_initial_message: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
+
opt_out_human_detection: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
+
agent_detection_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
show_transferee_as_caller: z.ZodOptional<z.ZodBoolean>;
|
|
98
|
+
enable_bridge_audio_cue: z.ZodOptional<z.ZodBoolean>;
|
|
99
|
+
}, z.core.$strip>>;
|
|
100
|
+
custom_sip_headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
101
|
+
cal_api_key: z.ZodOptional<z.ZodString>;
|
|
102
|
+
event_type_id: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
/** State transition edge within multi-prompt LLM. */
|
|
106
|
+
export declare const LlmStateEdgeSchema: z.ZodObject<{
|
|
107
|
+
destination_state_name: z.ZodString;
|
|
108
|
+
description: z.ZodOptional<z.ZodString>;
|
|
109
|
+
parameters: z.ZodOptional<z.ZodUnknown>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
/** A state within a multi-prompt LLM. */
|
|
112
|
+
export declare const LlmStateSchema: z.ZodObject<{
|
|
113
|
+
name: z.ZodString;
|
|
114
|
+
state_prompt: z.ZodOptional<z.ZodString>;
|
|
115
|
+
edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
116
|
+
destination_state_name: z.ZodString;
|
|
117
|
+
description: z.ZodOptional<z.ZodString>;
|
|
118
|
+
parameters: z.ZodOptional<z.ZodUnknown>;
|
|
119
|
+
}, z.core.$strip>>>;
|
|
120
|
+
tools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
121
|
+
type: z.ZodEnum<{
|
|
122
|
+
transfer_call: "transfer_call";
|
|
123
|
+
press_digit: "press_digit";
|
|
124
|
+
agent_swap: "agent_swap";
|
|
125
|
+
mcp: "mcp";
|
|
126
|
+
end_call: "end_call";
|
|
127
|
+
check_availability_cal: "check_availability_cal";
|
|
128
|
+
book_appointment_cal: "book_appointment_cal";
|
|
129
|
+
custom: "custom";
|
|
130
|
+
extract_dynamic_variable: "extract_dynamic_variable";
|
|
131
|
+
send_sms: "send_sms";
|
|
132
|
+
}>;
|
|
133
|
+
name: z.ZodOptional<z.ZodString>;
|
|
134
|
+
description: z.ZodOptional<z.ZodString>;
|
|
135
|
+
tool_id: z.ZodOptional<z.ZodString>;
|
|
136
|
+
url: z.ZodOptional<z.ZodString>;
|
|
137
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
138
|
+
GET: "GET";
|
|
139
|
+
POST: "POST";
|
|
140
|
+
PATCH: "PATCH";
|
|
141
|
+
PUT: "PUT";
|
|
142
|
+
DELETE: "DELETE";
|
|
143
|
+
}>>;
|
|
144
|
+
parameter_type: z.ZodOptional<z.ZodEnum<{
|
|
145
|
+
json: "json";
|
|
146
|
+
form: "form";
|
|
147
|
+
}>>;
|
|
148
|
+
parameters: z.ZodOptional<z.ZodUnknown>;
|
|
149
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
150
|
+
query_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
151
|
+
args_at_root: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
response_variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
154
|
+
speak_during_execution: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
+
speak_after_execution: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
execution_message_description: z.ZodOptional<z.ZodString>;
|
|
157
|
+
transfer_destination: z.ZodOptional<z.ZodObject<{
|
|
158
|
+
type: z.ZodOptional<z.ZodString>;
|
|
159
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
160
|
+
number: z.ZodOptional<z.ZodString>;
|
|
161
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, z.core.$strip>>;
|
|
163
|
+
transfer_option: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
type: z.ZodOptional<z.ZodString>;
|
|
165
|
+
option: z.ZodOptional<z.ZodObject<{
|
|
166
|
+
type: z.ZodOptional<z.ZodString>;
|
|
167
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
168
|
+
}, z.core.$strip>>;
|
|
169
|
+
public_handoff_option: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
type: z.ZodOptional<z.ZodString>;
|
|
171
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, z.core.$strip>>;
|
|
173
|
+
private_handoff_option: z.ZodOptional<z.ZodObject<{
|
|
174
|
+
type: z.ZodOptional<z.ZodString>;
|
|
175
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
176
|
+
}, z.core.$strip>>;
|
|
177
|
+
on_hold_music: z.ZodOptional<z.ZodString>;
|
|
178
|
+
opt_out_initial_message: z.ZodOptional<z.ZodBoolean>;
|
|
179
|
+
opt_out_human_detection: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
agent_detection_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
181
|
+
show_transferee_as_caller: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
enable_bridge_audio_cue: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
}, z.core.$strip>>;
|
|
184
|
+
custom_sip_headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
185
|
+
cal_api_key: z.ZodOptional<z.ZodString>;
|
|
186
|
+
event_type_id: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, z.core.$strip>>>>;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
/** Zod schema for a Retell LLM response from the API. */
|
|
6
191
|
export declare const LlmResponseSchema: z.ZodObject<{
|
|
7
192
|
llm_id: z.ZodString;
|
|
8
193
|
last_modification_timestamp: z.ZodNumber;
|
|
9
194
|
version: z.ZodOptional<z.ZodNumber>;
|
|
10
195
|
is_published: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
-
|
|
196
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
197
|
+
"gpt-4.1": "gpt-4.1";
|
|
198
|
+
"gpt-4.1-mini": "gpt-4.1-mini";
|
|
199
|
+
"gpt-4.1-nano": "gpt-4.1-nano";
|
|
200
|
+
"gpt-5": "gpt-5";
|
|
201
|
+
"gpt-5.1": "gpt-5.1";
|
|
202
|
+
"gpt-5.2": "gpt-5.2";
|
|
203
|
+
"gpt-5-mini": "gpt-5-mini";
|
|
204
|
+
"gpt-5-nano": "gpt-5-nano";
|
|
205
|
+
"claude-4.5-sonnet": "claude-4.5-sonnet";
|
|
206
|
+
"claude-4.5-haiku": "claude-4.5-haiku";
|
|
207
|
+
"gemini-2.5-flash": "gemini-2.5-flash";
|
|
208
|
+
"gemini-2.5-flash-lite": "gemini-2.5-flash-lite";
|
|
209
|
+
"gemini-3.0-flash": "gemini-3.0-flash";
|
|
210
|
+
}>>>;
|
|
211
|
+
s2s_model: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
212
|
+
"gpt-4o-realtime": "gpt-4o-realtime";
|
|
213
|
+
"gpt-4o-mini-realtime": "gpt-4o-mini-realtime";
|
|
214
|
+
"gpt-realtime": "gpt-realtime";
|
|
215
|
+
"gpt-realtime-mini": "gpt-realtime-mini";
|
|
216
|
+
}>>>;
|
|
217
|
+
model_temperature: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
model_high_priority: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
219
|
+
tool_call_strict_mode: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
220
|
+
knowledge_base_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
221
|
+
kb_config: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
222
|
+
top_k: z.ZodOptional<z.ZodNumber>;
|
|
223
|
+
filter_score: z.ZodOptional<z.ZodNumber>;
|
|
224
|
+
}, z.core.$strip>>>;
|
|
225
|
+
start_speaker: z.ZodOptional<z.ZodEnum<{
|
|
226
|
+
user: "user";
|
|
227
|
+
agent: "agent";
|
|
228
|
+
}>>;
|
|
229
|
+
begin_after_user_silence_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
12
230
|
begin_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
-
|
|
231
|
+
general_prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
232
|
+
general_tools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
233
|
+
type: z.ZodEnum<{
|
|
234
|
+
transfer_call: "transfer_call";
|
|
235
|
+
press_digit: "press_digit";
|
|
236
|
+
agent_swap: "agent_swap";
|
|
237
|
+
mcp: "mcp";
|
|
238
|
+
end_call: "end_call";
|
|
239
|
+
check_availability_cal: "check_availability_cal";
|
|
240
|
+
book_appointment_cal: "book_appointment_cal";
|
|
241
|
+
custom: "custom";
|
|
242
|
+
extract_dynamic_variable: "extract_dynamic_variable";
|
|
243
|
+
send_sms: "send_sms";
|
|
244
|
+
}>;
|
|
245
|
+
name: z.ZodOptional<z.ZodString>;
|
|
246
|
+
description: z.ZodOptional<z.ZodString>;
|
|
247
|
+
tool_id: z.ZodOptional<z.ZodString>;
|
|
248
|
+
url: z.ZodOptional<z.ZodString>;
|
|
249
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
250
|
+
GET: "GET";
|
|
251
|
+
POST: "POST";
|
|
252
|
+
PATCH: "PATCH";
|
|
253
|
+
PUT: "PUT";
|
|
254
|
+
DELETE: "DELETE";
|
|
255
|
+
}>>;
|
|
256
|
+
parameter_type: z.ZodOptional<z.ZodEnum<{
|
|
257
|
+
json: "json";
|
|
258
|
+
form: "form";
|
|
259
|
+
}>>;
|
|
260
|
+
parameters: z.ZodOptional<z.ZodUnknown>;
|
|
261
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
262
|
+
query_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
263
|
+
args_at_root: z.ZodOptional<z.ZodBoolean>;
|
|
264
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
265
|
+
response_variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
266
|
+
speak_during_execution: z.ZodOptional<z.ZodBoolean>;
|
|
267
|
+
speak_after_execution: z.ZodOptional<z.ZodBoolean>;
|
|
268
|
+
execution_message_description: z.ZodOptional<z.ZodString>;
|
|
269
|
+
transfer_destination: z.ZodOptional<z.ZodObject<{
|
|
270
|
+
type: z.ZodOptional<z.ZodString>;
|
|
271
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
272
|
+
number: z.ZodOptional<z.ZodString>;
|
|
273
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
274
|
+
}, z.core.$strip>>;
|
|
275
|
+
transfer_option: z.ZodOptional<z.ZodObject<{
|
|
276
|
+
type: z.ZodOptional<z.ZodString>;
|
|
277
|
+
option: z.ZodOptional<z.ZodObject<{
|
|
278
|
+
type: z.ZodOptional<z.ZodString>;
|
|
279
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
280
|
+
}, z.core.$strip>>;
|
|
281
|
+
public_handoff_option: z.ZodOptional<z.ZodObject<{
|
|
282
|
+
type: z.ZodOptional<z.ZodString>;
|
|
283
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
284
|
+
}, z.core.$strip>>;
|
|
285
|
+
private_handoff_option: z.ZodOptional<z.ZodObject<{
|
|
286
|
+
type: z.ZodOptional<z.ZodString>;
|
|
287
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
288
|
+
}, z.core.$strip>>;
|
|
289
|
+
on_hold_music: z.ZodOptional<z.ZodString>;
|
|
290
|
+
opt_out_initial_message: z.ZodOptional<z.ZodBoolean>;
|
|
291
|
+
opt_out_human_detection: z.ZodOptional<z.ZodBoolean>;
|
|
292
|
+
agent_detection_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
293
|
+
show_transferee_as_caller: z.ZodOptional<z.ZodBoolean>;
|
|
294
|
+
enable_bridge_audio_cue: z.ZodOptional<z.ZodBoolean>;
|
|
295
|
+
}, z.core.$strip>>;
|
|
296
|
+
custom_sip_headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
297
|
+
cal_api_key: z.ZodOptional<z.ZodString>;
|
|
298
|
+
event_type_id: z.ZodOptional<z.ZodNumber>;
|
|
299
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
300
|
+
}, z.core.$strip>>>>;
|
|
301
|
+
states: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
302
|
+
name: z.ZodString;
|
|
303
|
+
state_prompt: z.ZodOptional<z.ZodString>;
|
|
304
|
+
edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
305
|
+
destination_state_name: z.ZodString;
|
|
306
|
+
description: z.ZodOptional<z.ZodString>;
|
|
307
|
+
parameters: z.ZodOptional<z.ZodUnknown>;
|
|
308
|
+
}, z.core.$strip>>>;
|
|
309
|
+
tools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
310
|
+
type: z.ZodEnum<{
|
|
311
|
+
transfer_call: "transfer_call";
|
|
312
|
+
press_digit: "press_digit";
|
|
313
|
+
agent_swap: "agent_swap";
|
|
314
|
+
mcp: "mcp";
|
|
315
|
+
end_call: "end_call";
|
|
316
|
+
check_availability_cal: "check_availability_cal";
|
|
317
|
+
book_appointment_cal: "book_appointment_cal";
|
|
318
|
+
custom: "custom";
|
|
319
|
+
extract_dynamic_variable: "extract_dynamic_variable";
|
|
320
|
+
send_sms: "send_sms";
|
|
321
|
+
}>;
|
|
322
|
+
name: z.ZodOptional<z.ZodString>;
|
|
323
|
+
description: z.ZodOptional<z.ZodString>;
|
|
324
|
+
tool_id: z.ZodOptional<z.ZodString>;
|
|
325
|
+
url: z.ZodOptional<z.ZodString>;
|
|
326
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
327
|
+
GET: "GET";
|
|
328
|
+
POST: "POST";
|
|
329
|
+
PATCH: "PATCH";
|
|
330
|
+
PUT: "PUT";
|
|
331
|
+
DELETE: "DELETE";
|
|
332
|
+
}>>;
|
|
333
|
+
parameter_type: z.ZodOptional<z.ZodEnum<{
|
|
334
|
+
json: "json";
|
|
335
|
+
form: "form";
|
|
336
|
+
}>>;
|
|
337
|
+
parameters: z.ZodOptional<z.ZodUnknown>;
|
|
338
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
339
|
+
query_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
340
|
+
args_at_root: z.ZodOptional<z.ZodBoolean>;
|
|
341
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
342
|
+
response_variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
343
|
+
speak_during_execution: z.ZodOptional<z.ZodBoolean>;
|
|
344
|
+
speak_after_execution: z.ZodOptional<z.ZodBoolean>;
|
|
345
|
+
execution_message_description: z.ZodOptional<z.ZodString>;
|
|
346
|
+
transfer_destination: z.ZodOptional<z.ZodObject<{
|
|
347
|
+
type: z.ZodOptional<z.ZodString>;
|
|
348
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
349
|
+
number: z.ZodOptional<z.ZodString>;
|
|
350
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
351
|
+
}, z.core.$strip>>;
|
|
352
|
+
transfer_option: z.ZodOptional<z.ZodObject<{
|
|
353
|
+
type: z.ZodOptional<z.ZodString>;
|
|
354
|
+
option: z.ZodOptional<z.ZodObject<{
|
|
355
|
+
type: z.ZodOptional<z.ZodString>;
|
|
356
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
357
|
+
}, z.core.$strip>>;
|
|
358
|
+
public_handoff_option: z.ZodOptional<z.ZodObject<{
|
|
359
|
+
type: z.ZodOptional<z.ZodString>;
|
|
360
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
361
|
+
}, z.core.$strip>>;
|
|
362
|
+
private_handoff_option: z.ZodOptional<z.ZodObject<{
|
|
363
|
+
type: z.ZodOptional<z.ZodString>;
|
|
364
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
365
|
+
}, z.core.$strip>>;
|
|
366
|
+
on_hold_music: z.ZodOptional<z.ZodString>;
|
|
367
|
+
opt_out_initial_message: z.ZodOptional<z.ZodBoolean>;
|
|
368
|
+
opt_out_human_detection: z.ZodOptional<z.ZodBoolean>;
|
|
369
|
+
agent_detection_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
370
|
+
show_transferee_as_caller: z.ZodOptional<z.ZodBoolean>;
|
|
371
|
+
enable_bridge_audio_cue: z.ZodOptional<z.ZodBoolean>;
|
|
372
|
+
}, z.core.$strip>>;
|
|
373
|
+
custom_sip_headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
374
|
+
cal_api_key: z.ZodOptional<z.ZodString>;
|
|
375
|
+
event_type_id: z.ZodOptional<z.ZodNumber>;
|
|
376
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
377
|
+
}, z.core.$strip>>>>;
|
|
378
|
+
}, z.core.$strip>>>>;
|
|
379
|
+
starting_state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
380
|
+
default_dynamic_variables: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
381
|
+
mcps: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
382
|
+
name: z.ZodString;
|
|
383
|
+
url: z.ZodString;
|
|
384
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
385
|
+
query_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
386
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
387
|
+
}, z.core.$strip>>>>;
|
|
388
|
+
}, z.core.$strip>;
|