retell-sdk 2.2.1 → 2.2.2

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 (71) hide show
  1. package/README.md +3 -433
  2. package/example.d.ts +2 -0
  3. package/example.d.ts.map +1 -0
  4. package/example.js +74 -0
  5. package/example.js.map +1 -0
  6. package/models/components/agent.d.ts +131 -24
  7. package/models/components/agent.d.ts.map +1 -1
  8. package/models/components/agent.js +143 -27
  9. package/models/components/agent.js.map +1 -1
  10. package/models/components/index.d.ts +0 -1
  11. package/models/components/index.d.ts.map +1 -1
  12. package/models/components/index.js +0 -1
  13. package/models/components/index.js.map +1 -1
  14. package/models/operations/createagent.d.ts +8 -35
  15. package/models/operations/createagent.d.ts.map +1 -1
  16. package/models/operations/createagent.js +8 -32
  17. package/models/operations/createagent.js.map +1 -1
  18. package/models/operations/createphonecall.d.ts +12 -6
  19. package/models/operations/createphonecall.d.ts.map +1 -1
  20. package/models/operations/createphonecall.js +8 -8
  21. package/models/operations/createphonecall.js.map +1 -1
  22. package/models/operations/createphonenumber.d.ts +1 -1
  23. package/models/operations/createwebcall.d.ts +16 -0
  24. package/models/operations/createwebcall.d.ts.map +1 -0
  25. package/models/operations/createwebcall.js +3 -0
  26. package/models/operations/createwebcall.js.map +1 -0
  27. package/models/operations/index.d.ts +1 -0
  28. package/models/operations/index.d.ts.map +1 -1
  29. package/models/operations/index.js +1 -0
  30. package/models/operations/index.js.map +1 -1
  31. package/models/operations/listagents.d.ts +3 -3
  32. package/models/operations/listagents.d.ts.map +1 -1
  33. package/models/operations/listagents.js +4 -4
  34. package/models/operations/listagents.js.map +1 -1
  35. package/models/operations/listcalls.d.ts +3 -3
  36. package/models/operations/listcalls.d.ts.map +1 -1
  37. package/models/operations/listcalls.js +4 -4
  38. package/models/operations/listcalls.js.map +1 -1
  39. package/models/operations/listphonenumbers.d.ts +3 -3
  40. package/models/operations/listphonenumbers.d.ts.map +1 -1
  41. package/models/operations/listphonenumbers.js +4 -4
  42. package/models/operations/listphonenumbers.js.map +1 -1
  43. package/models/operations/updateagent.d.ts +35 -3
  44. package/models/operations/updateagent.d.ts.map +1 -1
  45. package/models/operations/updateagent.js +39 -5
  46. package/models/operations/updateagent.js.map +1 -1
  47. package/package.json +1 -1
  48. package/sdk/liveClient.d.ts +2 -4
  49. package/sdk/liveClient.d.ts.map +1 -1
  50. package/sdk/liveClient.js +9 -5
  51. package/sdk/liveClient.js.map +1 -1
  52. package/sdk/sdk.d.ts +2 -6
  53. package/sdk/sdk.d.ts.map +1 -1
  54. package/sdk/sdk.js +10 -10
  55. package/sdk/sdk.js.map +1 -1
  56. package/src/example.ts +79 -0
  57. package/src/models/components/agent.ts +275 -52
  58. package/src/models/components/index.ts +0 -1
  59. package/src/models/operations/createagent.ts +20 -67
  60. package/src/models/operations/createphonecall.ts +20 -14
  61. package/src/models/operations/createphonenumber.ts +1 -1
  62. package/src/models/operations/createwebcall.ts +16 -0
  63. package/src/models/operations/index.ts +1 -0
  64. package/src/models/operations/listagents.ts +7 -7
  65. package/src/models/operations/listcalls.ts +7 -7
  66. package/src/models/operations/listphonenumbers.ts +7 -7
  67. package/src/models/operations/updateagent.ts +76 -7
  68. package/src/sdk/liveClient.ts +11 -8
  69. package/src/sdk/sdk.ts +10 -17
  70. package/docs/sdks/retellclient/README.md +0 -713
  71. package/src/models/components/agentnodefaultnorequired.ts +0 -121
