retell-sdk 2.2.3 → 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.
Files changed (143) hide show
  1. package/example.js +34 -2
  2. package/example.js.map +1 -1
  3. package/lib/config.d.ts.map +1 -1
  4. package/lib/config.js.map +1 -1
  5. package/lib/sdks.d.ts.map +1 -1
  6. package/lib/sdks.js.map +1 -1
  7. package/lib/security.d.ts.map +1 -1
  8. package/lib/security.js +5 -1
  9. package/lib/security.js.map +1 -1
  10. package/models/components/agent.d.ts +3 -3
  11. package/models/components/agent.d.ts.map +1 -1
  12. package/models/components/agent.js +60 -26
  13. package/models/components/agent.js.map +1 -1
  14. package/models/components/agentpromptparams.d.ts.map +1 -1
  15. package/models/components/agentpromptparams.js.map +1 -1
  16. package/models/components/calldetail.d.ts.map +1 -1
  17. package/models/components/calldetail.js +18 -6
  18. package/models/components/calldetail.js.map +1 -1
  19. package/models/components/callphonenumber.d.ts.map +1 -1
  20. package/models/components/callphonenumber.js.map +1 -1
  21. package/models/components/phonenumber.d.ts.map +1 -1
  22. package/models/components/phonenumber.js.map +1 -1
  23. package/models/components/security.d.ts.map +1 -1
  24. package/models/errors/createagent.d.ts.map +1 -1
  25. package/models/errors/createagent.js +36 -12
  26. package/models/errors/createagent.js.map +1 -1
  27. package/models/errors/createphonecall.d.ts.map +1 -1
  28. package/models/errors/createphonecall.js +54 -18
  29. package/models/errors/createphonecall.js.map +1 -1
  30. package/models/errors/createphonenumber.d.ts.map +1 -1
  31. package/models/errors/createphonenumber.js +42 -14
  32. package/models/errors/createphonenumber.js.map +1 -1
  33. package/models/errors/deleteagent.d.ts.map +1 -1
  34. package/models/errors/deleteagent.js +36 -12
  35. package/models/errors/deleteagent.js.map +1 -1
  36. package/models/errors/deletephonenumber.d.ts.map +1 -1
  37. package/models/errors/deletephonenumber.js +33 -11
  38. package/models/errors/deletephonenumber.js.map +1 -1
  39. package/models/errors/getagent.d.ts.map +1 -1
  40. package/models/errors/getagent.js +36 -12
  41. package/models/errors/getagent.js.map +1 -1
  42. package/models/errors/getcall.d.ts.map +1 -1
  43. package/models/errors/getcall.js +30 -10
  44. package/models/errors/getcall.js.map +1 -1
  45. package/models/errors/getphonenumber.d.ts.map +1 -1
  46. package/models/errors/getphonenumber.js +36 -12
  47. package/models/errors/getphonenumber.js.map +1 -1
  48. package/models/errors/listagents.d.ts.map +1 -1
  49. package/models/errors/listagents.js +15 -5
  50. package/models/errors/listagents.js.map +1 -1
  51. package/models/errors/listcalls.d.ts.map +1 -1
  52. package/models/errors/listcalls.js +24 -8
  53. package/models/errors/listcalls.js.map +1 -1
  54. package/models/errors/listphonenumbers.d.ts.map +1 -1
  55. package/models/errors/listphonenumbers.js +27 -9
  56. package/models/errors/listphonenumbers.js.map +1 -1
  57. package/models/errors/updateagent.d.ts.map +1 -1
  58. package/models/errors/updateagent.js +36 -12
  59. package/models/errors/updateagent.js.map +1 -1
  60. package/models/errors/updatephoneagent.d.ts.map +1 -1
  61. package/models/errors/updatephoneagent.js +36 -12
  62. package/models/errors/updatephoneagent.js.map +1 -1
  63. package/models/operations/createagent.d.ts.map +1 -1
  64. package/models/operations/createagent.js +16 -6
  65. package/models/operations/createagent.js.map +1 -1
  66. package/models/operations/createphonecall.d.ts.map +1 -1
  67. package/models/operations/createphonecall.js +18 -6
  68. package/models/operations/createphonecall.js.map +1 -1
  69. package/models/operations/createphonenumber.d.ts.map +1 -1
  70. package/models/operations/createphonenumber.js +6 -2
  71. package/models/operations/createphonenumber.js.map +1 -1
  72. package/models/operations/createwebcall.d.ts.map +1 -1
  73. package/models/operations/deleteagent.d.ts.map +1 -1
  74. package/models/operations/deleteagent.js.map +1 -1
  75. package/models/operations/deletephonenumber.d.ts.map +1 -1
  76. package/models/operations/deletephonenumber.js.map +1 -1
  77. package/models/operations/getagent.d.ts.map +1 -1
  78. package/models/operations/getagent.js.map +1 -1
  79. package/models/operations/getcall.d.ts.map +1 -1
  80. package/models/operations/getcall.js.map +1 -1
  81. package/models/operations/getphonenumber.d.ts.map +1 -1
  82. package/models/operations/getphonenumber.js +6 -2
  83. package/models/operations/getphonenumber.js.map +1 -1
  84. package/models/operations/listagents.d.ts.map +1 -1
  85. package/models/operations/listagents.js.map +1 -1
  86. package/models/operations/listcalls.d.ts.map +1 -1
  87. package/models/operations/listcalls.js +6 -2
  88. package/models/operations/listcalls.js.map +1 -1
  89. package/models/operations/listphonenumbers.d.ts.map +1 -1
  90. package/models/operations/listphonenumbers.js +6 -2
  91. package/models/operations/listphonenumbers.js.map +1 -1
  92. package/models/operations/updateagent.d.ts.map +1 -1
  93. package/models/operations/updateagent.js +18 -4
  94. package/models/operations/updateagent.js.map +1 -1
  95. package/models/operations/updatephoneagent.d.ts.map +1 -1
  96. package/models/operations/updatephoneagent.js +6 -2
  97. package/models/operations/updatephoneagent.js.map +1 -1
  98. package/package.json +1 -1
  99. package/sdk/liveClient.d.ts.map +1 -1
  100. package/sdk/liveClient.js +7 -2
  101. package/sdk/liveClient.js.map +1 -1
  102. package/sdk/sdk.d.ts.map +1 -1
  103. package/sdk/sdk.js +22 -5
  104. package/sdk/sdk.js.map +1 -1
  105. package/src/example.ts +121 -87
  106. package/src/lib/config.ts +32 -32
  107. package/src/lib/sdks.ts +91 -82
  108. package/src/lib/security.ts +133 -118
  109. package/src/models/components/agent.ts +459 -387
  110. package/src/models/components/agentpromptparams.ts +46 -38
  111. package/src/models/components/calldetail.ts +137 -125
  112. package/src/models/components/callphonenumber.ts +46 -38
  113. package/src/models/components/phonenumber.ts +69 -68
  114. package/src/models/components/security.ts +1 -1
  115. package/src/models/errors/createagent.ts +359 -311
  116. package/src/models/errors/createphonecall.ts +537 -472
  117. package/src/models/errors/createphonenumber.ts +447 -395
  118. package/src/models/errors/deleteagent.ts +359 -311
  119. package/src/models/errors/deletephonenumber.ts +357 -315
  120. package/src/models/errors/getagent.ts +358 -302
  121. package/src/models/errors/getcall.ts +348 -294
  122. package/src/models/errors/getphonenumber.ts +357 -312
  123. package/src/models/errors/listagents.ts +174 -147
  124. package/src/models/errors/listcalls.ts +251 -211
  125. package/src/models/errors/listphonenumbers.ts +252 -217
  126. package/src/models/errors/updateagent.ts +359 -311
  127. package/src/models/errors/updatephoneagent.ts +357 -312
  128. package/src/models/operations/createagent.ts +165 -129
  129. package/src/models/operations/createphonecall.ts +283 -238
  130. package/src/models/operations/createphonenumber.ts +118 -98
  131. package/src/models/operations/createwebcall.ts +13 -13
  132. package/src/models/operations/deleteagent.ts +94 -78
  133. package/src/models/operations/deletephonenumber.ts +94 -78
  134. package/src/models/operations/getagent.ts +104 -88
  135. package/src/models/operations/getcall.ts +101 -88
  136. package/src/models/operations/getphonenumber.ts +108 -88
  137. package/src/models/operations/listagents.ts +68 -60
  138. package/src/models/operations/listcalls.ts +238 -213
  139. package/src/models/operations/listphonenumbers.ts +72 -60
  140. package/src/models/operations/updateagent.ts +226 -173
  141. package/src/models/operations/updatephoneagent.ts +160 -132
  142. package/src/sdk/liveClient.ts +11 -7
  143. package/src/sdk/sdk.ts +1313 -1160
