retell-sdk 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/LICENSE +201 -0
  3. package/README.md +304 -0
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +90 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +237 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +868 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +837 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +53 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +143 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +127 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +133 -0
  87. package/index.d.ts +133 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +117 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +89 -0
  92. package/index.mjs.map +1 -0
  93. package/package.json +107 -0
  94. package/resource.d.ts +6 -0
  95. package/resource.d.ts.map +1 -0
  96. package/resource.js +11 -0
  97. package/resource.js.map +1 -0
  98. package/resource.mjs +7 -0
  99. package/resource.mjs.map +1 -0
  100. package/resources/agent.d.ts +372 -0
  101. package/resources/agent.d.ts.map +1 -0
  102. package/resources/agent.js +44 -0
  103. package/resources/agent.js.map +1 -0
  104. package/resources/agent.mjs +40 -0
  105. package/resources/agent.mjs.map +1 -0
  106. package/resources/call.d.ts +461 -0
  107. package/resources/call.d.ts.map +1 -0
  108. package/resources/call.js +36 -0
  109. package/resources/call.js.map +1 -0
  110. package/resources/call.mjs +32 -0
  111. package/resources/call.mjs.map +1 -0
  112. package/resources/index.d.ts +5 -0
  113. package/resources/index.d.ts.map +1 -0
  114. package/resources/index.js +13 -0
  115. package/resources/index.js.map +1 -0
  116. package/resources/index.mjs +6 -0
  117. package/resources/index.mjs.map +1 -0
  118. package/resources/llm.d.ts +1355 -0
  119. package/resources/llm.d.ts.map +1 -0
  120. package/resources/llm.js +44 -0
  121. package/resources/llm.js.map +1 -0
  122. package/resources/llm.mjs +40 -0
  123. package/resources/llm.mjs.map +1 -0
  124. package/resources/phone-number.d.ts +78 -0
  125. package/resources/phone-number.d.ts.map +1 -0
  126. package/resources/phone-number.js +44 -0
  127. package/resources/phone-number.js.map +1 -0
  128. package/resources/phone-number.mjs +40 -0
  129. package/resources/phone-number.mjs.map +1 -0
  130. package/shims/node.d.ts +29 -0
  131. package/shims/node.d.ts.map +1 -0
  132. package/shims/node.js +31 -0
  133. package/shims/node.js.map +1 -0
  134. package/shims/node.mjs +5 -0
  135. package/shims/node.mjs.map +1 -0
  136. package/shims/web.d.ts +26 -0
  137. package/shims/web.d.ts.map +1 -0
  138. package/shims/web.js +31 -0
  139. package/shims/web.js.map +1 -0
  140. package/shims/web.mjs +5 -0
  141. package/shims/web.mjs.map +1 -0
  142. package/src/_shims/MultipartBody.ts +9 -0
  143. package/src/_shims/README.md +46 -0
  144. package/src/_shims/auto/runtime-bun.ts +4 -0
  145. package/src/_shims/auto/runtime-node.ts +4 -0
  146. package/src/_shims/auto/runtime.ts +4 -0
  147. package/src/_shims/auto/types-node.ts +4 -0
  148. package/src/_shims/auto/types.d.ts +101 -0
  149. package/src/_shims/auto/types.js +3 -0
  150. package/src/_shims/auto/types.mjs +3 -0
  151. package/src/_shims/bun-runtime.ts +14 -0
  152. package/src/_shims/index.d.ts +81 -0
  153. package/src/_shims/index.js +13 -0
  154. package/src/_shims/index.mjs +7 -0
  155. package/src/_shims/manual-types.d.ts +12 -0
  156. package/src/_shims/manual-types.js +3 -0
  157. package/src/_shims/manual-types.mjs +3 -0
  158. package/src/_shims/node-runtime.ts +83 -0
  159. package/src/_shims/node-types.d.ts +42 -0
  160. package/src/_shims/node-types.js +3 -0
  161. package/src/_shims/node-types.mjs +3 -0
  162. package/src/_shims/registry.ts +67 -0
  163. package/src/_shims/web-runtime.ts +103 -0
  164. package/src/_shims/web-types.d.ts +83 -0
  165. package/src/_shims/web-types.js +3 -0
  166. package/src/_shims/web-types.mjs +3 -0
  167. package/src/core.ts +1146 -0
  168. package/src/error.ts +146 -0
  169. package/src/index.ts +215 -0
  170. package/src/lib/.keep +4 -0
  171. package/src/resource.ts +11 -0
  172. package/src/resources/agent.ts +468 -0
  173. package/src/resources/call.ts +542 -0
  174. package/src/resources/index.ts +21 -0
  175. package/src/resources/llm.ts +1643 -0
  176. package/src/resources/phone-number.ts +111 -0
  177. package/src/shims/node.ts +50 -0
  178. package/src/shims/web.ts +50 -0
  179. package/src/tsconfig.json +11 -0
  180. package/src/uploads.ts +248 -0
  181. package/src/version.ts +1 -0
  182. package/uploads.d.ts +75 -0
  183. package/uploads.d.ts.map +1 -0
  184. package/uploads.js +165 -0
  185. package/uploads.js.map +1 -0
  186. package/uploads.mjs +152 -0
  187. package/uploads.mjs.map +1 -0
  188. package/version.d.ts +2 -0
  189. package/version.d.ts.map +1 -0
  190. package/version.js +5 -0
  191. package/version.js.map +1 -0
  192. package/version.mjs +2 -0
  193. package/version.mjs.map +1 -0