@@ -4,23 +4,199 @@
4
4
 
5
5
  import { z } from "zod";
6
6
 
7
- export type Agent = {
7
+ export type RetellLlmSetting = {
8
8
  /**
9
- * Unique id of agent.
9
+ * Retell picked LLM based conversation response.
10
10
  */
11
- agentId: string;
11
+ provider: "retell";
12
12
  /**
13
- * The name of the agent. Only used for your own reference.
13
+ * The prompt agent will follow. Can use `${YOUR_PARAM_NAME}` to represent dynamic data that would get injected at each call.
14
14
  */
15
- agentName?: string | undefined;
15
+ prompt: string;
16
+ }
17
+
18
+ /** @internal */
19
+ export namespace RetellLlmSetting$ {
20
+ export type Inbound = {
21
+ provider: "retell";
22
+ prompt: string;
23
+ };
24
+
25
+ export const inboundSchema: z.ZodType<RetellLlmSetting, z.ZodTypeDef, Inbound> = z
26
+ .object({
27
+ provider: z.literal("retell"),
28
+ prompt: z.string(),
29
+ })
30
+ .transform((v) => {
31
+ return {
32
+ provider: v.provider,
33
+ prompt: v.prompt,
34
+ };
35
+ });
36
+
37
+ export type Outbound = {
38
+ provider: "retell";
39
+ prompt: string;
40
+ };
41
+
42
+ export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, RetellLlmSetting> = z
43
+ .object({
44
+ provider: z.literal("retell"),
45
+ prompt: z.string(),
46
+ })
47
+ .transform((v) => {
48
+ return {
49
+ provider: v.provider,
50
+ prompt: v.prompt,
51
+ };
52
+ });
53
+ }
54
+
55
+ export type CustomLlmSetting = {
56
+ /**
57
+ * Custom response system, usually your custom LLM. Note that you may see a higher latency if provided server is slow.
58
+ */
59
+ provider: "custom";
60
+ /**
61
+ * The URL we will call for getting response, usually your server.
62
+ */
63
+ url: string;
64
+ /**
65
+ * Whether the provided URL support return response via Server Sent Events.
66
+ */
67
+ stream: boolean;
68
+ }
69
+
70
+ /** @internal */
71
+ export namespace CustomLlmSetting$ {
72
+ export type Inbound = {
73
+ provider: "custom";
74
+ url: string;
75
+ stream: boolean;
76
+ };
77
+
78
+ export const inboundSchema: z.ZodType<CustomLlmSetting, z.ZodTypeDef, Inbound> = z
79
+ .object({
80
+ provider: z.literal("custom"),
81
+ url: z.string(),
82
+ stream: z.boolean(),
83
+ })
84
+ .transform((v) => {
85
+ return {
86
+ provider: v.provider,
87
+ url: v.url,
88
+ stream: v.stream
89
+ };
90
+ });
91
+
92
+ export type Outbound = {
93
+ provider: "custom";
94
+ url: string;
95
+ stream: boolean;
96
+ };
97
+
98
+ export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CustomLlmSetting> = z
99
+ .object({
100
+ provider: z.literal("custom"),
101
+ url: z.string(),
102
+ stream: z.boolean(),
103
+ })
104
+ .transform((v) => {
105
+ return {
106
+ provider: v.provider,
107
+ url: v.url,
108
+ stream: v.stream
109
+ };
110
+ });
111
+ }
112
+
113
+ export type InteractionSettingRequest = {
114
+ /**
115
+ * 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.
116
+ */
117
+ enableBeginMessage?: boolean | undefined;
16
118
  /**
17
119
  * 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.
18
120
  */
19
121
  beginMessage?: string | undefined;
122
+ /**
123
+ * Whether the agent can end a call. If false, the agent would never end a call.
124
+ */
125
+ enableEndCall?: boolean | undefined;
126
+ /**
127
+ * 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.
128
+ */
129
+ enableEndMessage?: boolean | undefined;
130
+ /**
131
+ * 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.
132
+ */
133
+ endMessage?: string | undefined;
134
+ }
135
+
136
+ /** @internal */
137
+ export namespace InteractionSettingRequest$ {
138
+ export type Inbound = {
139
+ enable_begin_message?: boolean | undefined;
140
+ begin_message?: string | undefined;
141
+ enable_end_call?: boolean | undefined;
142
+ enable_end_message?: boolean | undefined;
143
+ end_message?: string | undefined;
144
+ };
145
+
146
+ export const inboundSchema: z.ZodType<InteractionSettingRequest, z.ZodTypeDef, Inbound> = z
147
+ .object({
148
+ enable_begin_message: z.boolean().optional(),
149
+ begin_message: z.string().optional(),
150
+ enable_end_call: z.boolean().optional(),
151
+ enable_end_message: z.boolean().optional(),
152
+ end_message: z.string().optional(),
153
+ })
154
+ .transform((v) => {
155
+ return {
156
+ ...(v.enable_begin_message === undefined ? null : { enableBeginMessage: v.enable_begin_message }),
157
+ ...(v.begin_message === undefined ? null : { beginMessage: v.begin_message }),
158
+ ...(v.enable_end_call === undefined ? null : { enableEndCall: v.enable_end_call }),
159
+ ...(v.enable_end_message === undefined ? null : { enableEndMessage: v.enable_end_message }),
160
+ ...(v.end_message === undefined ? null : { endMessage: v.end_message }),
161
+ };
162
+ });
163
+
164
+ export type Outbound = {
165
+ enable_begin_message?: boolean | undefined;
166
+ begin_message?: string | undefined;
167
+ enable_end_call?: boolean | undefined;
168
+ enable_end_message?: boolean | undefined;
169
+ end_message?: string | undefined;
170
+ };
171
+
172
+ export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, InteractionSettingRequest> = z
173
+ .object({
174
+ enableBeginMessage: z.boolean().optional(),
175
+ beginMessage: z.string().optional(),
176
+ enableEndCall: z.boolean().optional(),
177
+ enableEndMessage: z.boolean().optional(),
178
+ endMessage: z.string().optional(),
179
+ })
180
+ .transform((v) => {
181
+ return {
182
+ ...(v.enableBeginMessage === undefined ? null : { enable_begin_message: v.enableBeginMessage }),
183
+ ...(v.beginMessage === undefined ? null : { begin_message: v.beginMessage }),
184
+ ...(v.enableEndCall === undefined ? null : { enable_end_call: v.enableEndCall }),
185
+ ...(v.enableEndMessage === undefined ? null : { enable_end_message: v.enableEndMessage }),
186
+ ...(v.endMessage === undefined ? null : { end_message: v.endMessage }),
187
+ };
188
+ });
189
+ }
190
+
191
+ export type InteractionSettingResponse = {
20
192
  /**
21
193
  * 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.
22
194
  */
23
195
  enableBeginMessage: boolean;
196
+ /**
197
+ * 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.
198
+ */
199
+ beginMessage?: string | undefined;
24
200
  /**
25
201
  * Whether the agent can end a call. If false, the agent would never end a call.
26
202
  */
@@ -33,18 +209,89 @@ export type Agent = {
33
209
  * 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.
34
210
  */
35
211
  endMessage?: string | undefined;
212
+ }
213
+
214
+ /** @internal */
215
+ export namespace InteractionSettingResponse$ {
216
+ export type Inbound = {
217
+ enable_begin_message: boolean;
218
+ begin_message?: string | undefined;
219
+ enable_end_call: boolean;
220
+ enable_end_message: boolean;
221
+ end_message?: string | undefined;
222
+ };
223
+
224
+ export const inboundSchema: z.ZodType<InteractionSettingResponse, z.ZodTypeDef, Inbound> = z
225
+ .object({
226
+ enable_begin_message: z.boolean(),
227
+ begin_message: z.string().optional(),
228
+ enable_end_call: z.boolean(),
229
+ enable_end_message: z.boolean(),
230
+ end_message: z.string().optional(),
231
+ })
232
+ .transform((v) => {
233
+ return {
234
+ enableBeginMessage: v.enable_begin_message,
235
+ ...(v.begin_message === undefined ? null : { beginMessage: v.begin_message }),
236
+ enableEndCall: v.enable_end_call,
237
+ enableEndMessage: v.enable_end_message,
238
+ ...(v.end_message === undefined ? null : { endMessage: v.end_message }),
239
+ };
240
+ });
241
+
242
+ export type Outbound = {
243
+ enable_begin_message: boolean;
244
+ begin_message?: string | undefined;
245
+ enable_end_call: boolean;
246
+ enable_end_message: boolean;
247
+ end_message?: string | undefined;
248
+ };
249
+
250
+ export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, InteractionSettingResponse> = z
251
+ .object({
252
+ enableBeginMessage: z.boolean(),
253
+ beginMessage: z.string().optional(),
254
+ enableEndCall: z.boolean(),
255
+ enableEndMessage: z.boolean(),
256
+ endMessage: z.string().optional(),
257
+ })
258
+ .transform((v) => {
259
+ return {
260
+ enable_begin_message: v.enableBeginMessage,
261
+ ...(v.beginMessage === undefined ? null : { begin_message: v.beginMessage }),
262
+ enable_end_call: v.enableEndCall,
263
+ enable_end_message: v.enableEndMessage,
264
+ ...(v.endMessage === undefined ? null : { end_message: v.endMessage }),
265
+ };
266
+ });
267
+ }
268
+
269
+ export type Agent = {
36
270
  /**
37
- * Last modification timestamp (milliseconds since epoch). Either the time of last update or creation if no updates available.
271
+ * Unique id of agent.
38
272
  */
39
- lastModificationTimestamp: number;
273
+ agentId: string;
274
+ /**
275
+ * The name of the agent. Only used for your own reference.
276
+ */
277
+ agentName?: string | undefined;
278
+ /*
279
+ * Determines how to generate the response in the call. Currently supports using our in-house LLM response system or your own custom
280
+ * response generation system.
281
+ */
282
+ llmSetting: RetellLlmSetting | CustomLlmSetting;
40
283
  /**
41
- * The prompt agent will follow. Check out [Prompt Best Practices](/features/prompt). Can use `${YOUR_PARAM_NAME}` to represent dynamic data that would get injected at each call. Learn more about [Agent Prompt Parameters](/features/prompt#prompt-parameters).
284
+ * Setting combination that controls interaction flow, like begin and end logic.
42
285
  */
43
- prompt: string;
286
+ interactionSetting: InteractionSettingResponse;
44
287
  /**
45
- * Unique voice id used for the agent. Find list of available voices and their characteristics in [Voices](/features/voices).
288
+ * Unique voice id used for the agent. Find list of available voices in documentation.
46
289
  */
47
290
  voiceId: string;
291
+ /**
292
+ * Last modification timestamp (milliseconds since epoch). Either the time of last update or creation if no updates available.
293
+ */
294
+ lastModificationTimestamp: number;
48
295
  };
49
296
 
50
297
  /** @internal */
@@ -52,82 +299,58 @@ export namespace Agent$ {
52
299
  export type Inbound = {
53
300
  agent_id: string;
54
301
  agent_name?: string | undefined;
55
- begin_message?: string | undefined;
56
- enable_begin_message: boolean;
57
- enable_end_call: boolean;
58
- enable_end_message: boolean;
59
- end_message?: string | undefined;
60
- last_modification_timestamp: number;
61
- prompt: string;
302
+ llm_setting: RetellLlmSetting$.Inbound | CustomLlmSetting$.Inbound;
303
+ interaction_setting: InteractionSettingResponse$.Inbound;
62
304
  voice_id: string;
305
+ last_modification_timestamp: number;
63
306
  };
64
307
 
65
308
  export const inboundSchema: z.ZodType<Agent, z.ZodTypeDef, Inbound> = z
66
309
  .object({
67
310
  agent_id: z.string(),
68
311
  agent_name: z.string().optional(),
69
- begin_message: z.string().optional(),
70
- enable_begin_message: z.boolean(),
71
- enable_end_call: z.boolean(),
72
- enable_end_message: z.boolean(),
73
- end_message: z.string().optional(),
74
- last_modification_timestamp: z.number().int(),
75
- prompt: z.string(),
312
+ llm_setting: z.union([RetellLlmSetting$.inboundSchema, CustomLlmSetting$.inboundSchema]),
313
+ interaction_setting: InteractionSettingResponse$.inboundSchema,
76
314
  voice_id: z.string(),
315
+ last_modification_timestamp: z.number().int(),
77
316
  })
78
317
  .transform((v) => {
79
318
  return {
80
319
  agentId: v.agent_id,
81
320
  ...(v.agent_name === undefined ? null : { agentName: v.agent_name }),
82
- ...(v.begin_message === undefined ? null : { beginMessage: v.begin_message }),
83
- enableBeginMessage: v.enable_begin_message,
84
- enableEndCall: v.enable_end_call,
85
- enableEndMessage: v.enable_end_message,
86
- ...(v.end_message === undefined ? null : { endMessage: v.end_message }),
87
- lastModificationTimestamp: v.last_modification_timestamp,
88
- prompt: v.prompt,
321
+ llmSetting: v.llm_setting,
322
+ interactionSetting: v.interaction_setting,
89
323
  voiceId: v.voice_id,
324
+ lastModificationTimestamp: v.last_modification_timestamp,
90
325
  };
91
326
  });
92
327
 
93
328
  export type Outbound = {
94
329
  agent_id: string;
95
330
  agent_name?: string | undefined;
96
- begin_message?: string | undefined;
97
- enable_begin_message: boolean;
98
- enable_end_call: boolean;
99
- enable_end_message: boolean;
100
- end_message?: string | undefined;
101
- last_modification_timestamp: number;
102
- prompt: string;
331
+ llm_setting: RetellLlmSetting$.Outbound | CustomLlmSetting$.Outbound;
332
+ interaction_setting: InteractionSettingResponse$.Outbound;
103
333
  voice_id: string;
334
+ last_modification_timestamp: number;
104
335
  };
105
336
 
106
337
  export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, Agent> = z
107
338
  .object({
108
339
  agentId: z.string(),
109
340
  agentName: z.string().optional(),
110
- beginMessage: z.string().optional(),
111
- enableBeginMessage: z.boolean(),
112
- enableEndCall: z.boolean(),
113
- enableEndMessage: z.boolean(),
114
- endMessage: z.string().optional(),
115
- lastModificationTimestamp: z.number().int(),
116
- prompt: z.string(),
341
+ llmSetting: z.union([RetellLlmSetting$.outboundSchema, CustomLlmSetting$.outboundSchema]),
342
+ interactionSetting: InteractionSettingResponse$.outboundSchema,
117
343
  voiceId: z.string(),
344
+ lastModificationTimestamp: z.number().int(),
118
345
  })
119
346
  .transform((v) => {
120
347
  return {
121
348
  agent_id: v.agentId,
122
349
  ...(v.agentName === undefined ? null : { agent_name: v.agentName }),
123
- ...(v.beginMessage === undefined ? null : { begin_message: v.beginMessage }),
124
- enable_begin_message: v.enableBeginMessage,
125
- enable_end_call: v.enableEndCall,
126
- enable_end_message: v.enableEndMessage,
127
- ...(v.endMessage === undefined ? null : { end_message: v.endMessage }),
128
- last_modification_timestamp: v.lastModificationTimestamp,
129
- prompt: v.prompt,
350
+ llm_setting: v.llmSetting,
351
+ interaction_setting: v.interactionSetting,
130
352
  voice_id: v.voiceId,
353
+ last_modification_timestamp: v.lastModificationTimestamp,
131
354
  };
132
355
  });
133
356
  }
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  export * from "./agent";
6
- export * from "./agentnodefaultnorequired";
7
6
  export * from "./agentpromptparams";
8
7
  export * from "./calldetail";
9
8
  export * from "./callphonenumber";
@@ -10,32 +10,17 @@ export type CreateAgentRequestBody = {
10
10
  * The name of the agent. Only used for your own reference.
11
11
  */
12
12
  agentName?: string | undefined;
13
+ /*
14
+ * Determines how to generate the response in the call. Currently supports using our in-house LLM response system or your own custom
15
+ * response generation system.
16
+ */
17
+ llmSetting: components.RetellLlmSetting | components.CustomLlmSetting;
13
18
  /**
14
- * 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.
19
+ * Setting combination that controls interaction flow, like begin and end logic.
15
20
  */
16
- beginMessage?: string | undefined;
21
+ interactionSetting?: components.InteractionSettingRequest | undefined;
17
22
  /**
18
- * 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.
19
- */
20
- enableBeginMessage?: boolean | undefined;
21
- /**
22
- * Whether the agent can end a call. If false, the agent would never end a call.
23
- */
24
- enableEndCall?: boolean | undefined;
25
- /**
26
- * 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.
27
- */
28
- enableEndMessage?: boolean | undefined;
29
- /**
30
- * 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.
31
- */
32
- endMessage?: string | undefined;
33
- /**
34
- * The prompt agent will follow. Check out [Prompt Best Practices](/features/prompt). Can use `${YOUR_PARAM_NAME}` to represent dynamic data that would get injected at each call. Learn more about [Agent Prompt Parameters](/features/prompt#prompt-parameters).
35
- */
36
- prompt: string;
37
- /**
38
- * Unique voice id used for the agent. Find list of available voices and their characteristics in [Voices](/features/voices).
23
+ * Unique voice id used for the agent. Find list of available voices in documentation.
39
24
  */
40
25
  voiceId: string;
41
26
  };
@@ -63,78 +48,46 @@ export type CreateAgentResponse = {
63
48
  export namespace CreateAgentRequestBody$ {
64
49
  export type Inbound = {
65
50
  agent_name?: string | undefined;
66
- begin_message?: string | undefined;
67
- enable_begin_message?: boolean | undefined;
68
- enable_end_call?: boolean | undefined;
69
- enable_end_message?: boolean | undefined;
70
- end_message?: string | undefined;
71
- prompt: string;
51
+ llm_setting: components.RetellLlmSetting$.Inbound | components.CustomLlmSetting$.Inbound;
52
+ interaction_setting?: components.InteractionSettingRequest$.Inbound | undefined;
72
53
  voice_id: string;
73
54
  };
74
55
 
75
56
  export const inboundSchema: z.ZodType<CreateAgentRequestBody, z.ZodTypeDef, Inbound> = z
76
57
  .object({
77
58
  agent_name: z.string().optional(),
78
- begin_message: z.string().optional(),
79
- enable_begin_message: z.boolean().optional(),
80
- enable_end_call: z.boolean().optional(),
81
- enable_end_message: z.boolean().optional(),
82
- end_message: z.string().optional(),
83
- prompt: z.string(),
59
+ llm_setting: z.union([components.RetellLlmSetting$.inboundSchema, components.CustomLlmSetting$.inboundSchema]),
60
+ interaction_setting: components.InteractionSettingRequest$.inboundSchema.optional(),
84
61
  voice_id: z.string(),
85
62
  })
86
63
  .transform((v) => {
87
64
  return {
88
65
  ...(v.agent_name === undefined ? null : { agentName: v.agent_name }),
89
- ...(v.begin_message === undefined ? null : { beginMessage: v.begin_message }),
90
- ...(v.enable_begin_message === undefined
91
- ? null
92
- : { enableBeginMessage: v.enable_begin_message }),
93
- ...(v.enable_end_call === undefined ? null : { enableEndCall: v.enable_end_call }),
94
- ...(v.enable_end_message === undefined
95
- ? null
96
- : { enableEndMessage: v.enable_end_message }),
97
- ...(v.end_message === undefined ? null : { endMessage: v.end_message }),
98
- prompt: v.prompt,
66
+ llmSetting: v.llm_setting,
67
+ ...(v.interaction_setting === undefined ? null : { interactionSetting: v.interaction_setting }),
99
68
  voiceId: v.voice_id,
100
69
  };
101
70
  });
102
71
 
103
72
  export type Outbound = {
104
73
  agent_name?: string | undefined;
105
- begin_message?: string | undefined;
106
- enable_begin_message?: boolean | undefined;
107
- enable_end_call?: boolean | undefined;
108
- enable_end_message?: boolean | undefined;
109
- end_message?: string | undefined;
110
- prompt: string;
74
+ llm_setting: components.RetellLlmSetting$.Inbound | components.CustomLlmSetting$.Inbound;
75
+ interaction_setting?: components.InteractionSettingRequest$.Inbound | undefined;
111
76
  voice_id: string;
112
77
  };
113
78
 
114
79
  export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CreateAgentRequestBody> = z
115
80
  .object({
116
81
  agentName: z.string().optional(),
117
- beginMessage: z.string().optional(),
118
- enableBeginMessage: z.boolean().optional(),
119
- enableEndCall: z.boolean().optional(),
120
- enableEndMessage: z.boolean().optional(),
121
- endMessage: z.string().optional(),
122
- prompt: z.string(),
82
+ llmSetting: z.union([components.RetellLlmSetting$.outboundSchema, components.CustomLlmSetting$.outboundSchema]),
83
+ interactionSetting: components.InteractionSettingRequest$.outboundSchema.optional(),
123
84
  voiceId: z.string(),
124
85
  })
125
86
  .transform((v) => {
126
87
  return {
127
88
  ...(v.agentName === undefined ? null : { agent_name: v.agentName }),
128
- ...(v.beginMessage === undefined ? null : { begin_message: v.beginMessage }),
129
- ...(v.enableBeginMessage === undefined
130
- ? null
131
- : { enable_begin_message: v.enableBeginMessage }),
132
- ...(v.enableEndCall === undefined ? null : { enable_end_call: v.enableEndCall }),
133
- ...(v.enableEndMessage === undefined
134
- ? null
135
- : { enable_end_message: v.enableEndMessage }),
136
- ...(v.endMessage === undefined ? null : { end_message: v.endMessage }),
137
- prompt: v.prompt,
89
+ llm_setting: v.llmSetting,
90
+ ...(v.interactionSetting === undefined ? null : { interaction_setting: v.interactionSetting }),
138
91
  voice_id: v.voiceId,
139
92
  };
140
93
  });
@@ -12,7 +12,7 @@ export type PhoneNumber = {
12
12
  /**
13
13
  * Phone number you purchased in E.164 format. It would have an agent id associated with it.
14
14
  */
15
- from?: any | undefined;
15
+ from: string;
16
16
  /**
17
17
  * Callee phone number in E.164 format.
18
18
  */
@@ -21,9 +21,12 @@ export type PhoneNumber = {
21
21
 
22
22
  export type CreatePhoneCallRequestBody = {
23
23
  /**
24
- * Supply values to your agent prompt parameters. If the given key value cannot match any param in prompt, it would have have any effect. Learn more about [Agent Prompt Parameters](/features/agent-prompt-parameter).
24
+ * Supply values to your agent prompt parameters. If the given key value cannot match any param in prompt, it would have have any effect.
25
25
  */
26
26
  agentPromptParams?: Array<components.AgentPromptParams> | undefined;
27
+ /**
28
+ * Phone number associated with the call.
29
+ */
27
30
  phoneNumber: PhoneNumber;
28
31
  };
29
32
 
@@ -69,6 +72,9 @@ export type CreatePhoneCallResponseBody = {
69
72
  * Web call or phone call.
70
73
  */
71
74
  callType: CreatePhoneCallCallType;
75
+ /**
76
+ * Phone number associated with the call.
77
+ */
72
78
  phoneNumber: components.CallPhoneNumber;
73
79
  /**
74
80
  * Begin timestamp (milliseconds since epoch) of the call.
@@ -98,35 +104,35 @@ export type CreatePhoneCallResponse = {
98
104
  /** @internal */
99
105
  export namespace PhoneNumber$ {
100
106
  export type Inbound = {
101
- from?: any | undefined;
107
+ from: string;
102
108
  to: string;
103
109
  };
104
110
 
105
111
  export const inboundSchema: z.ZodType<PhoneNumber, z.ZodTypeDef, Inbound> = z
106
112
  .object({
107
- from: z.any().optional(),
113
+ from: z.string(),
108
114
  to: z.string(),
109
115
  })
110
116
  .transform((v) => {
111
117
  return {
112
- ...(v.from === undefined ? null : { from: v.from }),
118
+ from: v.from,
113
119
  to: v.to,
114
120
  };
115
121
  });
116
122
 
117
123
  export type Outbound = {
118
- from?: any | undefined;
124
+ from: string;
119
125
  to: string;
120
126
  };
121
127
 
122
128
  export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, PhoneNumber> = z
123
129
  .object({
124
- from: z.any().optional(),
130
+ from: z.string(),
125
131
  to: z.string(),
126
132
  })
127
133
  .transform((v) => {
128
134
  return {
129
- ...(v.from === undefined ? null : { from: v.from }),
135
+ from: v.from,
130
136
  to: v.to,
131
137
  };
132
138
  });
@@ -256,7 +262,7 @@ export namespace CreatePhoneCallResponse$ {
256
262
  ContentType: string;
257
263
  StatusCode: number;
258
264
  RawResponse: Response;
259
- object?: CreatePhoneCallResponseBody$.Inbound | undefined;
265
+ callDetail?: CreatePhoneCallResponseBody$.Inbound | undefined;
260
266
  };
261
267
 
262
268
  export const inboundSchema: z.ZodType<CreatePhoneCallResponse, z.ZodTypeDef, Inbound> = z
@@ -264,14 +270,14 @@ export namespace CreatePhoneCallResponse$ {
264
270
  ContentType: z.string(),
265
271
  StatusCode: z.number().int(),
266
272
  RawResponse: z.instanceof(Response),
267
- object: z.lazy(() => CreatePhoneCallResponseBody$.inboundSchema).optional(),
273
+ callDetail: z.lazy(() => CreatePhoneCallResponseBody$.inboundSchema).optional(),
268
274
  })
269
275
  .transform((v) => {
270
276
  return {
271
277
  contentType: v.ContentType,
272
278
  statusCode: v.StatusCode,
273
279
  rawResponse: v.RawResponse,
274
- ...(v.object === undefined ? null : { object: v.object }),
280
+ ...(v.callDetail === undefined ? null : { callDetail: v.callDetail }),
275
281
  };
276
282
  });
277
283
 
@@ -279,7 +285,7 @@ export namespace CreatePhoneCallResponse$ {
279
285
  ContentType: string;
280
286
  StatusCode: number;
281
287
  RawResponse: never;
282
- object?: CreatePhoneCallResponseBody$.Outbound | undefined;
288
+ callDetail?: CreatePhoneCallResponseBody$.Outbound | undefined;
283
289
  };
284
290
 
285
291
  export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CreatePhoneCallResponse> = z
@@ -289,14 +295,14 @@ export namespace CreatePhoneCallResponse$ {
289
295
  rawResponse: z.instanceof(Response).transform(() => {
290
296
  throw new Error("Response cannot be serialized");
291
297
  }),
292
- object: z.lazy(() => CreatePhoneCallResponseBody$.outboundSchema).optional(),
298
+ callDetail: z.lazy(() => CreatePhoneCallResponseBody$.outboundSchema).optional(),
293
299
  })
294
300
  .transform((v) => {
295
301
  return {
296
302
  ContentType: v.contentType,
297
303
  StatusCode: v.statusCode,
298
304
  RawResponse: v.rawResponse,
299
- ...(v.object === undefined ? null : { object: v.object }),
305
+ ...(v.callDetail === undefined ? null : { callDetail: v.callDetail }),
300
306
  };
301
307
  });
302
308
  }
@@ -7,7 +7,7 @@ import { z } from "zod";
7
7
 
8
8
  export type CreatePhoneNumberRequestBody = {
9
9
  /**
10
- * Unique agent id to associate with this phone number. Can be updated with [Update Phone Agent](/api/update-phone-agent).
10
+ * Unique agent id to associate with this phone number. Can be updated.
11
11
  */
12
12
  agentId: string;
13
13
  /**