@@ -5,26 +5,27 @@
5
5
  import { z } from "zod";
6
6
 
7
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?: {
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
+ | {
24
25
  /**
25
26
  * The type of parameters is object.
26
27
  */
27
- type: 'object';
28
+ type: "object";
28
29
  /**
29
30
  * Defines what properties are required for the parameters.
30
31
  */
@@ -33,431 +34,502 @@ export type Function = {
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.
34
35
  */
35
36
  properties: Record<string, any>;
36
- } | undefined;
37
+ }
38
+ | undefined;
37
39
  };
38
40
 
39
41
  /** @internal */
40
42
  export namespace Function$ {
41
- export type Inbound = {
42
- url: string;
43
- description?: string | undefined;
44
- name: string;
45
- parameters?: {
46
- type: 'object';
47
- required?: string[] | undefined;
48
- properties: Record<string, any>;
49
- } | undefined;
50
- };
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
+ };
51
55
 
52
- export const inboundSchema: z.ZodType<Function, z.ZodTypeDef, Inbound> = z
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
53
62
  .object({
54
- url: z.string(),
55
- description: z.string().optional(),
56
- name: z.string(),
57
- parameters: z.object({
58
- type: z.literal('object'),
59
- required: z.array(z.string()).optional(),
60
- properties: z.record(z.any()),
61
- }).optional(),
63
+ type: z.literal("object"),
64
+ required: z.array(z.string()).optional(),
65
+ properties: z.record(z.any()),
62
66
  })
