retell-sdk 2.2.3 → 2.2.6

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 (184) hide show
  1. package/example.js +48 -5
  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 -205
  11. package/models/components/agent.d.ts.map +1 -1
  12. package/models/components/agent.js +5 -187
  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 +33 -22
  17. package/models/components/calldetail.d.ts.map +1 -1
  18. package/models/components/calldetail.js +44 -31
  19. package/models/components/calldetail.js.map +1 -1
  20. package/models/components/callphonenumber.d.ts.map +1 -1
  21. package/models/components/callphonenumber.js.map +1 -1
  22. package/models/components/index.d.ts +0 -3
  23. package/models/components/index.d.ts.map +1 -1
  24. package/models/components/index.js +0 -3
  25. package/models/components/index.js.map +1 -1
  26. package/models/components/phonenumber.d.ts.map +1 -1
  27. package/models/components/phonenumber.js.map +1 -1
  28. package/models/components/security.d.ts.map +1 -1
  29. package/models/errors/createagent.d.ts.map +1 -1
  30. package/models/errors/createagent.js +36 -12
  31. package/models/errors/createagent.js.map +1 -1
  32. package/models/errors/createphonecall.d.ts.map +1 -1
  33. package/models/errors/createphonecall.js +54 -18
  34. package/models/errors/createphonecall.js.map +1 -1
  35. package/models/errors/createphonenumber.d.ts.map +1 -1
  36. package/models/errors/createphonenumber.js +42 -14
  37. package/models/errors/createphonenumber.js.map +1 -1
  38. package/models/errors/deleteagent.d.ts.map +1 -1
  39. package/models/errors/deleteagent.js +36 -12
  40. package/models/errors/deleteagent.js.map +1 -1
  41. package/models/errors/deletephonenumber.d.ts.map +1 -1
  42. package/models/errors/deletephonenumber.js +33 -11
  43. package/models/errors/deletephonenumber.js.map +1 -1
  44. package/models/errors/getagent.d.ts.map +1 -1
  45. package/models/errors/getagent.js +36 -12
  46. package/models/errors/getagent.js.map +1 -1
  47. package/models/errors/getcall.d.ts.map +1 -1
  48. package/models/errors/getcall.js +30 -10
  49. package/models/errors/getcall.js.map +1 -1
  50. package/models/errors/getphonenumber.d.ts.map +1 -1
  51. package/models/errors/getphonenumber.js +36 -12
  52. package/models/errors/getphonenumber.js.map +1 -1
  53. package/models/errors/index.d.ts +1 -6
  54. package/models/errors/index.d.ts.map +1 -1
  55. package/models/errors/index.js +1 -6
  56. package/models/errors/index.js.map +1 -1
  57. package/models/errors/listagents.d.ts.map +1 -1
  58. package/models/errors/listagents.js +15 -5
  59. package/models/errors/listagents.js.map +1 -1
  60. package/models/errors/listcalls.d.ts.map +1 -1
  61. package/models/errors/listcalls.js +24 -8
  62. package/models/errors/listcalls.js.map +1 -1
  63. package/models/errors/listphonenumbers.d.ts.map +1 -1
  64. package/models/errors/listphonenumbers.js +27 -9
  65. package/models/errors/listphonenumbers.js.map +1 -1
  66. package/models/errors/registercall.d.ts +218 -0
  67. package/models/errors/registercall.d.ts.map +1 -0
  68. package/models/errors/registercall.js +386 -0
  69. package/models/errors/registercall.js.map +1 -0
  70. package/models/errors/updateagent.d.ts.map +1 -1
  71. package/models/errors/updateagent.js +36 -12
  72. package/models/errors/updateagent.js.map +1 -1
  73. package/models/errors/updatephoneagent.d.ts.map +1 -1
  74. package/models/errors/updatephoneagent.js +36 -12
  75. package/models/errors/updatephoneagent.js.map +1 -1
  76. package/models/operations/createagent.d.ts +3 -16
  77. package/models/operations/createagent.d.ts.map +1 -1
  78. package/models/operations/createagent.js +4 -12
  79. package/models/operations/createagent.js.map +1 -1
  80. package/models/operations/createphonecall.d.ts.map +1 -1
  81. package/models/operations/createphonecall.js +18 -6
  82. package/models/operations/createphonecall.js.map +1 -1
  83. package/models/operations/createphonenumber.d.ts.map +1 -1
  84. package/models/operations/createphonenumber.js +6 -2
  85. package/models/operations/createphonenumber.js.map +1 -1
  86. package/models/operations/createwebcall.d.ts.map +1 -1
  87. package/models/operations/deleteagent.d.ts.map +1 -1
  88. package/models/operations/deleteagent.js.map +1 -1
  89. package/models/operations/deletephonenumber.d.ts.map +1 -1
  90. package/models/operations/deletephonenumber.js.map +1 -1
  91. package/models/operations/getagent.d.ts.map +1 -1
  92. package/models/operations/getagent.js.map +1 -1
  93. package/models/operations/getcall.d.ts +1 -1
  94. package/models/operations/getcall.d.ts.map +1 -1
  95. package/models/operations/getcall.js.map +1 -1
  96. package/models/operations/getphonenumber.d.ts.map +1 -1
  97. package/models/operations/getphonenumber.js +6 -2
  98. package/models/operations/getphonenumber.js.map +1 -1
  99. package/models/operations/index.d.ts +1 -7
  100. package/models/operations/index.d.ts.map +1 -1
  101. package/models/operations/index.js +1 -7
  102. package/models/operations/index.js.map +1 -1
  103. package/models/operations/listagents.d.ts.map +1 -1
  104. package/models/operations/listagents.js.map +1 -1
  105. package/models/operations/listcalls.d.ts +1 -7
  106. package/models/operations/listcalls.d.ts.map +1 -1
  107. package/models/operations/listcalls.js +6 -6
  108. package/models/operations/listcalls.js.map +1 -1
  109. package/models/operations/listphonenumbers.d.ts.map +1 -1
  110. package/models/operations/listphonenumbers.js +6 -2
  111. package/models/operations/listphonenumbers.js.map +1 -1
  112. package/models/operations/registercall.d.ts +74 -0
  113. package/models/operations/registercall.d.ts.map +1 -0
  114. package/models/operations/registercall.js +104 -0
  115. package/models/operations/registercall.js.map +1 -0
  116. package/models/operations/updateagent.d.ts +3 -16
  117. package/models/operations/updateagent.d.ts.map +1 -1
  118. package/models/operations/updateagent.js +9 -13
  119. package/models/operations/updateagent.js.map +1 -1
  120. package/models/operations/updatephoneagent.d.ts.map +1 -1
  121. package/models/operations/updatephoneagent.js +6 -2
  122. package/models/operations/updatephoneagent.js.map +1 -1
  123. package/package.json +1 -1
  124. package/sdk/audioWsClient.d.ts +10 -0
  125. package/sdk/audioWsClient.d.ts.map +1 -0
  126. package/sdk/audioWsClient.js +60 -0
  127. package/sdk/audioWsClient.js.map +1 -0
  128. package/sdk/index.d.ts +1 -1
  129. package/sdk/index.d.ts.map +1 -1
  130. package/sdk/index.js +1 -1
  131. package/sdk/index.js.map +1 -1
  132. package/sdk/liveClient.d.ts.map +1 -1
  133. package/sdk/liveClient.js +7 -2
  134. package/sdk/liveClient.js.map +1 -1
  135. package/sdk/sdk.d.ts +1 -23
  136. package/sdk/sdk.d.ts.map +1 -1
  137. package/sdk/sdk.js +21 -430
  138. package/sdk/sdk.js.map +1 -1
  139. package/src/example.ts +136 -88
  140. package/src/lib/config.ts +32 -32
  141. package/src/lib/sdks.ts +91 -82
  142. package/src/lib/security.ts +133 -118
  143. package/src/models/components/agent.ts +71 -451
  144. package/src/models/components/calldetail.ts +147 -130
  145. package/src/models/components/index.ts +0 -3
  146. package/src/models/components/security.ts +1 -1
  147. package/src/models/errors/createagent.ts +359 -311
  148. package/src/models/errors/deleteagent.ts +359 -311
  149. package/src/models/errors/getagent.ts +358 -302
  150. package/src/models/errors/getcall.ts +348 -294
  151. package/src/models/errors/index.ts +1 -6
  152. package/src/models/errors/listagents.ts +174 -147
  153. package/src/models/errors/listcalls.ts +251 -211
  154. package/src/models/errors/registercall.ts +662 -0
  155. package/src/models/errors/updateagent.ts +359 -311
  156. package/src/models/operations/createagent.ts +124 -130
  157. package/src/models/operations/deleteagent.ts +94 -78
  158. package/src/models/operations/getagent.ts +104 -88
  159. package/src/models/operations/getcall.ts +101 -88
  160. package/src/models/operations/index.ts +1 -7
  161. package/src/models/operations/listagents.ts +68 -60
  162. package/src/models/operations/listcalls.ts +228 -213
  163. package/src/models/operations/registercall.ts +167 -0
  164. package/src/models/operations/updateagent.ts +180 -174
  165. package/src/sdk/audioWsClient.ts +63 -0
  166. package/src/sdk/index.ts +1 -1
  167. package/src/sdk/sdk.ts +802 -1162
  168. package/src/models/components/agentpromptparams.ts +0 -53
  169. package/src/models/components/callphonenumber.ts +0 -56
  170. package/src/models/components/phonenumber.ts +0 -83
  171. package/src/models/errors/createphonecall.ts +0 -597
  172. package/src/models/errors/createphonenumber.ts +0 -500
  173. package/src/models/errors/deletephonenumber.ts +0 -400
  174. package/src/models/errors/getphonenumber.ts +0 -397
  175. package/src/models/errors/listphonenumbers.ts +0 -297
  176. package/src/models/errors/updatephoneagent.ts +0 -397
  177. package/src/models/operations/createphonecall.ts +0 -308
  178. package/src/models/operations/createphonenumber.ts +0 -124
  179. package/src/models/operations/createwebcall.ts +0 -16
  180. package/src/models/operations/deletephonenumber.ts +0 -103
  181. package/src/models/operations/getphonenumber.ts +0 -114
  182. package/src/models/operations/listphonenumbers.ts +0 -76
  183. package/src/models/operations/updatephoneagent.ts +0 -159
  184. package/src/sdk/liveClient.ts +0 -109
