retell-sdk 4.30.0 → 4.32.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.
package/src/index.ts CHANGED
@@ -27,6 +27,14 @@ import {
27
27
  PhoneCallResponse,
28
28
  WebCallResponse,
29
29
  } from './resources/call';
30
+ import {
31
+ Chat,
32
+ ChatCreateChatCompletionParams,
33
+ ChatCreateChatCompletionResponse,
34
+ ChatCreateParams,
35
+ ChatListResponse,
36
+ ChatResponse,
37
+ } from './resources/chat';
30
38
  import { Concurrency, ConcurrencyRetrieveResponse } from './resources/concurrency';
31
39
  import {
32
40
  KnowledgeBase,
@@ -161,6 +169,7 @@ export class Retell extends Core.APIClient {
161
169
  }
162
170
 
163
171
  call: API.Call = new API.Call(this);
172
+ chat: API.Chat = new API.Chat(this);
164
173
  phoneNumber: API.PhoneNumber = new API.PhoneNumber(this);
165
174
  agent: API.Agent = new API.Agent(this);
166
175
  llm: API.Llm = new API.Llm(this);
@@ -209,6 +218,7 @@ export class Retell extends Core.APIClient {
209
218
  }
210
219
 
211
220
  Retell.Call = Call;
221
+ Retell.Chat = Chat;
212
222
  Retell.PhoneNumber = PhoneNumber;
213
223
  Retell.Agent = AgentAPIAgent;
214
224
  Retell.Llm = Llm;
@@ -232,6 +242,15 @@ export declare namespace Retell {
232
242
  type CallRegisterPhoneCallParams as CallRegisterPhoneCallParams,
233
243
  };
234
244
 
245
+ export {
246
+ Chat as Chat,
247
+ type ChatResponse as ChatResponse,
248
+ type ChatListResponse as ChatListResponse,
249
+ type ChatCreateChatCompletionResponse as ChatCreateChatCompletionResponse,
250
+ type ChatCreateParams as ChatCreateParams,
251
+ type ChatCreateChatCompletionParams as ChatCreateChatCompletionParams,
252
+ };
253
+
235
254
  export {
236
255
  PhoneNumber as PhoneNumber,
237
256
  type PhoneNumberResponse as PhoneNumberResponse,
@@ -427,6 +427,13 @@ export interface AgentResponse {
427
427
  */
428
428
  version?: unknown;
429
429
 
430
+ /**
431
+ * If set, determines the vocabulary set to use for transcription. This setting
432
+ * only applies for English agents, for non English agent, this setting is a no-op.
433
+ * Default to general.
434
+ */
435
+ vocab_specialization?: 'general' | 'medical';
436
+
430
437
  /**
431
438
  * Optionally set the voice model used for the selected voice. Currently only
432
439
  * elevenlab voices have voice model selections. Set to null to remove voice model
@@ -950,6 +957,13 @@ export interface AgentCreateParams {
950
957
  */
951
958
  version?: number | null;
952
959
 
960
+ /**
961
+ * If set, determines the vocabulary set to use for transcription. This setting
962
+ * only applies for English agents, for non English agent, this setting is a no-op.
963
+ * Default to general.
964
+ */
965
+ vocab_specialization?: 'general' | 'medical';
966
+
953
967
  /**
954
968
  * Optionally set the voice model used for the selected voice. Currently only
955
969
  * elevenlab voices have voice model selections. Set to null to remove voice model
@@ -1484,6 +1498,13 @@ export interface AgentUpdateParams {
1484
1498
  */
1485
1499
  body_version?: number | null;
1486
1500
 
1501
+ /**
1502
+ * Body param: If set, determines the vocabulary set to use for transcription. This
1503
+ * setting only applies for English agents, for non English agent, this setting is
1504
+ * a no-op. Default to general.
1505
+ */
1506
+ vocab_specialization?: 'general' | 'medical';
1507
+
1487
1508
  /**
1488
1509
  * Body param: Unique voice id used for the agent. Find list of available voices
1489
1510
  * and their preview in Dashboard.
@@ -188,6 +188,11 @@ export interface PhoneCallResponse {
188
188
  */
189
189
  call_cost?: PhoneCallResponse.CallCost;
190
190
 
191
+ /**
192
+ * Dynamic variables collected from the call. Only available after the call ends.
193
+ */
194
+ collected_dynamic_variables?: Record<string, unknown>;
195
+
191
196
  /**
192
197
  * The reason for the disconnection of the call. Read details desciption about
193
198
  * reasons listed here at
@@ -235,6 +240,12 @@ export interface PhoneCallResponse {
235
240
  */
236
241
  latency?: PhoneCallResponse.Latency;
237
242
 
243
+ /**
244
+ * LLM token usage of the call, available after call ends. Not populated if using
245
+ * custom LLM, realtime API, or no LLM call is made.
246
+ */
247
+ llm_token_usage?: PhoneCallResponse.LlmTokenUsage;
248
+
238
249
  /**
239
250
  * An arbitrary object for storage purpose only. You can put anything here like
240
251
  * your internal customer id associated with the call. Not used for processing. You
@@ -729,6 +740,27 @@ export namespace PhoneCallResponse {
729
740
  }
730
741
  }
731
742
 
743
+ /**
744
+ * LLM token usage of the call, available after call ends. Not populated if using
745
+ * custom LLM, realtime API, or no LLM call is made.
746
+ */
747
+ export interface LlmTokenUsage {
748
+ /**
749
+ * Average token count of the call.
750
+ */
751
+ average: number;
752
+
753
+ /**
754
+ * Number of requests made to the LLM.
755
+ */
756
+ num_requests: number;
757
+
758
+ /**
759
+ * All the token count values in the call.
760
+ */
761
+ values: Array<number>;
762
+ }
763
+
732
764
  /**
733
765
  * Telephony identifier of the call, populated when available. Tracking purposes
734
766
  * only.
@@ -922,6 +954,11 @@ export interface WebCallResponse {
922
954
  */
923
955
  call_cost?: WebCallResponse.CallCost;
924
956
 
957
+ /**
958
+ * Dynamic variables collected from the call. Only available after the call ends.
959
+ */
960
+ collected_dynamic_variables?: Record<string, unknown>;
961
+
925
962
  /**
926
963
  * The reason for the disconnection of the call. Read details desciption about
927
964
  * reasons listed here at
@@ -969,6 +1006,12 @@ export interface WebCallResponse {
969
1006
  */
970
1007
  latency?: WebCallResponse.Latency;
971
1008
 
1009
+ /**
1010
+ * LLM token usage of the call, available after call ends. Not populated if using
1011
+ * custom LLM, realtime API, or no LLM call is made.
1012
+ */
1013
+ llm_token_usage?: WebCallResponse.LlmTokenUsage;
1014
+
972
1015
  /**
973
1016
  * An arbitrary object for storage purpose only. You can put anything here like
974
1017
  * your internal customer id associated with the call. Not used for processing. You
@@ -1457,6 +1500,27 @@ export namespace WebCallResponse {
1457
1500
  }
1458
1501
  }
1459
1502
 
1503
+ /**
1504
+ * LLM token usage of the call, available after call ends. Not populated if using
1505
+ * custom LLM, realtime API, or no LLM call is made.
1506
+ */
1507
+ export interface LlmTokenUsage {
1508
+ /**
1509
+ * Average token count of the call.
1510
+ */
1511
+ average: number;
1512
+
1513
+ /**
1514
+ * Number of requests made to the LLM.
1515
+ */
1516
+ num_requests: number;
1517
+
1518
+ /**
1519
+ * All the token count values in the call.
1520
+ */
1521
+ values: Array<number>;
1522
+ }
1523
+
1460
1524
  export interface TranscriptObject {
1461
1525
  /**
1462
1526
  * Transcript of the utterances.