63
- .transform((v) => {
64
- return {
65
- url: v.url,
66
- description: v.description,
67
- name: v.name,
68
- parameters: v.parameters,
69
- };
70
- });
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
+ });
71
79
 
72
- export type Outbound = {
73
- url: string;
74
- description?: string | undefined;
75
- name: string;
76
- parameters?: {
77
- type: 'object';
78
- required?: string[] | undefined;
79
- properties: Record<string, any>;
80
- } | undefined;
81
- };
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
+ };
82
92
 
83
- export const outboundSchema: z.ZodType<Function, z.ZodTypeDef, Inbound> = z
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
84
99
  .object({
85
- url: z.string(),
86
- description: z.string().optional(),
87
- name: z.string(),
88
- parameters: z.object({
89
- type: z.literal('object'),
90
- required: z.array(z.string()).optional(),
91
- properties: z.record(z.any()),
92
- }).optional(),
100
+ type: z.literal("object"),
101
+ required: z.array(z.string()).optional(),
102
+ properties: z.record(z.any()),
93
103
  })
94
- .transform((v) => {
95
- return {
96
- url: v.url,
97
- description: v.description,
98
- name: v.name,
99
- parameters: v.parameters,
100
- };
101
- });
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
+ });
102
116
  }
103
117
 
104
118
  export type RetellLlmSetting = {
105
- /**
106
- * Retell picked LLM based conversation response.
107
- */
108
- provider: "retell";
109
- /**
110
- * The prompt agent will follow. Can use `${YOUR_PARAM_NAME}` to represent dynamic data that would get injected at each call.
111
- */
112
- prompt: string;
113
- }
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
+ };
114
128
 
115
129
  /** @internal */
116
130
  export namespace RetellLlmSetting$ {
117
- export type Inbound = {
118
- provider: "retell";
119
- prompt: string;
120
- };
131
+ export type Inbound = {
132
+ provider: "retell";
133
+ prompt: string;
134
+ };
121
135
 
122
- export const inboundSchema: z.ZodType<RetellLlmSetting, z.ZodTypeDef, Inbound> = z
123
- .object({
124
- provider: z.literal("retell"),
125
- prompt: z.string(),
126
- })
127
- .transform((v) => {
128
- return {
129
- provider: v.provider,
130
- prompt: v.prompt,
131
- };
132
- });
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
+ });
133
151
 