@@ -4,460 +4,80 @@
4
4
 
5
5
  import { z } from "zod";
6
6
 
7
- export type Function = {
8
- /**
9
- * Link to the url where the function call parameters would sent to as a json body. Most likely your server endpoint you expose for this function.
10
- */
11
- url: string;
12
- /**
13
- * A description of what the function does, used by the model to choose when and how to call the function. Recommended to populate this for better results.
14
- */
15
- description?: string | undefined;
16
- /**
17
- * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
18
- */
19
- name: string;
20
- /**
21
- * The parameters the functions accepts, described as a JSON Schema object for type object
22
- */
23
- parameters?: {
24
- /**
25
- * The type of parameters is object.
26
- */
27
- type: 'object';
28
- /**
29
- * Defines what properties are required for the parameters.
30
- */
31
- required?: string[] | undefined;
32
- /**
33
- * 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
- properties: Record<string, any>;
36
- } | undefined;
37
- };
38
-
39
- /** @internal */
40
- 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
- };
51
-
52
- export const inboundSchema: z.ZodType<Function, z.ZodTypeDef, Inbound> = z
53
- .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(),
62
- })
63
- .transform((v) => {
64
- return {
65
- url: v.url,
66
- description: v.description,
67
- name: v.name,
68
- parameters: v.parameters,
69
- };
70
- });
71
-
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
- };
82
-
83
- export const outboundSchema: z.ZodType<Function, z.ZodTypeDef, Inbound> = z
84
- .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(),
93
- })
94
- .transform((v) => {
95
- return {
96
- url: v.url,
97
- description: v.description,
98
- name: v.name,
99
- parameters: v.parameters,
100
- };
101
- });
102
- }
103
-
104
- 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
- }
114
-
115
- /** @internal */
116
- export namespace RetellLlmSetting$ {
117
- export type Inbound = {
118
- provider: "retell";
119
- prompt: string;
120
- };
121
-
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
- });
133
-
134
- export type Outbound = {
135
- provider: "retell";
136
- prompt: string;
137
- };
138
-
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
- });
150
- }
151
-
152
- 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
- }
166
-
167
- /** @internal */
168
- export namespace CustomLlmSetting$ {
169
- export type Inbound = {
170
- provider: "custom";
171
- url: string;
172
- stream: boolean;
173
- };
174
-
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
- });
188
-
189
- export type Outbound = {
190
- provider: "custom";
191
- url: string;
192
- stream: boolean;
193
- };
194
-
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
- });
208
- }
209
-
210
- 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
- }
232
-
233
- /** @internal */
234
- 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
- };
242
-
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
- });
260
-
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
- };
268
-
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
- });
286
- }
287
-
288
- 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
- }
310
-
311
- /** @internal */
312
- 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
- };
320
-
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
- });
338
-
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
- };
346
-
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
- });
364
- }
365
-
366
7
  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;
