retell-sdk 5.18.0 → 5.19.0

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 (84) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/client.d.mts +4 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/internal/types.d.mts +6 -6
  9. package/internal/types.d.mts.map +1 -1
  10. package/internal/types.d.ts +6 -6
  11. package/internal/types.d.ts.map +1 -1
  12. package/package.json +1 -1
  13. package/resources/agent.d.mts +143 -17
  14. package/resources/agent.d.mts.map +1 -1
  15. package/resources/agent.d.ts +143 -17
  16. package/resources/agent.d.ts.map +1 -1
  17. package/resources/agent.js +2 -19
  18. package/resources/agent.js.map +1 -1
  19. package/resources/agent.mjs +2 -19
  20. package/resources/agent.mjs.map +1 -1
  21. package/resources/batch-call.d.mts +43 -4
  22. package/resources/batch-call.d.mts.map +1 -1
  23. package/resources/batch-call.d.ts +43 -4
  24. package/resources/batch-call.d.ts.map +1 -1
  25. package/resources/call.d.mts +129 -12
  26. package/resources/call.d.mts.map +1 -1
  27. package/resources/call.d.ts +129 -12
  28. package/resources/call.d.ts.map +1 -1
  29. package/resources/chat-agent.d.mts +29 -20
  30. package/resources/chat-agent.d.mts.map +1 -1
  31. package/resources/chat-agent.d.ts +29 -20
  32. package/resources/chat-agent.d.ts.map +1 -1
  33. package/resources/chat-agent.js +2 -19
  34. package/resources/chat-agent.js.map +1 -1
  35. package/resources/chat-agent.mjs +2 -19
  36. package/resources/chat-agent.mjs.map +1 -1
  37. package/resources/chat.d.mts +2 -2
  38. package/resources/chat.d.mts.map +1 -1
  39. package/resources/chat.d.ts +2 -2
  40. package/resources/chat.d.ts.map +1 -1
  41. package/resources/conversation-flow-component.d.mts +186 -48
  42. package/resources/conversation-flow-component.d.mts.map +1 -1
  43. package/resources/conversation-flow-component.d.ts +186 -48
  44. package/resources/conversation-flow-component.d.ts.map +1 -1
  45. package/resources/conversation-flow.d.mts +375 -99
  46. package/resources/conversation-flow.d.mts.map +1 -1
  47. package/resources/conversation-flow.d.ts +375 -99
  48. package/resources/conversation-flow.d.ts.map +1 -1
  49. package/resources/index.d.mts +2 -2
  50. package/resources/index.d.mts.map +1 -1
  51. package/resources/index.d.ts +2 -2
  52. package/resources/index.d.ts.map +1 -1
  53. package/resources/index.js.map +1 -1
  54. package/resources/index.mjs.map +1 -1
  55. package/resources/llm.d.mts +9 -9
  56. package/resources/llm.d.mts.map +1 -1
  57. package/resources/llm.d.ts +9 -9
  58. package/resources/llm.d.ts.map +1 -1
  59. package/resources/phone-number.d.mts +108 -12
  60. package/resources/phone-number.d.mts.map +1 -1
  61. package/resources/phone-number.d.ts +108 -12
  62. package/resources/phone-number.d.ts.map +1 -1
  63. package/resources/tests.d.mts +3 -3
  64. package/resources/tests.d.mts.map +1 -1
  65. package/resources/tests.d.ts +3 -3
  66. package/resources/tests.d.ts.map +1 -1
  67. package/src/client.ts +4 -0
  68. package/src/internal/types.ts +6 -8
  69. package/src/resources/agent.ts +167 -23
  70. package/src/resources/batch-call.ts +46 -4
  71. package/src/resources/call.ts +138 -12
  72. package/src/resources/chat-agent.ts +35 -26
  73. package/src/resources/chat.ts +2 -2
  74. package/src/resources/conversation-flow-component.ts +168 -48
  75. package/src/resources/conversation-flow.ts +336 -99
  76. package/src/resources/index.ts +2 -0
  77. package/src/resources/llm.ts +6 -9
  78. package/src/resources/phone-number.ts +108 -12
  79. package/src/resources/tests.ts +0 -3
  80. package/src/version.ts +1 -1
  81. package/version.d.mts +1 -1
  82. package/version.d.ts +1 -1
  83. package/version.js +1 -1
  84. package/version.mjs +1 -1