134
- export type Outbound = {
135
- provider: "retell";
136
- prompt: string;
137
- };
152
+ export type Outbound = {
153
+ provider: "retell";
154
+ prompt: string;
155
+ };
138
156
 
139
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, RetellLlmSetting> = z
140
- .object({
141
- provider: z.literal("retell"),
142
- prompt: z.string(),
143
- })
144
- .transform((v) => {
145
- return {
146
- provider: v.provider,
147
- prompt: v.prompt,
148
- };
149
- });
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
+ });
150
172
  }
151
173
 
152
174
  export type CustomLlmSetting = {
153
- /**
154
- * Custom response system, usually your custom LLM. Note that you may see a higher latency if provided server is slow.
155
- */
156
- provider: "custom";
157
- /**
158
- * The URL we will call for getting response, usually your server.
159
- */
160
- url: string;
161
- /**
162
- * Whether the provided URL support return response via Server Sent Events.
163
- */
164
- stream: boolean;
165
- }
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
+ };
166
188
 
167
189
  /** @internal */
168
190
  export namespace CustomLlmSetting$ {
169
- export type Inbound = {
170
- provider: "custom";
171
- url: string;
172
- stream: boolean;
173
- };
191
+ export type Inbound = {
192
+ provider: "custom";
193
+ url: string;
194
+ stream: boolean;
195
+ };
174
196
 
175
- export const inboundSchema: z.ZodType<CustomLlmSetting, z.ZodTypeDef, Inbound> = z
176
- .object({
177
- provider: z.literal("custom"),
178
- url: z.string(),
179
- stream: z.boolean(),
180
- })
181
- .transform((v) => {
182
- return {
183
- provider: v.provider,
184
- url: v.url,
185
- stream: v.stream
186
- };
187
- });
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
+ });
188
214
 
189
- export type Outbound = {
190
- provider: "custom";
191
- url: string;
192
- stream: boolean;
193
- };
215
+ export type Outbound = {
216
+ provider: "custom";
217
+ url: string;
218
+ stream: boolean;
219
+ };
194
220
 
195
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CustomLlmSetting> = z
196
- .object({
197
- provider: z.literal("custom"),
198
- url: z.string(),
199
- stream: z.boolean(),
200
- })
201
- .transform((v) => {
202
- return {
203
- provider: v.provider,
204
- url: v.url,
205
- stream: v.stream
206
- };
207
- });
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
+ });
208
238
  }
209
239
 
210
240
  export type InteractionSettingRequest = {
211
- /**
212
- * 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.
213
- */
214
- enableBeginMessage?: boolean | undefined;
215
- /**
216
- * 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.
217
- */
218
- beginMessage?: string | undefined;
219
- /**
220
- * Whether the agent can end a call. If false, the agent would never end a call.
221
- */
222
- enableEndCall?: boolean | undefined;
223
- /**
224
- * 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.
225
- */
226
- enableEndMessage?: boolean | undefined;
227
- /**
228
- * 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.
229
- */
230
- endMessage?: string | undefined;
231
- }
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
+ };
232
262
 
233
263
  /** @internal */
234
264
  export namespace InteractionSettingRequest$ {
235
- export type Inbound = {
236
- enable_begin_message?: boolean | undefined;
237
- begin_message?: string | undefined;
238
- enable_end_call?: boolean | undefined;
239
- enable_end_message?: boolean | undefined;
240
- end_message?: string | undefined;
241
- };
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
+ };
242
272
 
243
- export const inboundSchema: z.ZodType<InteractionSettingRequest, z.ZodTypeDef, Inbound> = z
244
- .object({
245
- enable_begin_message: z.boolean().optional(),
246
- begin_message: z.string().optional(),
247
- enable_end_call: z.boolean().optional(),
248
- enable_end_message: z.boolean().optional(),
249
- end_message: z.string().optional(),
250
- })
251
- .transform((v) => {
252
- return {
253
- ...(v.enable_begin_message === undefined ? null : { enableBeginMessage: v.enable_begin_message }),
254
- ...(v.begin_message === undefined ? null : { beginMessage: v.begin_message }),
255
- ...(v.enable_end_call === undefined ? null : { enableEndCall: v.enable_end_call }),
256
- ...(v.enable_end_message === undefined ? null : { enableEndMessage: v.enable_end_message }),
257
- ...(v.end_message === undefined ? null : { endMessage: v.end_message }),
258
- };
259
- });
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
+ });
260
302
 