8
+ /**
9
+ * Unique id of agent.
10
+ */
11
+ agentId: string;
12
+ /**
13
+ * The name of the agent. Only used for your own reference.
14
+ */
15
+ agentName?: string | undefined;
16
+ /*
17
+ * The URL we will establish LLM websocket for getting response, usually your server.
18
+ */
19
+ llmWebsocketUrl: string;
20
+ /**
21
+ * Unique voice id used for the agent. Find list of available voices in documentation.
22
+ */
23
+ voiceId: string;
24
+ /**
25
+ * Last modification timestamp (milliseconds since epoch). Either the time of last update or creation if no updates available.
26
+ */
27
+ lastModificationTimestamp: number;
396
28
  };
397
29
 
398
30
  /** @internal */
399
31
  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
- };
409
-
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
- });
431
-
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
- };
441
-
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
- });
32
+ export type Inbound = {
33
+ agent_id: string;
34
+ agent_name?: string | undefined;
35
+ llm_websocket_url: string;
36
+ voice_id: string;
37
+ last_modification_timestamp: number;
38
+ };
39
+
40
+ export const inboundSchema: z.ZodType<Agent, z.ZodTypeDef, Inbound> = z
41
+ .object({
42
+ agent_id: z.string(),
43
+ agent_name: z.string().optional(),
44
+ llm_websocket_url: z.string(),
45
+ voice_id: z.string(),
46
+ last_modification_timestamp: z.number().int(),
47
+ })
48
+ .transform((v) => {
49
+ return {
50
+ agentId: v.agent_id,
51
+ ...(v.agent_name === undefined ? null : { agentName: v.agent_name }),
52
+ llmWebsocketUrl: v.llm_websocket_url,
53
+ voiceId: v.voice_id,
54
+ lastModificationTimestamp: v.last_modification_timestamp,
55
+ };
56
+ });
57
+
58
+ export type Outbound = {
59
+ agent_id: string;
60
+ agent_name?: string | undefined;
61
+ llm_websocket_url: string;
62
+ voice_id: string;
63
+ last_modification_timestamp: number;
64
+ };
65
+
66
+ export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, Agent> = z
67
+ .object({
68
+ agentId: z.string(),
69
+ agentName: z.string().optional(),
70
+ llmWebsocketUrl: z.string(),
71
+ voiceId: z.string(),
72
+ lastModificationTimestamp: z.number().int(),
73
+ })
74
+ .transform((v) => {
75
+ return {
76
+ agent_id: v.agentId,
77
+ ...(v.agentName === undefined ? null : { agent_name: v.agentName }),
78
+ llm_websocket_url: v.llmWebsocketUrl,
79
+ voice_id: v.voiceId,
80
+ last_modification_timestamp: v.lastModificationTimestamp,
81
+ };
82
+ });
463
83
  }