retell-sdk 5.18.0 → 5.20.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 (77) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/internal/types.d.mts +6 -6
  3. package/internal/types.d.mts.map +1 -1
  4. package/internal/types.d.ts +6 -6
  5. package/internal/types.d.ts.map +1 -1
  6. package/internal/utils/log.d.mts.map +1 -1
  7. package/internal/utils/log.d.ts.map +1 -1
  8. package/internal/utils/log.js +2 -0
  9. package/internal/utils/log.js.map +1 -1
  10. package/internal/utils/log.mjs +2 -0
  11. package/internal/utils/log.mjs.map +1 -1
  12. package/package.json +1 -1
  13. package/resources/agent.d.mts +128 -15
  14. package/resources/agent.d.mts.map +1 -1
  15. package/resources/agent.d.ts +128 -15
  16. package/resources/agent.d.ts.map +1 -1
  17. package/resources/agent.js +0 -17
  18. package/resources/agent.js.map +1 -1
  19. package/resources/agent.mjs +0 -17
  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 +14 -18
  30. package/resources/chat-agent.d.mts.map +1 -1
  31. package/resources/chat-agent.d.ts +14 -18
  32. package/resources/chat-agent.d.ts.map +1 -1
  33. package/resources/chat-agent.js +0 -17
  34. package/resources/chat-agent.js.map +1 -1
  35. package/resources/chat-agent.mjs +0 -17
  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/llm.d.mts +9 -9
  50. package/resources/llm.d.mts.map +1 -1
  51. package/resources/llm.d.ts +9 -9
  52. package/resources/llm.d.ts.map +1 -1
  53. package/resources/phone-number.d.mts +108 -12
  54. package/resources/phone-number.d.mts.map +1 -1
  55. package/resources/phone-number.d.ts +108 -12
  56. package/resources/phone-number.d.ts.map +1 -1
  57. package/resources/tests.d.mts +3 -3
  58. package/resources/tests.d.mts.map +1 -1
  59. package/resources/tests.d.ts +3 -3
  60. package/resources/tests.d.ts.map +1 -1
  61. package/src/internal/types.ts +6 -8
  62. package/src/internal/utils/log.ts +2 -0
  63. package/src/resources/agent.ts +145 -21
  64. package/src/resources/batch-call.ts +46 -4
  65. package/src/resources/call.ts +138 -12
  66. package/src/resources/chat-agent.ts +13 -24
  67. package/src/resources/chat.ts +2 -2
  68. package/src/resources/conversation-flow-component.ts +168 -48
  69. package/src/resources/conversation-flow.ts +336 -99
  70. package/src/resources/llm.ts +6 -9
  71. package/src/resources/phone-number.ts +108 -12
  72. package/src/resources/tests.ts +0 -3
  73. package/src/version.ts +1 -1
  74. package/version.d.mts +1 -1
  75. package/version.d.ts +1 -1
  76. package/version.js +1 -1
  77. package/version.mjs +1 -1
@@ -104,24 +104,6 @@ export class Agent extends APIResource {
104
104
  getVersions(agentID: string, options?: RequestOptions): APIPromise<AgentGetVersionsResponse> {
105
105
  return this._client.get(path`/get-agent-versions/${agentID}`, options);
106
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
- });
124
- }
125
107
  }
126
108
 