261
- export type Outbound = {
262
- enable_begin_message?: boolean | undefined;
263
- begin_message?: string | undefined;
264
- enable_end_call?: boolean | undefined;
265
- enable_end_message?: boolean | undefined;
266
- end_message?: string | undefined;
267
- };
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
+ };
268
310
 
269
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, InteractionSettingRequest> = z
270
- .object({
271
- enableBeginMessage: z.boolean().optional(),
272
- beginMessage: z.string().optional(),
273
- enableEndCall: z.boolean().optional(),
274
- enableEndMessage: z.boolean().optional(),
275
- endMessage: z.string().optional(),
276
- })
277
- .transform((v) => {
278
- return {
279
- ...(v.enableBeginMessage === undefined ? null : { enable_begin_message: v.enableBeginMessage }),
280
- ...(v.beginMessage === undefined ? null : { begin_message: v.beginMessage }),
281
- ...(v.enableEndCall === undefined ? null : { enable_end_call: v.enableEndCall }),
282
- ...(v.enableEndMessage === undefined ? null : { enable_end_message: v.enableEndMessage }),
283
- ...(v.endMessage === undefined ? null : { end_message: v.endMessage }),
284
- };
285
- });
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
+ });
286
340
  }
287
341
 
288
342
  export type InteractionSettingResponse = {
289
- /**
290
- * 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.
291
- */
292
- enableBeginMessage: boolean;
293
- /**
294
- * 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.
295
- */
296
- beginMessage?: string | undefined;
297
- /**
298
- * Whether the agent can end a call. If false, the agent would never end a call.
299
- */
300
- enableEndCall: boolean;
301
- /**
302
- * 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.
303
- */
304
- enableEndMessage: boolean;
305
- /**
306
- * 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.
307
- */
308
- endMessage?: string | undefined;
309
- }
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
+ };
310
364
 
311
365
  /** @internal */
312
366
  export namespace InteractionSettingResponse$ {
313
- export type Inbound = {
314
- enable_begin_message: boolean;
315
- begin_message?: string | undefined;
316
- enable_end_call: boolean;
317
- enable_end_message: boolean;
318
- end_message?: string | undefined;
319
- };
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
+ };
320
374
 
321
- export const inboundSchema: z.ZodType<InteractionSettingResponse, z.ZodTypeDef, Inbound> = z
322
- .object({
323
- enable_begin_message: z.boolean(),
324
- begin_message: z.string().optional(),
325
- enable_end_call: z.boolean(),
326
- enable_end_message: z.boolean(),
327
- end_message: z.string().optional(),
328
- })
329
- .transform((v) => {
330
- return {
331
- enableBeginMessage: v.enable_begin_message,
332
- ...(v.begin_message === undefined ? null : { beginMessage: v.begin_message }),
333
- enableEndCall: v.enable_end_call,
334
- enableEndMessage: v.enable_end_message,
335
- ...(v.end_message === undefined ? null : { endMessage: v.end_message }),
336
- };
337
- });
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
+ });
338
398
 
339
- export type Outbound = {
340
- enable_begin_message: boolean;
341
- begin_message?: string | undefined;
342
- enable_end_call: boolean;
343
- enable_end_message: boolean;
344
- end_message?: string | undefined;
345
- };
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
+ };
346
406
 
347
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, InteractionSettingResponse> = z
348
- .object({
349
- enableBeginMessage: z.boolean(),
350
- beginMessage: z.string().optional(),
351
- enableEndCall: z.boolean(),
352
- enableEndMessage: z.boolean(),
353
- endMessage: z.string().optional(),
354
- })
355
- .transform((v) => {
356
- return {
357
- enable_begin_message: v.enableBeginMessage,
358
- ...(v.beginMessage === undefined ? null : { begin_message: v.beginMessage }),
359
- enable_end_call: v.enableEndCall,
360
- enable_end_message: v.enableEndMessage,
361
- ...(v.endMessage === undefined ? null : { end_message: v.endMessage }),
362
- };
363
- });
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
+ });
364
430
  }