@@ -0,0 +1,542 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import * as Core from "../core";
4
+ import { APIResource } from "../resource";
5
+ import { isRequestOptions } from "../core";
6
+ import * as CallAPI from "./call";
7
+
8
+ export class Call extends APIResource {
9
+ /**
10
+ * Create a new phone call
11
+ */
12
+ create(body: CallCreateParams, options?: Core.RequestOptions): Core.APIPromise<CallCreateResponse> {
13
+ return this._client.post('/create-phone-call', { body, ...options });
14
+ }
15
+
16
+ /**
17
+ * Retrieve details of a specific call
18
+ */
19
+ retrieve(callId: string, options?: Core.RequestOptions): Core.APIPromise<CallDetailResponse> {
20
+ return this._client.get(`/get-call/${callId}`, options);
21
+ }
22
+
23
+ /**
24
+ * Retrieve call details
25
+ */
26
+ list(query?: CallListParams, options?: Core.RequestOptions): Core.APIPromise<CallListResponse>;
27
+ list(options?: Core.RequestOptions): Core.APIPromise<CallListResponse>;
28
+ list(
29
+ query: CallListParams | Core.RequestOptions = {},
30
+ options?: Core.RequestOptions,
31
+ ): Core.APIPromise<CallListResponse> {
32
+ if (isRequestOptions(query)) {
33
+ return this.list({}, query);
34
+ }
35
+ return this._client.get('/list-calls', { query, ...options });
36
+ }
37
+
38
+ /**
39
+ * Register Call To Get CallId To Establish Connection
40
+ */
41
+ register(body: CallRegisterParams, options?: Core.RequestOptions): Core.APIPromise<CallRegisterResponse> {
42
+ return this._client.post('/register-call', { body, ...options });
43
+ }
44
+ }
45
+
46
+ export interface CallDetailResponse {
47
+ /**
48
+ * Corresponding agent id of this call.
49
+ */
50
+ agent_id: string;
51
+
52
+ /**
53
+ * The audio encoding of the call. The following formats are supported:
54
+ *
55
+ * - `s16le` 16 bit linear PCM audio, the native format for web audio capture and
56
+ * playback.
57
+ *
58
+ * - `mulaw` non-linear audio encoding technique used in telephony. Commonly used
59
+ * by Twilio.
60
+ */
61
+ audio_encoding: 's16le' | 'mulaw';
62
+
63
+ /**
64
+ * Where the audio websocket would connect from would determine the format /
65
+ * protocol of websocket messages, and would determine how our server read audio
66
+ * bytes and send audio bytes.:
67
+ *
68
+ * - `web`: The protocol defined by Retell, commonly used for connecting from web
69
+ * frontend. Also useful for those who want to manipulate audio bytes directly.
70
+ *
71
+ * - `twilio`: The
72
+ * [websocket protocol](https://www.twilio.com/docs/voice/twiml/stream#message-media)
73
+ * defined by Twilio, used when your system uses Twilio, and supplies Retell
74
+ * audio websocket url to Twilio.
75
+ */
76
+ audio_websocket_protocol: 'web' | 'twilio';
77
+
78
+ /**
79
+ * Unique id of the call. Used to identify in LLM websocket and used to
80
+ * authenticate in audio websocket.
81
+ */
82
+ call_id: string;
83
+
84
+ /**
85
+ * Status of call.
86
+ *
87
+ * - `registered`: Call id issued, ready to make a call using this id.
88
+ *
89
+ * - `ongoing`: Call connected and ongoing.
90
+ *
91
+ * - `ended`: The underlying websocket has ended for the call. Either user or agent
92
+ * hanged up, or call transferred.
93
+ *
94
+ * - `error`: Call encountered error.
95
+ */
96
+ call_status: 'registered' | 'ongoing' | 'ended' | 'error';
97
+
98
+ /**
99
+ * Sample rate of the conversation, the input and output audio bytes will all
100
+ * conform to this rate. Check the audio source, audio format, and voice used for
101
+ * the agent to select one that works. supports value ranging from [8000, 48000].
102
+ * Note for Twilio `mulaw` encoding, the sample rate has to be 8000.
103
+ *
104
+ * - `s16le` sample rate recommendation (natively supported, lowest latency):
105
+ *
106
+ * - elevenlabs voices: 16000, 22050, 24000, 44100.
107
+ * - openai voices: 24000.
108
+ *
109
+ * - deepgram voices: 8000, 16000, 24000, 32000, 48000.
110
+ */
111
+ sample_rate: number;
112
+
113
+ /**
114
+ * Begin timestamp (milliseconds since epoch) of the call.
115
+ */
116
+ start_timestamp: number;
117
+
118
+ /**
119
+ * If users stay silent for a period, end the call. By default, it is set to
120
+ * 600,000 ms (10 min). The minimum value allowed is 10,000 ms (10 s).
121
+ */
122
+ end_call_after_silence_ms?: number;
123
+
124
+ /**
125
+ * The caller number. This field is storage purpose only, set this if you want the
126
+ * call object to contain it so that it's easier to reference it. Not used for
127
+ * processing, when we connect to your LLM websocket server, you can then get it
128
+ * from the call object.
129
+ */
130
+ from_number?: string;
131
+
132
+ /**
133
+ * An abtriary object for storage purpose only. You can put anything here like your
134
+ * own id for the call, twilio SID, internal customer id. Not used for processing,
135
+ * when we connect to your LLM websocket server, you can then get it from the call
136
+ * object.
137
+ */
138
+ metadata?: unknown;
139
+
140
+ /**
141
+ * Add optional dynamic variables in key value pairs of string that injects into
142
+ * your Retell LLM prompt and tool description. Only applicable for Retell LLM.
143
+ */
144
+ retell_llm_dynamic_variables?: Record<string, unknown>;
145
+
146
+ /**
147
+ * The callee number. This field is storage purpose only, set this if you want the
148
+ * call object to contain it so that it's easier to reference it. Not used for
149
+ * processing, when we connect to your LLM websocket server, you can then get it
150
+ * from the call object.
151
+ */
152
+ to_number?: string;
153
+ }
154
+
155
+ export interface CallCreateResponse {
156
+ /**
157
+ * Corresponding agent id of this call.
158
+ */
159
+ agent_id: string;
160
+
161
+ /**
162
+ * The audio encoding of the call. The following formats are supported:
163
+ *
164
+ * - `s16le` 16 bit linear PCM audio, the native format for web audio capture and
165
+ * playback.
166
+ *
167
+ * - `mulaw` non-linear audio encoding technique used in telephony. Commonly used
168
+ * by Twilio.
169
+ */
170
+ audio_encoding: 's16le' | 'mulaw';
171
+
172
+ /**
173
+ * Where the audio websocket would connect from would determine the format /
174
+ * protocol of websocket messages, and would determine how our server read audio
175
+ * bytes and send audio bytes.:
176
+ *
177
+ * - `web`: The protocol defined by Retell, commonly used for connecting from web
178
+ * frontend. Also useful for those who want to manipulate audio bytes directly.
179
+ *
180
+ * - `twilio`: The
181
+ * [websocket protocol](https://www.twilio.com/docs/voice/twiml/stream#message-media)
182
+ * defined by Twilio, used when your system uses Twilio, and supplies Retell
183
+ * audio websocket url to Twilio.
184
+ */
185
+ audio_websocket_protocol: 'web' | 'twilio';
186
+
187
+ /**
188
+ * Unique id of the call. Used to identify in LLM websocket and used to
189
+ * authenticate in audio websocket.
190
+ */
191
+ call_id: string;
192
+
193
+ /**
194
+ * Status of call.
195
+ *
196
+ * - `registered`: Call id issued, ready to make a call using this id.
197
+ *
198
+ * - `ongoing`: Call connected and ongoing.
199
+ *
200
+ * - `ended`: The underlying websocket has ended for the call. Either user or agent
201
+ * hanged up, or call transferred.
202
+ *
203
+ * - `error`: Call encountered error.
204
+ */
205
+ call_status: 'registered' | 'ongoing' | 'ended' | 'error';
206
+
207
+ /**
208
+ * Sample rate of the conversation, the input and output audio bytes will all
209
+ * conform to this rate. Check the audio source, audio format, and voice used for
210
+ * the agent to select one that works. supports value ranging from [8000, 48000].
211
+ * Note for Twilio `mulaw` encoding, the sample rate has to be 8000.
212
+ *
213
+ * - `s16le` sample rate recommendation (natively supported, lowest latency):
214
+ *
215
+ * - elevenlabs voices: 16000, 22050, 24000, 44100.
216
+ * - openai voices: 24000.
217
+ *
218
+ * - deepgram voices: 8000, 16000, 24000, 32000, 48000.
219
+ */
220
+ sample_rate: number;
221
+
222
+ /**
223
+ * Begin timestamp (milliseconds since epoch) of the call.
224
+ */
225
+ start_timestamp: number;
226
+
227
+ /**
228
+ * If users stay silent for a period, end the call. By default, it is set to
229
+ * 600,000 ms (10 min). The minimum value allowed is 10,000 ms (10 s).
230
+ */
231
+ end_call_after_silence_ms?: number;
232
+
233
+ /**
234
+ * The caller number. This field is storage purpose only, set this if you want the
235
+ * call object to contain it so that it's easier to reference it. Not used for
236
+ * processing, when we connect to your LLM websocket server, you can then get it
237
+ * from the call object.
238
+ */
239
+ from_number?: string;
240
+
241
+ /**
242
+ * An abtriary object for storage purpose only. You can put anything here like your
243
+ * own id for the call, twilio SID, internal customer id. Not used for processing,
244
+ * when we connect to your LLM websocket server, you can then get it from the call
245
+ * object.
246
+ */
247
+ metadata?: unknown;
248
+
249
+ /**
250
+ * Add optional dynamic variables in key value pairs of string that injects into
251
+ * your Retell LLM prompt and tool description. Only applicable for Retell LLM.
252
+ */
253
+ retell_llm_dynamic_variables?: Record<string, unknown>;
254
+
255
+ /**
256
+ * The callee number. This field is storage purpose only, set this if you want the
257
+ * call object to contain it so that it's easier to reference it. Not used for
258
+ * processing, when we connect to your LLM websocket server, you can then get it
259
+ * from the call object.
260
+ */
261
+ to_number?: string;
262
+ }
263
+
264
+ export type CallListResponse = Array<CallDetailResponse>;
265
+
266
+ export interface CallRegisterResponse {
267
+ /**
268
+ * Corresponding agent id of this call.
269
+ */
270
+ agent_id: string;
271
+
272
+ /**
273
+ * The audio encoding of the call. The following formats are supported:
274
+ *
275
+ * - `s16le` 16 bit linear PCM audio, the native format for web audio capture and
276
+ * playback.
277
+ *
278
+ * - `mulaw` non-linear audio encoding technique used in telephony. Commonly used
279
+ * by Twilio.
280
+ */
281
+ audio_encoding: 's16le' | 'mulaw';
282
+
283
+ /**
284
+ * Where the audio websocket would connect from would determine the format /
285
+ * protocol of websocket messages, and would determine how our server read audio
286
+ * bytes and send audio bytes.:
287
+ *
288
+ * - `web`: The protocol defined by Retell, commonly used for connecting from web
289
+ * frontend. Also useful for those who want to manipulate audio bytes directly.
290
+ *
291
+ * - `twilio`: The
292
+ * [websocket protocol](https://www.twilio.com/docs/voice/twiml/stream#message-media)
293
+ * defined by Twilio, used when your system uses Twilio, and supplies Retell
294
+ * audio websocket url to Twilio.
295
+ */
296
+ audio_websocket_protocol: 'web' | 'twilio';
297
+
298
+ /**
299
+ * Unique id of the call. Used to identify in LLM websocket and used to
300
+ * authenticate in audio websocket.
301
+ */
302
+ call_id: string;
303
+
304
+ /**
305
+ * Status of call.
306
+ *
307
+ * - `registered`: Call id issued, ready to make a call using this id.
308
+ *
309
+ * - `ongoing`: Call connected and ongoing.
310
+ *
311
+ * - `ended`: The underlying websocket has ended for the call. Either user or agent
312
+ * hanged up, or call transferred.
313
+ *
314
+ * - `error`: Call encountered error.
315
+ */
316
+ call_status: 'registered' | 'ongoing' | 'ended' | 'error';
317
+
318
+ /**
319
+ * Sample rate of the conversation, the input and output audio bytes will all
320
+ * conform to this rate. Check the audio source, audio format, and voice used for
321
+ * the agent to select one that works. supports value ranging from [8000, 48000].
322
+ * Note for Twilio `mulaw` encoding, the sample rate has to be 8000.
323
+ *
324
+ * - `s16le` sample rate recommendation (natively supported, lowest latency):
325
+ *
326
+ * - elevenlabs voices: 16000, 22050, 24000, 44100.
327
+ * - openai voices: 24000.
328
+ *
329
+ * - deepgram voices: 8000, 16000, 24000, 32000, 48000.
330
+ */
331
+ sample_rate: number;
332
+
333
+ /**
334
+ * Begin timestamp (milliseconds since epoch) of the call.
335
+ */
336
+ start_timestamp: number;
337
+
338
+ /**
339
+ * If users stay silent for a period, end the call. By default, it is set to
340
+ * 600,000 ms (10 min). The minimum value allowed is 10,000 ms (10 s).
341
+ */
342
+ end_call_after_silence_ms?: number;
343
+
344
+ /**
345
+ * The caller number. This field is storage purpose only, set this if you want the
346
+ * call object to contain it so that it's easier to reference it. Not used for
347
+ * processing, when we connect to your LLM websocket server, you can then get it
348
+ * from the call object.
349
+ */
350
+ from_number?: string;
351
+
352
+ /**
353
+ * An abtriary object for storage purpose only. You can put anything here like your
354
+ * own id for the call, twilio SID, internal customer id. Not used for processing,
355
+ * when we connect to your LLM websocket server, you can then get it from the call
356
+ * object.
357
+ */
358
+ metadata?: unknown;
359
+
360
+ /**
361
+ * Add optional dynamic variables in key value pairs of string that injects into
362
+ * your Retell LLM prompt and tool description. Only applicable for Retell LLM.
363
+ */
364
+ retell_llm_dynamic_variables?: Record<string, unknown>;
365
+
366
+ /**
367
+ * The callee number. This field is storage purpose only, set this if you want the
368
+ * call object to contain it so that it's easier to reference it. Not used for
369
+ * processing, when we connect to your LLM websocket server, you can then get it
370
+ * from the call object.
371
+ */
372
+ to_number?: string;
373
+ }
374
+
375
+ export interface CallCreateParams {
376
+ phone_number: CallCreateParams.PhoneNumber;
377
+
378
+ /**
379
+ * For this particular call, override the agent used with this agent id. This does
380
+ * not bind the agent to this number, this is for one time override.
381
+ */
382
+ override_agent_id?: string;
383
+
384
+ /**
385
+ * Add optional dynamic variables in key value pairs of string that injects into
386
+ * your Retell LLM prompt and tool description. Only applicable for Retell LLM.
387
+ */
388
+ retell_llm_dynamic_variables?: Record<string, unknown>;
389
+ }
390
+
391
+ export namespace CallCreateParams {
392
+ export interface PhoneNumber {
393
+ /**
394
+ * The number you own in BCP 47 format.
395
+ */
396
+ from: string;
397
+
398
+ /**
399
+ * The number you want to call, in BCP 47 format.
400
+ */
401
+ to: string;
402
+ }
403
+ }
404
+
405
+ export interface CallListParams {
406
+ filter_criteria?: CallListParams.FilterCriteria;
407
+
408
+ /**
409
+ * Limit the number of calls returned.
410
+ */
411
+ limit?: number;
412
+
413
+ /**
414
+ * The calls will be sorted by `start_timestamp`, whether to return the calls in
415
+ * ascending or descending order.
416
+ */
417
+ sort_order?: 'ascending' | 'descending';
418
+ }
419
+
420
+ export namespace CallListParams {
421
+ export interface FilterCriteria {
422
+ /**
423
+ * Inclusive. Filter calls that end on or after this timestamp.
424
+ */
425
+ after_end_timestamp?: number;
426
+
427
+ /**
428
+ * Inclusive. Filter calls that start on or after this timestamp.
429
+ */
430
+ after_start_timestamp?: number;
431
+
432
+ /**
433
+ * Only retrieve calls that are made with specific agent(s).
434
+ */
435
+ agent_id?: Array<string>;
436
+
437
+ /**
438
+ * Exclusive. Filter calls that end before this timestamp.
439
+ */
440
+ before_end_timestamp?: number;
441
+
442
+ /**
443
+ * Exclusive. Filter calls that start before this timestamp.
444
+ */
445
+ before_start_timestamp?: number;
446
+ }
447
+ }
448
+
449
+ export interface CallRegisterParams {
450
+ /**
451
+ * Unique id of agent used for the call. Your agent would contain the LLM Websocket
452
+ * url used for this call.
453
+ */
454
+ agent_id: string;
455
+
456
+ /**
457
+ * The audio encoding of the call. The following formats are supported:
458
+ *
459
+ * - `s16le` 16 bit linear PCM audio, the native format for web audio capture and
460
+ * playback.
461
+ *
462
+ * - `mulaw` non-linear audio encoding technique used in telephony. Commonly used
463
+ * by Twilio.
464
+ */
465
+ audio_encoding: 's16le' | 'mulaw';
466
+
467
+ /**
468
+ * Where the audio websocket would connect from would determine the format /
469
+ * protocol of websocket messages, and would determine how our server read audio
470
+ * bytes and send audio bytes.:
471
+ *
472
+ * - `web`: The protocol defined by Retell, commonly used for connecting from web
473
+ * frontend. Also useful for those who want to manipulate audio bytes directly.
474
+ *
475
+ * - `twilio`: The
476
+ * [websocket protocol](https://www.twilio.com/docs/voice/twiml/stream#message-media)
477
+ * defined by Twilio, used when your system uses Twilio, and supplies Retell
478
+ * audio websocket url to Twilio.
479
+ */
480
+ audio_websocket_protocol: 'web' | 'twilio';
481
+
482
+ /**
483
+ * Sample rate of the conversation, the input and output audio bytes will all
484
+ * conform to this rate. Check the audio source, audio format, and voice used for
485
+ * the agent to select one that works. supports value ranging from [8000, 48000].
486
+ * Note for Twilio `mulaw` encoding, the sample rate has to be 8000.
487
+ *
488
+ * - `s16le` sample rate recommendation (natively supported, lowest latency):
489
+ *
490
+ * - elevenlabs voices: 16000, 22050, 24000, 44100.
491
+ * - openai voices: 24000.
492
+ *
493
+ * - deepgram voices: 8000, 16000, 24000, 32000, 48000.
494
+ */
495
+ sample_rate: number;
496
+
497
+ /**
498
+ * If users stay silent for a period, end the call. By default, it is set to
499
+ * 600,000 ms (10 min). The minimum value allowed is 10,000 ms (10 s).
500
+ */
501
+ end_call_after_silence_ms?: number;
502
+
503
+ /**
504
+ * The caller number. This field is storage purpose only, set this if you want the
505
+ * call object to contain it so that it's easier to reference it. Not used for
506
+ * processing, when we connect to your LLM websocket server, you can then get it
507
+ * from the call object.
508
+ */
509
+ from_number?: string;
510
+
511
+ /**
512
+ * An abtriary object for storage purpose only. You can put anything here like your
513
+ * own id for the call, twilio SID, internal customer id. Not used for processing,
514
+ * when we connect to your LLM websocket server, you can then get it from the call
515
+ * object.
516
+ */
517
+ metadata?: unknown;
518
+
519
+ /**
520
+ * Add optional dynamic variables in key value pairs of string that injects into
521
+ * your Retell LLM prompt and tool description. Only applicable for Retell LLM.
522
+ */
523
+ retell_llm_dynamic_variables?: Record<string, unknown>;
524
+
525
+ /**
526
+ * The callee number. This field is storage purpose only, set this if you want the
527
+ * call object to contain it so that it's easier to reference it. Not used for
528
+ * processing, when we connect to your LLM websocket server, you can then get it
529
+ * from the call object.
530
+ */
531
+ to_number?: string;
532
+ }
533
+
534
+ export namespace Call {
535
+ export import CallDetailResponse = CallAPI.CallDetailResponse;
536
+ export import CallCreateResponse = CallAPI.CallCreateResponse;
537
+ export import CallListResponse = CallAPI.CallListResponse;
538
+ export import CallRegisterResponse = CallAPI.CallRegisterResponse;
539
+ export import CallCreateParams = CallAPI.CallCreateParams;
540
+ export import CallListParams = CallAPI.CallListParams;
541
+ export import CallRegisterParams = CallAPI.CallRegisterParams;
542
+ }
@@ -0,0 +1,21 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { AgentResponse, AgentListResponse, AgentCreateParams, AgentUpdateParams, Agent } from './agent';
4
+ export {
5
+ CallDetailResponse,
6
+ CallCreateResponse,
7
+ CallListResponse,
8
+ CallRegisterResponse,
9
+ CallCreateParams,
10
+ CallListParams,
11
+ CallRegisterParams,
12
+ Call,
13
+ } from './call';
14
+ export { LlmResponse, LlmListResponse, LlmCreateParams, LlmUpdateParams, Llm } from './llm';
15
+ export {
16
+ PhoneNumberResponse,
17
+ PhoneNumberListResponse,
18
+ PhoneNumberCreateParams,
19
+ PhoneNumberUpdateParams,
20
+ PhoneNumber,
21
+ } from './phone-number';