127
109
  export interface AgentResponse {
@@ -162,6 +144,13 @@ export interface AgentResponse {
162
144
  */
163
145
  agent_name?: string | null;
164
146
 
147
+ /**
148
+ * If set to true, DTMF input will interrupt the agent even when
149
+ * interruption_sensitivity is 0. Can be overridden per conversation or subagent
150
+ * node. Default to false.
151
+ */
152
+ allow_dtmf_interruption?: boolean;
153
+
165
154
  /**
166
155
  * If set to true, DTMF input will be accepted and processed. If false, any DTMF
167
156
  * input will be ignored. Default to true.
@@ -223,6 +212,11 @@ export interface AgentResponse {
223
212
  */
224
213
  analysis_user_sentiment_prompt?: string | null;
225
214
 
215
+ /**
216
+ * Tags assigned to this agent version. Preferred tag is listed first.
217
+ */
218
+ assigned_tags?: Array<string>;
219
+
226
220
  /**
227
221
  * Only applicable when enable_backchannel is true. Controls how often the agent
228
222
  * would backchannel when a backchannel is possible. Value ranging from [0,1].
@@ -241,6 +235,11 @@ export interface AgentResponse {
241
235
  */
242
236
  backchannel_words?: Array<string> | null;
243
237
 
238
+ /**
239
+ * Version that this draft was based on. Null for initial versions.
240
+ */
241
+ base_version?: number | null;
242
+
244
243
  /**
245
244
  * If set, will delay the first message by the specified amount of milliseconds, so
246
245
  * that it gives user more time to prepare to take the call. Valid range is [0,
@@ -256,6 +255,13 @@ export interface AgentResponse {
256
255
  */
257
256
  boosted_keywords?: Array<string> | null;
258
257
 
258
+ /**
259
+ * If this option is set, the agent prompt will include call screen handling
260
+ * instructions for identity and call purpose questions. Set this to null to
261
+ * disable call screen prompt instructions.
262
+ */
263
+ call_screening_option?: AgentResponse.CallScreeningOption | null;
264
+
259
265
  /**
260
266
  * Custom STT configuration. Only used when stt_mode is set to custom.
261
267
  */
@@ -552,7 +558,6 @@ export interface AgentResponse {
552
558
  | 'claude-4.5-sonnet'
553
559
  | 'claude-4.6-sonnet'
554
560
  | 'claude-4.5-haiku'
555
- | 'gemini-2.5-flash'
556
561
  | 'gemini-2.5-flash-lite'
557
562
  | 'gemini-3.0-flash'
558
563
  | 'gemini-3.1-flash-lite'
@@ -779,6 +784,25 @@ export namespace AgentResponse {
779
784
  version?: number | null;
780
785
  }
781
786
 
787
+ /**
788
+ * If this option is set, the agent prompt will include call screen handling
789
+ * instructions for identity and call purpose questions. Set this to null to
790
+ * disable call screen prompt instructions.
791
+ */
792
+ export interface CallScreeningOption {
793
+ /**
794
+ * Identity the agent should provide when a call screen asks who is calling.
795
+ * Dynamic variables are supported.
796
+ */
797
+ agent_identity: string;
798
+
799
+ /**
800
+ * Purpose the agent should provide when a call screen asks why it is calling.
801
+ * Dynamic variables are supported.
802
+ */
803
+ call_purpose: string;
804
+ }
805
+
782
806
  /**
783
807
  * Custom STT configuration. Only used when stt_mode is set to custom.
784
808
  */
@@ -883,6 +907,12 @@ export namespace AgentResponse {
883
907
  */
884
908
  export interface IvrOption {
885
909
  action: IvrOption.Action;
910
+
911
+ /**
912
+ * Optionally describe what should be treated as an IVR. Leave as null to use the
913
+ * default definition.
914
+ */
915
+ detection_prompt?: string | null;
886
916
  }
887
917
 
888
918
  export namespace IvrOption {
@@ -1134,6 +1164,12 @@ export namespace AgentResponse {
1134
1164
  | VoicemailOption.VoicemailActionStaticText
1135
1165
  | VoicemailOption.VoicemailActionHangup
1136
1166
  | VoicemailOption.VoicemailActionBridgeTransfer;
1167
+
1168
+ /**
1169
+ * Optionally describe what should be treated as voicemail. Leave as null to use
1170
+ * the default definition.
1171
+ */
1172
+ detection_prompt?: string | null;
1137
1173
  }
1138
1174
 
1139
1175
  export namespace VoicemailOption {
@@ -1192,6 +1228,13 @@ export interface AgentCreateParams {
1192
1228
  */
1193
1229
  agent_name?: string | null;
1194
1230
 
1231
+ /**
1232
+ * If set to true, DTMF input will interrupt the agent even when
1233
+ * interruption_sensitivity is 0. Can be overridden per conversation or subagent
1234
+ * node. Default to false.
1235
+ */
1236
+ allow_dtmf_interruption?: boolean;
1237
+
1195
1238
  /**
1196
1239
  * If set to true, DTMF input will be accepted and processed. If false, any DTMF
1197
1240
  * input will be ignored. Default to true.
@@ -1286,6 +1329,13 @@ export interface AgentCreateParams {
1286
1329
  */
1287
1330
  boosted_keywords?: Array<string> | null;
1288
1331
 
1332
+ /**
1333
+ * If this option is set, the agent prompt will include call screen handling
1334
+ * instructions for identity and call purpose questions. Set this to null to
1335
+ * disable call screen prompt instructions.
1336
+ */
1337
+ call_screening_option?: AgentCreateParams.CallScreeningOption | null;
1338
+
1289
1339
  /**
1290
1340
  * Custom STT configuration. Only used when stt_mode is set to custom.
1291
1341
  */
@@ -1577,7 +1627,6 @@ export interface AgentCreateParams {
1577
1627
  | 'claude-4.5-sonnet'
1578
1628
  | 'claude-4.6-sonnet'
1579
1629
  | 'claude-4.5-haiku'
1580
- | 'gemini-2.5-flash'
1581
1630
  | 'gemini-2.5-flash-lite'
1582
1631
  | 'gemini-3.0-flash'
1583
1632
  | 'gemini-3.1-flash-lite'
@@ -1804,6 +1853,25 @@ export namespace AgentCreateParams {
1804
1853
  version?: number | null;
1805
1854
  }
1806
1855
 
1856
+ /**
1857
+ * If this option is set, the agent prompt will include call screen handling
1858
+ * instructions for identity and call purpose questions. Set this to null to
1859
+ * disable call screen prompt instructions.
1860
+ */
1861
+ export interface CallScreeningOption {
1862
+ /**
1863
+ * Identity the agent should provide when a call screen asks who is calling.
1864
+ * Dynamic variables are supported.
1865
+ */
1866
+ agent_identity: string;
1867
+
1868
+ /**
1869
+ * Purpose the agent should provide when a call screen asks why it is calling.
1870
+ * Dynamic variables are supported.
1871
+ */
1872
+ call_purpose: string;
1873
+ }
1874
+
1807
1875
  /**
1808
1876
  * Custom STT configuration. Only used when stt_mode is set to custom.
1809
1877
  */
@@ -1908,6 +1976,12 @@ export namespace AgentCreateParams {
1908
1976
  */
1909
1977
  export interface IvrOption {
1910
1978
  action: IvrOption.Action;
1979
+
1980
+ /**
1981
+ * Optionally describe what should be treated as an IVR. Leave as null to use the
1982
+ * default definition.
1983
+ */
1984
+ detection_prompt?: string | null;
1911
1985
  }
1912
1986
 
1913
1987
  export namespace IvrOption {
@@ -2159,6 +2233,12 @@ export namespace AgentCreateParams {
2159
2233
  | VoicemailOption.VoicemailActionStaticText
2160
2234
  | VoicemailOption.VoicemailActionHangup
2161
2235
  | VoicemailOption.VoicemailActionBridgeTransfer;
2236
+
2237
+ /**
2238
+ * Optionally describe what should be treated as voicemail. Leave as null to use
2239
+ * the default definition.
2240
+ */
2241
+ detection_prompt?: string | null;
2162
2242
  }
2163
2243
 
2164
2244
  export namespace VoicemailOption {
@@ -2211,6 +2291,13 @@ export interface AgentUpdateParams {
2211
2291
  */
2212
2292
  agent_name?: string | null;
2213
2293
 
2294
+ /**
2295
+ * Body param: If set to true, DTMF input will interrupt the agent even when
2296
+ * interruption_sensitivity is 0. Can be overridden per conversation or subagent
2297
+ * node. Default to false.
2298
+ */
2299
+ allow_dtmf_interruption?: boolean;
2300
+
2214
2301
  /**
2215
2302
  * Body param: If set to true, DTMF input will be accepted and processed. If false,
2216
2303
  * any DTMF input will be ignored. Default to true.
@@ -2305,6 +2392,13 @@ export interface AgentUpdateParams {
2305
2392
  */
2306
2393
  boosted_keywords?: Array<string> | null;
2307
2394
 
2395
+ /**
2396
+ * Body param: If this option is set, the agent prompt will include call screen
2397
+ * handling instructions for identity and call purpose questions. Set this to null
2398
+ * to disable call screen prompt instructions.
2399
+ */
2400
+ call_screening_option?: AgentUpdateParams.CallScreeningOption | null;
2401
+
2308
2402
  /**
2309
2403
  * Body param: Custom STT configuration. Only used when stt_mode is set to custom.
2310
2404
  */
@@ -2599,7 +2693,6 @@ export interface AgentUpdateParams {
2599
2693
  | 'claude-4.5-sonnet'
2600
2694
  | 'claude-4.6-sonnet'
2601
2695
  | 'claude-4.5-haiku'
2602
- | 'gemini-2.5-flash'
2603
2696
  | 'gemini-2.5-flash-lite'
2604
2697
  | 'gemini-3.0-flash'
2605
2698
  | 'gemini-3.1-flash-lite'
@@ -2803,6 +2896,25 @@ export interface AgentUpdateParams {
2803
2896
  }
2804
2897
 
2805
2898
  export namespace AgentUpdateParams {
2899
+ /**
2900
+ * If this option is set, the agent prompt will include call screen handling
2901
+ * instructions for identity and call purpose questions. Set this to null to
2902
+ * disable call screen prompt instructions.
2903
+ */
2904
+ export interface CallScreeningOption {
2905
+ /**
2906
+ * Identity the agent should provide when a call screen asks who is calling.
2907
+ * Dynamic variables are supported.
2908
+ */
2909
+ agent_identity: string;
2910
+
2911
+ /**
2912
+ * Purpose the agent should provide when a call screen asks why it is calling.
2913
+ * Dynamic variables are supported.
2914
+ */
2915
+ call_purpose: string;
2916
+ }
2917
+
2806
2918
  /**
2807
2919
  * Custom STT configuration. Only used when stt_mode is set to custom.
2808
2920
  */
@@ -2907,6 +3019,12 @@ export namespace AgentUpdateParams {
2907
3019
  */
2908
3020
  export interface IvrOption {
2909
3021
  action: IvrOption.Action;
3022
+
3023
+ /**
3024
+ * Optionally describe what should be treated as an IVR. Leave as null to use the
3025
+ * default definition.
3026
+ */
3027
+ detection_prompt?: string | null;
2910
3028
  }
2911
3029
 
2912
3030
  export namespace IvrOption {
@@ -3204,6 +3322,12 @@ export namespace AgentUpdateParams {
3204
3322
  | VoicemailOption.VoicemailActionStaticText
3205
3323
  | VoicemailOption.VoicemailActionHangup
3206
3324
  | VoicemailOption.VoicemailActionBridgeTransfer;
3325
+
3326
+ /**
3327
+ * Optionally describe what should be treated as voicemail. Leave as null to use
3328
+ * the default definition.
3329
+ */
3330
+ detection_prompt?: string | null;
3207
3331
  }
3208
3332
 
3209
3333
  export namespace VoicemailOption {
@@ -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'