365
431
 
366
432
  export type Agent = {
367
- /**
368
- * Unique id of agent.
369
- */
370
- agentId: string;
371
- /**
372
- * The name of the agent. Only used for your own reference.
373
- */
374
- agentName?: string | undefined;
375
- /*
376
- * Determines how to generate the response in the call. Currently supports using our in-house LLM response system or your own custom
377
- * response generation system.
378
- */
379
- llmSetting: RetellLlmSetting | CustomLlmSetting;
380
- /**
381
- * Setting combination that controls interaction flow, like begin and end logic.
382
- */
383
- interactionSetting: InteractionSettingResponse;
384
- /**
385
- * Unique voice id used for the agent. Find list of available voices in documentation.
386
- */
387
- voiceId: string;
388
- /**
389
- * Last modification timestamp (milliseconds since epoch). Either the time of last update or creation if no updates available.
390
- */
391
- lastModificationTimestamp: number;
392
- /**
393
- * 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.
394
- */
395
- functions?: Function[] | undefined;
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;
396
462
  };
397
463
 
398
464
  /** @internal */
399
465
  export namespace Agent$ {
400
- export type Inbound = {
401
- agent_id: string;
402
- agent_name?: string | undefined;
403
- llm_setting: RetellLlmSetting$.Inbound | CustomLlmSetting$.Inbound;
404
- interaction_setting: InteractionSettingResponse$.Inbound;
405
- voice_id: string;
406
- last_modification_timestamp: number;
407
- functions?: Function[] | undefined;
408
- };
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
+ };
409
475
 
410
- export const inboundSchema: z.ZodType<Agent, z.ZodTypeDef, Inbound> = z
411
- .object({
412
- agent_id: z.string(),
413
- agent_name: z.string().optional(),
414
- llm_setting: z.union([RetellLlmSetting$.inboundSchema, CustomLlmSetting$.inboundSchema]),
415
- interaction_setting: InteractionSettingResponse$.inboundSchema,
416
- voice_id: z.string(),
417
- last_modification_timestamp: z.number().int(),
418
- functions: z.array(Function$.inboundSchema).optional(),
419
- })
420
- .transform((v) => {
421
- return {
422
- agentId: v.agent_id,
423
- ...(v.agent_name === undefined ? null : { agentName: v.agent_name }),
424
- llmSetting: v.llm_setting,
425
- interactionSetting: v.interaction_setting,
426
- voiceId: v.voice_id,
427
- lastModificationTimestamp: v.last_modification_timestamp,
428
- functions: v.functions
429
- };
430
- });
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
+ });
431
500
 
432
- export type Outbound = {
433
- agent_id: string;
434
- agent_name?: string | undefined;
435
- llm_setting: RetellLlmSetting$.Outbound | CustomLlmSetting$.Outbound;
436
- interaction_setting: InteractionSettingResponse$.Outbound;
437
- voice_id: string;
438
- last_modification_timestamp: number;
439
- functions?: Function[] | undefined;
440
- };
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
+ };
441
510
 
442
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, Agent> = z
443
- .object({
444
- agentId: z.string(),
445
- agentName: z.string().optional(),
446
- llmSetting: z.union([RetellLlmSetting$.outboundSchema, CustomLlmSetting$.outboundSchema]),
447
- interactionSetting: InteractionSettingResponse$.outboundSchema,
448
- voiceId: z.string(),
449
- lastModificationTimestamp: z.number().int(),
450
- functions: z.array(Function$.inboundSchema).optional(),
451
- })
452
- .transform((v) => {
453
- return {
454
- agent_id: v.agentId,
455
- ...(v.agentName === undefined ? null : { agent_name: v.agentName }),
456
- llm_setting: v.llmSetting,
457
- interaction_setting: v.interactionSetting,
458
- voice_id: v.voiceId,
459
- last_modification_timestamp: v.lastModificationTimestamp,
460
- functions: v.functions
461
- };
462
- });
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
+ });
463
535
  }