@@ -101,26 +101,12 @@ export class Agent extends APIResource {
101
101
  * );
102
102
  * ```
103
103
  */
104
- getVersions(agentID: string, options?: RequestOptions): APIPromise<AgentGetVersionsResponse> {
105
- return this._client.get(path`/get-agent-versions/${agentID}`, options);
106
- }
107
-
108
- /**
109
- * Publish the latest version of the agent and create a new draft agent with newer
110
- * version.
111
- *
112
- * @example
113
- * ```ts
114
- * await client.agent.publish(
115
- * '16b980523634a6dc504898cda492e939',
116
- * );
117
- * ```
118
- */
119
- publish(agentID: string, options?: RequestOptions): APIPromise<void> {
120
- return this._client.post(path`/publish-agent/${agentID}`, {
121
- ...options,
122
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
123
- });
104
+ getVersions(
105
+ agentID: string,
106
+ query: AgentGetVersionsParams | null | undefined = {},
107
+ options?: RequestOptions,
108
+ ): APIPromise<AgentGetVersionsResponse> {
109
+ return this._client.get(path`/get-agent-versions/${agentID}`, { query, ...options });
124
110
  }
125
111
  }
126
112
 
@@ -162,6 +148,13 @@ export interface AgentResponse {
162
148
  */
163
149
  agent_name?: string | null;
164
150
 
151
+ /**
152
+ * If set to true, DTMF input will interrupt the agent even when
153
+ * interruption_sensitivity is 0. Can be overridden per conversation or subagent
154
+ * node. Default to false.
155
+ */
156
+ allow_dtmf_interruption?: boolean;
157
+
165
158
  /**
166
159
  * If set to true, DTMF input will be accepted and processed. If false, any DTMF
167
160
  * input will be ignored. Default to true.
@@ -223,6 +216,11 @@ export interface AgentResponse {
223
216
  */
224
217
  analysis_user_sentiment_prompt?: string | null;
225
218
 
219
+ /**
220
+ * Tags assigned to this agent version. Preferred tag is listed first.
221
+ */
222
+ assigned_tags?: Array<string>;
223
+
226
224
  /**
227
225
  * Only applicable when enable_backchannel is true. Controls how often the agent
228
226
  * would backchannel when a backchannel is possible. Value ranging from [0,1].
@@ -241,6 +239,11 @@ export interface AgentResponse {
241
239
  */
242
240
  backchannel_words?: Array<string> | null;
243
241
 
242
+ /**
243
+ * Version that this draft was based on. Null for initial versions.
244
+ */
245
+ base_version?: number | null;
246
+
244
247
  /**
245
248
  * If set, will delay the first message by the specified amount of milliseconds, so
246
249
  * that it gives user more time to prepare to take the call. Valid range is [0,
@@ -256,6 +259,13 @@ export interface AgentResponse {
256
259
  */
257
260
  boosted_keywords?: Array<string> | null;
258
261
 
262
+ /**
263
+ * If this option is set, the agent prompt will include call screen handling
264
+ * instructions for identity and call purpose questions. Set this to null to
265
+ * disable call screen prompt instructions.
266
+ */
267
+ call_screening_option?: AgentResponse.CallScreeningOption | null;
268
+
259
269
  /**
260
270
  * Custom STT configuration. Only used when stt_mode is set to custom.
261
271
  */
@@ -552,7 +562,6 @@ export interface AgentResponse {
552
562
  | 'claude-4.5-sonnet'
553
563
  | 'claude-4.6-sonnet'
554
564
  | 'claude-4.5-haiku'
555
- | 'gemini-2.5-flash'
556
565
  | 'gemini-2.5-flash-lite'
557
566
  | 'gemini-3.0-flash'
558
567
  | 'gemini-3.1-flash-lite'
@@ -580,6 +589,12 @@ export interface AgentResponse {
580
589
  */
581
590
  reminder_trigger_ms?: number;
582
591
 
592
+ /**
593
+ * Hydrated response engine for this agent version. Only present when
594
+ * include_response_engine is true on /get-agent-versions.
595
+ */
596
+ response_engine_data?: unknown;
597
+
583
598
  /**
584
599
  * Controls how responsive is the agent. Value ranging from [0,1]. Lower value
585
600
  * means less responsive agent (wait more, respond slower), while higher value
@@ -779,6 +794,25 @@ export namespace AgentResponse {
779
794
  version?: number | null;
780
795
  }
781
796
 
797
+ /**
798
+ * If this option is set, the agent prompt will include call screen handling
799
+ * instructions for identity and call purpose questions. Set this to null to
800
+ * disable call screen prompt instructions.
801
+ */
802
+ export interface CallScreeningOption {
803
+ /**
804
+ * Identity the agent should provide when a call screen asks who is calling.
805
+ * Dynamic variables are supported.
806
+ */
807
+ agent_identity: string;
808
+
809
+ /**
810
+ * Purpose the agent should provide when a call screen asks why it is calling.
811
+ * Dynamic variables are supported.
812
+ */
813
+ call_purpose: string;
814
+ }
815
+
782
816
  /**
783
817
  * Custom STT configuration. Only used when stt_mode is set to custom.
784
818
  */
@@ -883,6 +917,12 @@ export namespace AgentResponse {
883
917
  */
884
918
  export interface IvrOption {
885
919
  action: IvrOption.Action;
920
+
921
+ /**
922
+ * Optionally describe what should be treated as an IVR. Leave as null to use the
923
+ * default definition.
924
+ */
925
+ detection_prompt?: string | null;
886
926
  }
887
927
 
888
928
  export namespace IvrOption {
@@ -1134,6 +1174,12 @@ export namespace AgentResponse {
1134
1174
  | VoicemailOption.VoicemailActionStaticText
1135
1175
  | VoicemailOption.VoicemailActionHangup
1136
1176
  | VoicemailOption.VoicemailActionBridgeTransfer;
1177
+
1178
+ /**
1179
+ * Optionally describe what should be treated as voicemail. Leave as null to use
1180
+ * the default definition.
1181
+ */
1182
+ detection_prompt?: string | null;
1137
1183
  }
1138
1184
 
1139
1185
  export namespace VoicemailOption {
@@ -1192,6 +1238,13 @@ export interface AgentCreateParams {
1192
1238
  */
1193
1239
  agent_name?: string | null;
1194
1240
 
1241
+ /**
1242
+ * If set to true, DTMF input will interrupt the agent even when
1243
+ * interruption_sensitivity is 0. Can be overridden per conversation or subagent
1244
+ * node. Default to false.
1245
+ */
1246
+ allow_dtmf_interruption?: boolean;
1247
+
1195
1248
  /**
1196
1249
  * If set to true, DTMF input will be accepted and processed. If false, any DTMF
1197
1250
  * input will be ignored. Default to true.
@@ -1286,6 +1339,13 @@ export interface AgentCreateParams {
1286
1339
  */
1287
1340
  boosted_keywords?: Array<string> | null;
1288
1341
 
1342
+ /**
1343
+ * If this option is set, the agent prompt will include call screen handling
1344
+ * instructions for identity and call purpose questions. Set this to null to
1345
+ * disable call screen prompt instructions.
1346
+ */
1347
+ call_screening_option?: AgentCreateParams.CallScreeningOption | null;
1348
+
1289
1349
  /**
1290
1350
  * Custom STT configuration. Only used when stt_mode is set to custom.
1291
1351
  */
@@ -1577,7 +1637,6 @@ export interface AgentCreateParams {
1577
1637
  | 'claude-4.5-sonnet'
1578
1638
  | 'claude-4.6-sonnet'
1579
1639
  | 'claude-4.5-haiku'
1580
- | 'gemini-2.5-flash'
1581
1640
  | 'gemini-2.5-flash-lite'
1582
1641
  | 'gemini-3.0-flash'
1583
1642
  | 'gemini-3.1-flash-lite'
@@ -1804,6 +1863,25 @@ export namespace AgentCreateParams {
1804
1863
  version?: number | null;
1805
1864
  }
1806
1865
 
1866
+ /**
1867
+ * If this option is set, the agent prompt will include call screen handling
1868
+ * instructions for identity and call purpose questions. Set this to null to
1869
+ * disable call screen prompt instructions.
1870
+ */
1871
+ export interface CallScreeningOption {
1872
+ /**
1873
+ * Identity the agent should provide when a call screen asks who is calling.
1874
+ * Dynamic variables are supported.
1875
+ */
1876
+ agent_identity: string;
1877
+
1878
+ /**
1879
+ * Purpose the agent should provide when a call screen asks why it is calling.
1880
+ * Dynamic variables are supported.
1881
+ */
1882
+ call_purpose: string;
1883
+ }
1884
+
1807
1885
  /**
1808
1886
  * Custom STT configuration. Only used when stt_mode is set to custom.
1809
1887
  */
@@ -1908,6 +1986,12 @@ export namespace AgentCreateParams {
1908
1986
  */
1909
1987
  export interface IvrOption {
1910
1988
  action: IvrOption.Action;
1989
+
1990
+ /**
1991
+ * Optionally describe what should be treated as an IVR. Leave as null to use the
1992
+ * default definition.
1993
+ */
1994
+ detection_prompt?: string | null;
1911
1995
  }
1912
1996
 
1913
1997
  export namespace IvrOption {
@@ -2159,6 +2243,12 @@ export namespace AgentCreateParams {
2159
2243
  | VoicemailOption.VoicemailActionStaticText
2160
2244
  | VoicemailOption.VoicemailActionHangup
2161
2245
  | VoicemailOption.VoicemailActionBridgeTransfer;
2246
+
2247
+ /**
2248
+ * Optionally describe what should be treated as voicemail. Leave as null to use
2249
+ * the default definition.
2250
+ */
2251
+ detection_prompt?: string | null;
2162
2252
  }
2163
2253
 
2164
2254
  export namespace VoicemailOption {
@@ -2211,6 +2301,13 @@ export interface AgentUpdateParams {
2211
2301
  */
2212
2302
  agent_name?: string | null;
2213
2303
 
2304
+ /**
2305
+ * Body param: If set to true, DTMF input will interrupt the agent even when
2306
+ * interruption_sensitivity is 0. Can be overridden per conversation or subagent
2307
+ * node. Default to false.
2308
+ */
2309
+ allow_dtmf_interruption?: boolean;
2310
+
2214
2311
  /**
2215
2312
  * Body param: If set to true, DTMF input will be accepted and processed. If false,
2216
2313
  * any DTMF input will be ignored. Default to true.
@@ -2305,6 +2402,13 @@ export interface AgentUpdateParams {
2305
2402
  */
2306
2403
  boosted_keywords?: Array<string> | null;
2307
2404
 
2405
+ /**
2406
+ * Body param: If this option is set, the agent prompt will include call screen
2407
+ * handling instructions for identity and call purpose questions. Set this to null
2408
+ * to disable call screen prompt instructions.
2409
+ */
2410
+ call_screening_option?: AgentUpdateParams.CallScreeningOption | null;
2411
+
2308
2412
  /**
2309
2413
  * Body param: Custom STT configuration. Only used when stt_mode is set to custom.
2310
2414
  */
@@ -2599,7 +2703,6 @@ export interface AgentUpdateParams {
2599
2703
  | 'claude-4.5-sonnet'
2600
2704
  | 'claude-4.6-sonnet'
2601
2705
  | 'claude-4.5-haiku'
2602
- | 'gemini-2.5-flash'
2603
2706
  | 'gemini-2.5-flash-lite'
2604
2707
  | 'gemini-3.0-flash'
2605
2708
  | 'gemini-3.1-flash-lite'
@@ -2803,6 +2906,25 @@ export interface AgentUpdateParams {
2803
2906
  }
2804
2907
 
2805
2908
  export namespace AgentUpdateParams {
2909
+ /**
2910
+ * If this option is set, the agent prompt will include call screen handling
2911
+ * instructions for identity and call purpose questions. Set this to null to
2912
+ * disable call screen prompt instructions.
2913
+ */
2914
+ export interface CallScreeningOption {
2915
+ /**
2916
+ * Identity the agent should provide when a call screen asks who is calling.
2917
+ * Dynamic variables are supported.
2918
+ */
2919
+ agent_identity: string;
2920
+
2921
+ /**
2922
+ * Purpose the agent should provide when a call screen asks why it is calling.
2923
+ * Dynamic variables are supported.
2924
+ */
2925
+ call_purpose: string;
2926
+ }
2927
+
2806
2928
  /**
2807
2929
  * Custom STT configuration. Only used when stt_mode is set to custom.
2808
2930
  */
@@ -2907,6 +3029,12 @@ export namespace AgentUpdateParams {
2907
3029
  */
2908
3030
  export interface IvrOption {
2909
3031
  action: IvrOption.Action;
3032
+
3033
+ /**
3034
+ * Optionally describe what should be treated as an IVR. Leave as null to use the
3035
+ * default definition.
3036
+ */
3037
+ detection_prompt?: string | null;
2910
3038
  }
2911
3039
 
2912
3040
  export namespace IvrOption {
@@ -3204,6 +3332,12 @@ export namespace AgentUpdateParams {
3204
3332
  | VoicemailOption.VoicemailActionStaticText
3205
3333
  | VoicemailOption.VoicemailActionHangup
3206
3334
  | VoicemailOption.VoicemailActionBridgeTransfer;
3335
+
3336
+ /**
3337
+ * Optionally describe what should be treated as voicemail. Leave as null to use
3338
+ * the default definition.
3339
+ */
3340
+ detection_prompt?: string | null;
3207
3341
  }
3208
3342
 
3209
3343
  export namespace VoicemailOption {
@@ -3263,6 +3397,15 @@ export interface AgentListParams {
3263
3397
  pagination_key_version?: number;
3264
3398
  }
3265
3399
 
3400
+ export interface AgentGetVersionsParams {
3401
+ /**
3402
+ * When true, each returned agent version includes a response_engine_data field
3403
+ * with the hydrated response engine (full retell-llm or conversation-flow
3404
+ * configuration) bound to that version.
3405
+ */
3406
+ include_response_engine?: boolean;
3407
+ }
3408
+
3266
3409
  export declare namespace Agent {
3267
3410
  export {
3268
3411
  type AgentResponse as AgentResponse,
@@ -3272,5 +3415,6 @@ export declare namespace Agent {
3272
3415
  type AgentRetrieveParams as AgentRetrieveParams,
3273
3416
  type AgentUpdateParams as AgentUpdateParams,
3274
3417
  type AgentListParams as AgentListParams,
3418
+ type AgentGetVersionsParams as AgentGetVersionsParams,
3275
3419
  };
3276
3420
  }
@@ -180,7 +180,7 @@ export namespace BatchCallCreateBatchCallParams {
180
180
  * For this particular call, override the agent version used with this version.
181
181
  * This does not bind the agent to this number, this is for one time override.
182
182
  */
183
- override_agent_version?: number;
183
+ override_agent_version?: number | string;
184
184
 
185
185
  /**
186
186
  * Add optional dynamic variables in key value pairs of string that injects into
@@ -232,6 +232,13 @@ export namespace BatchCallCreateBatchCallParams {
232
232
  */
233
233
  agent_name?: string | null;
234
234
 
235
+ /**
236
+ * If set to true, DTMF input will interrupt the agent even when
237
+ * interruption_sensitivity is 0. Can be overridden per conversation or subagent
238
+ * node. Default to false.
239
+ */
240
+ allow_dtmf_interruption?: boolean;
241
+
235
242
  /**
236
243
  * If set to true, DTMF input will be accepted and processed. If false, any DTMF
237
244
  * input will be ignored. Default to true.
@@ -326,6 +333,13 @@ export namespace BatchCallCreateBatchCallParams {
326
333
  */
327
334
  boosted_keywords?: Array<string> | null;
328
335
 
336
+ /**
337
+ * If this option is set, the agent prompt will include call screen handling
338
+ * instructions for identity and call purpose questions. Set this to null to
339
+ * disable call screen prompt instructions.
340
+ */
341
+ call_screening_option?: Agent.CallScreeningOption | null;
342
+
329
343
  /**
330
344
  * Custom STT configuration. Only used when stt_mode is set to custom.
331
345
  */
@@ -617,7 +631,6 @@ export namespace BatchCallCreateBatchCallParams {
617
631
  | 'claude-4.5-sonnet'
618
632
  | 'claude-4.6-sonnet'
619
633
  | 'claude-4.5-haiku'
620
- | 'gemini-2.5-flash'
621
634
  | 'gemini-2.5-flash-lite'
622
635
  | 'gemini-3.0-flash'
623
636
  | 'gemini-3.1-flash-lite'
@@ -814,6 +827,25 @@ export namespace BatchCallCreateBatchCallParams {
814
827
  }
815
828
 
816
829
  export namespace Agent {
830
+ /**
831
+ * If this option is set, the agent prompt will include call screen handling
832
+ * instructions for identity and call purpose questions. Set this to null to
833
+ * disable call screen prompt instructions.
834
+ */
835
+ export interface CallScreeningOption {
836
+ /**
837
+ * Identity the agent should provide when a call screen asks who is calling.
838
+ * Dynamic variables are supported.
839
+ */
840
+ agent_identity: string;
841
+
842
+ /**
843
+ * Purpose the agent should provide when a call screen asks why it is calling.
844
+ * Dynamic variables are supported.
845
+ */
846
+ call_purpose: string;
847
+ }
848
+
817
849
  /**
818
850
  * Custom STT configuration. Only used when stt_mode is set to custom.
819
851
  */
@@ -918,6 +950,12 @@ export namespace BatchCallCreateBatchCallParams {
918
950
  */
919
951
  export interface IvrOption {
920
952
  action: IvrOption.Action;
953
+
954
+ /**
955
+ * Optionally describe what should be treated as an IVR. Leave as null to use the
956
+ * default definition.
957
+ */
958
+ detection_prompt?: string | null;
921
959
  }
922
960
 
923
961
  export namespace IvrOption {
@@ -1215,6 +1253,12 @@ export namespace BatchCallCreateBatchCallParams {
1215
1253
  | VoicemailOption.VoicemailActionStaticText
1216
1254
  | VoicemailOption.VoicemailActionHangup
1217
1255
  | VoicemailOption.VoicemailActionBridgeTransfer;
1256
+
1257
+ /**
1258
+ * Optionally describe what should be treated as voicemail. Leave as null to use
1259
+ * the default definition.
1260
+ */
1261
+ detection_prompt?: string | null;
1218
1262
  }
1219
1263
 
1220
1264
  export namespace VoicemailOption {
@@ -1334,7 +1378,6 @@ export namespace BatchCallCreateBatchCallParams {
1334
1378
  | 'claude-4.5-sonnet'
1335
1379
  | 'claude-4.6-sonnet'
1336
1380
  | 'claude-4.5-haiku'
1337
- | 'gemini-2.5-flash'
1338
1381
  | 'gemini-2.5-flash-lite'
1339
1382
  | 'gemini-3.0-flash'
1340
1383
  | 'gemini-3.1-flash-lite';
@@ -1402,7 +1445,6 @@ export namespace BatchCallCreateBatchCallParams {
1402
1445
  | 'claude-4.5-sonnet'
1403
1446
  | 'claude-4.6-sonnet'
1404
1447
  | 'claude-4.5-haiku'
1405
- | 'gemini-2.5-flash'
1406
1448
  | 'gemini-2.5-flash-lite'
1407
1449
  | 'gemini-3.0-flash'
1408
1450
  | 'gemini-3.1-flash-lite'