retell-sdk 3.19.0 → 3.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.
- package/CHANGELOG.md +10 -0
- package/index.d.mts +1 -2
- package/index.d.ts +1 -2
- package/index.d.ts.map +1 -1
- package/index.js +0 -4
- package/index.js.map +1 -1
- package/index.mjs +0 -4
- package/index.mjs.map +1 -1
- package/package.json +1 -3
- package/resources/call.d.ts +630 -58
- package/resources/call.d.ts.map +1 -1
- package/resources/call.js +5 -6
- package/resources/call.js.map +1 -1
- package/resources/call.mjs +5 -6
- package/resources/call.mjs.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/src/index.ts +1 -6
- package/src/resources/call.ts +795 -75
- package/src/resources/index.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/call.d.ts
CHANGED
|
@@ -9,8 +9,7 @@ export declare class Call extends APIResource {
|
|
|
9
9
|
/**
|
|
10
10
|
* Retrieve call details
|
|
11
11
|
*/
|
|
12
|
-
list(
|
|
13
|
-
list(options?: Core.RequestOptions): Core.APIPromise<CallListResponse>;
|
|
12
|
+
list(body: CallListParams, options?: Core.RequestOptions): Core.APIPromise<CallListResponse>;
|
|
14
13
|
/**
|
|
15
14
|
* Create a new outbound phone call
|
|
16
15
|
*/
|
|
@@ -18,60 +17,9 @@ export declare class Call extends APIResource {
|
|
|
18
17
|
/**
|
|
19
18
|
* Create a new web call
|
|
20
19
|
*/
|
|
21
|
-
createWebCall(body: CallCreateWebCallParams, options?: Core.RequestOptions): Core.APIPromise<
|
|
22
|
-
}
|
|
23
|
-
export type CallResponse = CallResponse.V2WebCallResponse | PhoneCallResponse;
|
|
24
|
-
export declare namespace CallResponse {
|
|
25
|
-
interface V2WebCallResponse {
|
|
26
|
-
/**
|
|
27
|
-
* Access token to enter the web call room. This needs to be passed to your
|
|
28
|
-
* frontend to join the call.
|
|
29
|
-
*/
|
|
30
|
-
access_token: string;
|
|
31
|
-
/**
|
|
32
|
-
* Corresponding agent id of this call.
|
|
33
|
-
*/
|
|
34
|
-
agent_id: string;
|
|
35
|
-
/**
|
|
36
|
-
* Unique id of the call. Used to identify in LLM websocket and used to
|
|
37
|
-
* authenticate in audio websocket.
|
|
38
|
-
*/
|
|
39
|
-
call_id: string;
|
|
40
|
-
/**
|
|
41
|
-
* Status of call.
|
|
42
|
-
*
|
|
43
|
-
* - `registered`: Call id issued, starting to make a call using this id.
|
|
44
|
-
*
|
|
45
|
-
* - `ongoing`: Call connected and ongoing.
|
|
46
|
-
*
|
|
47
|
-
* - `ended`: The underlying websocket has ended for the call. Either user or agent
|
|
48
|
-
* hanged up, or call transferred.
|
|
49
|
-
*
|
|
50
|
-
* - `error`: Call encountered error.
|
|
51
|
-
*/
|
|
52
|
-
call_status: 'registered' | 'ongoing' | 'ended' | 'error';
|
|
53
|
-
/**
|
|
54
|
-
* Type of the call. Used to distinguish between web call and phone call.
|
|
55
|
-
*/
|
|
56
|
-
call_type: 'web_call';
|
|
57
|
-
/**
|
|
58
|
-
* An arbitrary object for storage purpose only. You can put anything here like
|
|
59
|
-
* your internal customer id associated with the call. Not used for processing. You
|
|
60
|
-
* can later get this field from the call object.
|
|
61
|
-
*/
|
|
62
|
-
metadata?: unknown;
|
|
63
|
-
/**
|
|
64
|
-
* Whether this call opts out of sensitive data storage like transcript, recording,
|
|
65
|
-
* logging.
|
|
66
|
-
*/
|
|
67
|
-
opt_out_sensitive_data_storage?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Add optional dynamic variables in key value pairs of string that injects into
|
|
70
|
-
* your Retell LLM prompt and tool description. Only applicable for Retell LLM.
|
|
71
|
-
*/
|
|
72
|
-
retell_llm_dynamic_variables?: Record<string, unknown>;
|
|
73
|
-
}
|
|
20
|
+
createWebCall(body: CallCreateWebCallParams, options?: Core.RequestOptions): Core.APIPromise<WebCallResponse>;
|
|
74
21
|
}
|
|
22
|
+
export type CallResponse = WebCallResponse | PhoneCallResponse;
|
|
75
23
|
export interface PhoneCallResponse {
|
|
76
24
|
/**
|
|
77
25
|
* Corresponding agent id of this call.
|
|
@@ -111,6 +59,43 @@ export interface PhoneCallResponse {
|
|
|
111
59
|
* The callee number.
|
|
112
60
|
*/
|
|
113
61
|
to_number: string;
|
|
62
|
+
/**
|
|
63
|
+
* - BETA feature, schema might change, might not always be populated. Please do
|
|
64
|
+
* not rely on this object schema for post processing. Post conversation
|
|
65
|
+
* evaluation of the call. Including information such as sentiment, intent, call
|
|
66
|
+
* completion status and other metrics. Available after call ends. Subscribe to
|
|
67
|
+
* `call_analyzed` webhook event type to receive it once ready.
|
|
68
|
+
*/
|
|
69
|
+
call_analysis?: PhoneCallResponse.CallAnalysis;
|
|
70
|
+
/**
|
|
71
|
+
* The reason for the disconnection of the call. Read details desciption about
|
|
72
|
+
* reasons listed here at
|
|
73
|
+
* [Disconnection Reason Doc](/get-started/debug-guide#disconnection-reason).
|
|
74
|
+
*/
|
|
75
|
+
disconnection_reason?: 'user_hangup' | 'agent_hangup' | 'call_transfer' | 'inactivity' | 'machine_detected' | 'concurrency_limit_reached' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_frontend_corrupted_payload' | 'error_twilio' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown';
|
|
76
|
+
/**
|
|
77
|
+
* End to end latency (from user stops talking to agent start talking) tracking of
|
|
78
|
+
* the call, available after call ends. This latency does not account for the
|
|
79
|
+
* network trip time from Retell server to user frontend. The latency is tracked
|
|
80
|
+
* every time turn change between user and agent.
|
|
81
|
+
*/
|
|
82
|
+
e2e_latency?: PhoneCallResponse.E2ELatency;
|
|
83
|
+
/**
|
|
84
|
+
* End timestamp (milliseconds since epoch) of the call. Available after call ends.
|
|
85
|
+
*/
|
|
86
|
+
end_timestamp?: number;
|
|
87
|
+
/**
|
|
88
|
+
* LLM latency (from issue of LLM call to first token received) tracking of the
|
|
89
|
+
* call, available after call ends. When using custom LLM. this latency includes
|
|
90
|
+
* LLM websocket roundtrip time between user server and Retell server.
|
|
91
|
+
*/
|
|
92
|
+
llm_latency?: PhoneCallResponse.LlmLatency;
|
|
93
|
+
/**
|
|
94
|
+
* LLM websocket roundtrip latency (between user server and Retell server) tracking
|
|
95
|
+
* of the call, available after call ends. Only populated for calls using custom
|
|
96
|
+
* LLM.
|
|
97
|
+
*/
|
|
98
|
+
llm_websocket_network_rtt_latency?: PhoneCallResponse.LlmWebsocketNetworkRttLatency;
|
|
114
99
|
/**
|
|
115
100
|
* An arbitrary object for storage purpose only. You can put anything here like
|
|
116
101
|
* your internal customer id associated with the call. Not used for processing. You
|
|
@@ -122,14 +107,288 @@ export interface PhoneCallResponse {
|
|
|
122
107
|
* logging.
|
|
123
108
|
*/
|
|
124
109
|
opt_out_sensitive_data_storage?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Public log of the call, containing details about all the requests and responses
|
|
112
|
+
* received in LLM WebSocket, latency tracking for each turntaking, helpful for
|
|
113
|
+
* debugging and tracing. Available after call ends.
|
|
114
|
+
*/
|
|
115
|
+
public_log_url?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Recording of the call. Available after call ends.
|
|
118
|
+
*/
|
|
119
|
+
recording_url?: string;
|
|
125
120
|
/**
|
|
126
121
|
* Add optional dynamic variables in key value pairs of string that injects into
|
|
127
122
|
* your Retell LLM prompt and tool description. Only applicable for Retell LLM.
|
|
128
123
|
*/
|
|
129
124
|
retell_llm_dynamic_variables?: Record<string, unknown>;
|
|
125
|
+
/**
|
|
126
|
+
* Begin timestamp (milliseconds since epoch) of the call. Available after call
|
|
127
|
+
* starts.
|
|
128
|
+
*/
|
|
129
|
+
start_timestamp?: number;
|
|
130
|
+
/**
|
|
131
|
+
* Transcription of the call. Available after call ends.
|
|
132
|
+
*/
|
|
133
|
+
transcript?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Transcript of the call in the format of a list of utterance, with timestamp.
|
|
136
|
+
* Available after call ends.
|
|
137
|
+
*/
|
|
138
|
+
transcript_object?: Array<PhoneCallResponse.TranscriptObject>;
|
|
139
|
+
/**
|
|
140
|
+
* Transcript of the call weaved with tool call invocation and results. It
|
|
141
|
+
* precisely captures when (at what utterance, which word) the tool was invoked and
|
|
142
|
+
* what was the result. Available after call ends.
|
|
143
|
+
*/
|
|
144
|
+
transcript_with_tool_calls?: Array<PhoneCallResponse.Utterance | PhoneCallResponse.ToolCallInvocationUtterance | PhoneCallResponse.ToolCallResultUtterance>;
|
|
130
145
|
}
|
|
131
|
-
export
|
|
132
|
-
|
|
146
|
+
export declare namespace PhoneCallResponse {
|
|
147
|
+
/**
|
|
148
|
+
* - BETA feature, schema might change, might not always be populated. Please do
|
|
149
|
+
* not rely on this object schema for post processing. Post conversation
|
|
150
|
+
* evaluation of the call. Including information such as sentiment, intent, call
|
|
151
|
+
* completion status and other metrics. Available after call ends. Subscribe to
|
|
152
|
+
* `call_analyzed` webhook event type to receive it once ready.
|
|
153
|
+
*/
|
|
154
|
+
interface CallAnalysis {
|
|
155
|
+
/**
|
|
156
|
+
* Sentiment of the agent in the call.
|
|
157
|
+
*/
|
|
158
|
+
agent_sentiment?: 'Negative' | 'Positive' | 'Neutral';
|
|
159
|
+
/**
|
|
160
|
+
* Evaluate agent task completion status, whether the agent has completed his task.
|
|
161
|
+
*/
|
|
162
|
+
agent_task_completion_rating?: 'Complete' | 'Incomplete' | 'Partial';
|
|
163
|
+
/**
|
|
164
|
+
* Reason for the agent task completion status.
|
|
165
|
+
*/
|
|
166
|
+
agent_task_completion_rating_reason?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Evaluate whether the call ended normally or was cut off.
|
|
169
|
+
*/
|
|
170
|
+
call_completion_rating?: 'Complete' | 'Incomplete' | 'Partial';
|
|
171
|
+
/**
|
|
172
|
+
* Reason for the call completion status.
|
|
173
|
+
*/
|
|
174
|
+
call_completion_rating_reason?: string;
|
|
175
|
+
/**
|
|
176
|
+
* A high level summary of the call.
|
|
177
|
+
*/
|
|
178
|
+
call_summary?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Sentiment of the user in the call.
|
|
181
|
+
*/
|
|
182
|
+
user_sentiment?: 'Negative' | 'Positive' | 'Neutral';
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* End to end latency (from user stops talking to agent start talking) tracking of
|
|
186
|
+
* the call, available after call ends. This latency does not account for the
|
|
187
|
+
* network trip time from Retell server to user frontend. The latency is tracked
|
|
188
|
+
* every time turn change between user and agent.
|
|
189
|
+
*/
|
|
190
|
+
interface E2ELatency {
|
|
191
|
+
/**
|
|
192
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
193
|
+
*/
|
|
194
|
+
max?: number;
|
|
195
|
+
/**
|
|
196
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
197
|
+
*/
|
|
198
|
+
min?: number;
|
|
199
|
+
/**
|
|
200
|
+
* Number of data points (number of times latency is tracked).
|
|
201
|
+
*/
|
|
202
|
+
num?: number;
|
|
203
|
+
/**
|
|
204
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
205
|
+
*/
|
|
206
|
+
p50?: number;
|
|
207
|
+
/**
|
|
208
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
209
|
+
*/
|
|
210
|
+
p90?: number;
|
|
211
|
+
/**
|
|
212
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
213
|
+
*/
|
|
214
|
+
p95?: number;
|
|
215
|
+
/**
|
|
216
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
217
|
+
*/
|
|
218
|
+
p99?: number;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* LLM latency (from issue of LLM call to first token received) tracking of the
|
|
222
|
+
* call, available after call ends. When using custom LLM. this latency includes
|
|
223
|
+
* LLM websocket roundtrip time between user server and Retell server.
|
|
224
|
+
*/
|
|
225
|
+
interface LlmLatency {
|
|
226
|
+
/**
|
|
227
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
228
|
+
*/
|
|
229
|
+
max?: number;
|
|
230
|
+
/**
|
|
231
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
232
|
+
*/
|
|
233
|
+
min?: number;
|
|
234
|
+
/**
|
|
235
|
+
* Number of data points (number of times latency is tracked).
|
|
236
|
+
*/
|
|
237
|
+
num?: number;
|
|
238
|
+
/**
|
|
239
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
240
|
+
*/
|
|
241
|
+
p50?: number;
|
|
242
|
+
/**
|
|
243
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
244
|
+
*/
|
|
245
|
+
p90?: number;
|
|
246
|
+
/**
|
|
247
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
248
|
+
*/
|
|
249
|
+
p95?: number;
|
|
250
|
+
/**
|
|
251
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
252
|
+
*/
|
|
253
|
+
p99?: number;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* LLM websocket roundtrip latency (between user server and Retell server) tracking
|
|
257
|
+
* of the call, available after call ends. Only populated for calls using custom
|
|
258
|
+
* LLM.
|
|
259
|
+
*/
|
|
260
|
+
interface LlmWebsocketNetworkRttLatency {
|
|
261
|
+
/**
|
|
262
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
263
|
+
*/
|
|
264
|
+
max?: number;
|
|
265
|
+
/**
|
|
266
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
267
|
+
*/
|
|
268
|
+
min?: number;
|
|
269
|
+
/**
|
|
270
|
+
* Number of data points (number of times latency is tracked).
|
|
271
|
+
*/
|
|
272
|
+
num?: number;
|
|
273
|
+
/**
|
|
274
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
275
|
+
*/
|
|
276
|
+
p50?: number;
|
|
277
|
+
/**
|
|
278
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
279
|
+
*/
|
|
280
|
+
p90?: number;
|
|
281
|
+
/**
|
|
282
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
283
|
+
*/
|
|
284
|
+
p95?: number;
|
|
285
|
+
/**
|
|
286
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
287
|
+
*/
|
|
288
|
+
p99?: number;
|
|
289
|
+
}
|
|
290
|
+
interface TranscriptObject {
|
|
291
|
+
/**
|
|
292
|
+
* Transcript of the utterances.
|
|
293
|
+
*/
|
|
294
|
+
content: string;
|
|
295
|
+
/**
|
|
296
|
+
* Documents whether this utterance is spoken by agent or user.
|
|
297
|
+
*/
|
|
298
|
+
role: 'agent' | 'user';
|
|
299
|
+
/**
|
|
300
|
+
* Array of words in the utterance with the word timestamp. Useful for
|
|
301
|
+
* understanding what word was spoken at what time. Note that the word timestamp is
|
|
302
|
+
* not guaranteed to be accurate, it's more like an approximation.
|
|
303
|
+
*/
|
|
304
|
+
words: Array<TranscriptObject.Word>;
|
|
305
|
+
}
|
|
306
|
+
namespace TranscriptObject {
|
|
307
|
+
interface Word {
|
|
308
|
+
/**
|
|
309
|
+
* End time of the word in the call in second. This is relative audio time, not
|
|
310
|
+
* wall time.
|
|
311
|
+
*/
|
|
312
|
+
end?: number;
|
|
313
|
+
/**
|
|
314
|
+
* Start time of the word in the call in second. This is relative audio time, not
|
|
315
|
+
* wall time.
|
|
316
|
+
*/
|
|
317
|
+
start?: number;
|
|
318
|
+
/**
|
|
319
|
+
* Word transcript (with punctuation if applicable).
|
|
320
|
+
*/
|
|
321
|
+
word?: string;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
interface Utterance {
|
|
325
|
+
/**
|
|
326
|
+
* Transcript of the utterances.
|
|
327
|
+
*/
|
|
328
|
+
content: string;
|
|
329
|
+
/**
|
|
330
|
+
* Documents whether this utterance is spoken by agent or user.
|
|
331
|
+
*/
|
|
332
|
+
role: 'agent' | 'user';
|
|
333
|
+
/**
|
|
334
|
+
* Array of words in the utterance with the word timestamp. Useful for
|
|
335
|
+
* understanding what word was spoken at what time. Note that the word timestamp is
|
|
336
|
+
* not guaranteed to be accurate, it's more like an approximation.
|
|
337
|
+
*/
|
|
338
|
+
words: Array<Utterance.Word>;
|
|
339
|
+
}
|
|
340
|
+
namespace Utterance {
|
|
341
|
+
interface Word {
|
|
342
|
+
/**
|
|
343
|
+
* End time of the word in the call in second. This is relative audio time, not
|
|
344
|
+
* wall time.
|
|
345
|
+
*/
|
|
346
|
+
end?: number;
|
|
347
|
+
/**
|
|
348
|
+
* Start time of the word in the call in second. This is relative audio time, not
|
|
349
|
+
* wall time.
|
|
350
|
+
*/
|
|
351
|
+
start?: number;
|
|
352
|
+
/**
|
|
353
|
+
* Word transcript (with punctuation if applicable).
|
|
354
|
+
*/
|
|
355
|
+
word?: string;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
interface ToolCallInvocationUtterance {
|
|
359
|
+
/**
|
|
360
|
+
* Arguments for this tool call, it's a stringified JSON object.
|
|
361
|
+
*/
|
|
362
|
+
arguments: string;
|
|
363
|
+
/**
|
|
364
|
+
* Name of the function in this tool call.
|
|
365
|
+
*/
|
|
366
|
+
name: string;
|
|
367
|
+
/**
|
|
368
|
+
* This is a tool call invocation.
|
|
369
|
+
*/
|
|
370
|
+
role: 'tool_call_invocation';
|
|
371
|
+
/**
|
|
372
|
+
* Tool call id, globally unique.
|
|
373
|
+
*/
|
|
374
|
+
tool_call_id: string;
|
|
375
|
+
}
|
|
376
|
+
interface ToolCallResultUtterance {
|
|
377
|
+
/**
|
|
378
|
+
* Result of the tool call, can be a string, a stringified json, etc.
|
|
379
|
+
*/
|
|
380
|
+
content: string;
|
|
381
|
+
/**
|
|
382
|
+
* This is result of a tool call.
|
|
383
|
+
*/
|
|
384
|
+
role: 'tool_call_result';
|
|
385
|
+
/**
|
|
386
|
+
* Tool call id, globally unique.
|
|
387
|
+
*/
|
|
388
|
+
tool_call_id: string;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
export interface WebCallResponse {
|
|
133
392
|
/**
|
|
134
393
|
* Access token to enter the web call room. This needs to be passed to your
|
|
135
394
|
* frontend to join the call.
|
|
@@ -161,6 +420,43 @@ export interface CallCreateWebCallResponse {
|
|
|
161
420
|
* Type of the call. Used to distinguish between web call and phone call.
|
|
162
421
|
*/
|
|
163
422
|
call_type: 'web_call';
|
|
423
|
+
/**
|
|
424
|
+
* - BETA feature, schema might change, might not always be populated. Please do
|
|
425
|
+
* not rely on this object schema for post processing. Post conversation
|
|
426
|
+
* evaluation of the call. Including information such as sentiment, intent, call
|
|
427
|
+
* completion status and other metrics. Available after call ends. Subscribe to
|
|
428
|
+
* `call_analyzed` webhook event type to receive it once ready.
|
|
429
|
+
*/
|
|
430
|
+
call_analysis?: WebCallResponse.CallAnalysis;
|
|
431
|
+
/**
|
|
432
|
+
* The reason for the disconnection of the call. Read details desciption about
|
|
433
|
+
* reasons listed here at
|
|
434
|
+
* [Disconnection Reason Doc](/get-started/debug-guide#disconnection-reason).
|
|
435
|
+
*/
|
|
436
|
+
disconnection_reason?: 'user_hangup' | 'agent_hangup' | 'call_transfer' | 'inactivity' | 'machine_detected' | 'concurrency_limit_reached' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_frontend_corrupted_payload' | 'error_twilio' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown';
|
|
437
|
+
/**
|
|
438
|
+
* End to end latency (from user stops talking to agent start talking) tracking of
|
|
439
|
+
* the call, available after call ends. This latency does not account for the
|
|
440
|
+
* network trip time from Retell server to user frontend. The latency is tracked
|
|
441
|
+
* every time turn change between user and agent.
|
|
442
|
+
*/
|
|
443
|
+
e2e_latency?: WebCallResponse.E2ELatency;
|
|
444
|
+
/**
|
|
445
|
+
* End timestamp (milliseconds since epoch) of the call. Available after call ends.
|
|
446
|
+
*/
|
|
447
|
+
end_timestamp?: number;
|
|
448
|
+
/**
|
|
449
|
+
* LLM latency (from issue of LLM call to first token received) tracking of the
|
|
450
|
+
* call, available after call ends. When using custom LLM. this latency includes
|
|
451
|
+
* LLM websocket roundtrip time between user server and Retell server.
|
|
452
|
+
*/
|
|
453
|
+
llm_latency?: WebCallResponse.LlmLatency;
|
|
454
|
+
/**
|
|
455
|
+
* LLM websocket roundtrip latency (between user server and Retell server) tracking
|
|
456
|
+
* of the call, available after call ends. Only populated for calls using custom
|
|
457
|
+
* LLM.
|
|
458
|
+
*/
|
|
459
|
+
llm_websocket_network_rtt_latency?: WebCallResponse.LlmWebsocketNetworkRttLatency;
|
|
164
460
|
/**
|
|
165
461
|
* An arbitrary object for storage purpose only. You can put anything here like
|
|
166
462
|
* your internal customer id associated with the call. Not used for processing. You
|
|
@@ -172,12 +468,288 @@ export interface CallCreateWebCallResponse {
|
|
|
172
468
|
* logging.
|
|
173
469
|
*/
|
|
174
470
|
opt_out_sensitive_data_storage?: boolean;
|
|
471
|
+
/**
|
|
472
|
+
* Public log of the call, containing details about all the requests and responses
|
|
473
|
+
* received in LLM WebSocket, latency tracking for each turntaking, helpful for
|
|
474
|
+
* debugging and tracing. Available after call ends.
|
|
475
|
+
*/
|
|
476
|
+
public_log_url?: string;
|
|
477
|
+
/**
|
|
478
|
+
* Recording of the call. Available after call ends.
|
|
479
|
+
*/
|
|
480
|
+
recording_url?: string;
|
|
175
481
|
/**
|
|
176
482
|
* Add optional dynamic variables in key value pairs of string that injects into
|
|
177
483
|
* your Retell LLM prompt and tool description. Only applicable for Retell LLM.
|
|
178
484
|
*/
|
|
179
485
|
retell_llm_dynamic_variables?: Record<string, unknown>;
|
|
486
|
+
/**
|
|
487
|
+
* Begin timestamp (milliseconds since epoch) of the call. Available after call
|
|
488
|
+
* starts.
|
|
489
|
+
*/
|
|
490
|
+
start_timestamp?: number;
|
|
491
|
+
/**
|
|
492
|
+
* Transcription of the call. Available after call ends.
|
|
493
|
+
*/
|
|
494
|
+
transcript?: string;
|
|
495
|
+
/**
|
|
496
|
+
* Transcript of the call in the format of a list of utterance, with timestamp.
|
|
497
|
+
* Available after call ends.
|
|
498
|
+
*/
|
|
499
|
+
transcript_object?: Array<WebCallResponse.TranscriptObject>;
|
|
500
|
+
/**
|
|
501
|
+
* Transcript of the call weaved with tool call invocation and results. It
|
|
502
|
+
* precisely captures when (at what utterance, which word) the tool was invoked and
|
|
503
|
+
* what was the result. Available after call ends.
|
|
504
|
+
*/
|
|
505
|
+
transcript_with_tool_calls?: Array<WebCallResponse.Utterance | WebCallResponse.ToolCallInvocationUtterance | WebCallResponse.ToolCallResultUtterance>;
|
|
180
506
|
}
|
|
507
|
+
export declare namespace WebCallResponse {
|
|
508
|
+
/**
|
|
509
|
+
* - BETA feature, schema might change, might not always be populated. Please do
|
|
510
|
+
* not rely on this object schema for post processing. Post conversation
|
|
511
|
+
* evaluation of the call. Including information such as sentiment, intent, call
|
|
512
|
+
* completion status and other metrics. Available after call ends. Subscribe to
|
|
513
|
+
* `call_analyzed` webhook event type to receive it once ready.
|
|
514
|
+
*/
|
|
515
|
+
interface CallAnalysis {
|
|
516
|
+
/**
|
|
517
|
+
* Sentiment of the agent in the call.
|
|
518
|
+
*/
|
|
519
|
+
agent_sentiment?: 'Negative' | 'Positive' | 'Neutral';
|
|
520
|
+
/**
|
|
521
|
+
* Evaluate agent task completion status, whether the agent has completed his task.
|
|
522
|
+
*/
|
|
523
|
+
agent_task_completion_rating?: 'Complete' | 'Incomplete' | 'Partial';
|
|
524
|
+
/**
|
|
525
|
+
* Reason for the agent task completion status.
|
|
526
|
+
*/
|
|
527
|
+
agent_task_completion_rating_reason?: string;
|
|
528
|
+
/**
|
|
529
|
+
* Evaluate whether the call ended normally or was cut off.
|
|
530
|
+
*/
|
|
531
|
+
call_completion_rating?: 'Complete' | 'Incomplete' | 'Partial';
|
|
532
|
+
/**
|
|
533
|
+
* Reason for the call completion status.
|
|
534
|
+
*/
|
|
535
|
+
call_completion_rating_reason?: string;
|
|
536
|
+
/**
|
|
537
|
+
* A high level summary of the call.
|
|
538
|
+
*/
|
|
539
|
+
call_summary?: string;
|
|
540
|
+
/**
|
|
541
|
+
* Sentiment of the user in the call.
|
|
542
|
+
*/
|
|
543
|
+
user_sentiment?: 'Negative' | 'Positive' | 'Neutral';
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* End to end latency (from user stops talking to agent start talking) tracking of
|
|
547
|
+
* the call, available after call ends. This latency does not account for the
|
|
548
|
+
* network trip time from Retell server to user frontend. The latency is tracked
|
|
549
|
+
* every time turn change between user and agent.
|
|
550
|
+
*/
|
|
551
|
+
interface E2ELatency {
|
|
552
|
+
/**
|
|
553
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
554
|
+
*/
|
|
555
|
+
max?: number;
|
|
556
|
+
/**
|
|
557
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
558
|
+
*/
|
|
559
|
+
min?: number;
|
|
560
|
+
/**
|
|
561
|
+
* Number of data points (number of times latency is tracked).
|
|
562
|
+
*/
|
|
563
|
+
num?: number;
|
|
564
|
+
/**
|
|
565
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
566
|
+
*/
|
|
567
|
+
p50?: number;
|
|
568
|
+
/**
|
|
569
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
570
|
+
*/
|
|
571
|
+
p90?: number;
|
|
572
|
+
/**
|
|
573
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
574
|
+
*/
|
|
575
|
+
p95?: number;
|
|
576
|
+
/**
|
|
577
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
578
|
+
*/
|
|
579
|
+
p99?: number;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* LLM latency (from issue of LLM call to first token received) tracking of the
|
|
583
|
+
* call, available after call ends. When using custom LLM. this latency includes
|
|
584
|
+
* LLM websocket roundtrip time between user server and Retell server.
|
|
585
|
+
*/
|
|
586
|
+
interface LlmLatency {
|
|
587
|
+
/**
|
|
588
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
589
|
+
*/
|
|
590
|
+
max?: number;
|
|
591
|
+
/**
|
|
592
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
593
|
+
*/
|
|
594
|
+
min?: number;
|
|
595
|
+
/**
|
|
596
|
+
* Number of data points (number of times latency is tracked).
|
|
597
|
+
*/
|
|
598
|
+
num?: number;
|
|
599
|
+
/**
|
|
600
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
601
|
+
*/
|
|
602
|
+
p50?: number;
|
|
603
|
+
/**
|
|
604
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
605
|
+
*/
|
|
606
|
+
p90?: number;
|
|
607
|
+
/**
|
|
608
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
609
|
+
*/
|
|
610
|
+
p95?: number;
|
|
611
|
+
/**
|
|
612
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
613
|
+
*/
|
|
614
|
+
p99?: number;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* LLM websocket roundtrip latency (between user server and Retell server) tracking
|
|
618
|
+
* of the call, available after call ends. Only populated for calls using custom
|
|
619
|
+
* LLM.
|
|
620
|
+
*/
|
|
621
|
+
interface LlmWebsocketNetworkRttLatency {
|
|
622
|
+
/**
|
|
623
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
624
|
+
*/
|
|
625
|
+
max?: number;
|
|
626
|
+
/**
|
|
627
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
628
|
+
*/
|
|
629
|
+
min?: number;
|
|
630
|
+
/**
|
|
631
|
+
* Number of data points (number of times latency is tracked).
|
|
632
|
+
*/
|
|
633
|
+
num?: number;
|
|
634
|
+
/**
|
|
635
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
636
|
+
*/
|
|
637
|
+
p50?: number;
|
|
638
|
+
/**
|
|
639
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
640
|
+
*/
|
|
641
|
+
p90?: number;
|
|
642
|
+
/**
|
|
643
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
644
|
+
*/
|
|
645
|
+
p95?: number;
|
|
646
|
+
/**
|
|
647
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
648
|
+
*/
|
|
649
|
+
p99?: number;
|
|
650
|
+
}
|
|
651
|
+
interface TranscriptObject {
|
|
652
|
+
/**
|
|
653
|
+
* Transcript of the utterances.
|
|
654
|
+
*/
|
|
655
|
+
content: string;
|
|
656
|
+
/**
|
|
657
|
+
* Documents whether this utterance is spoken by agent or user.
|
|
658
|
+
*/
|
|
659
|
+
role: 'agent' | 'user';
|
|
660
|
+
/**
|
|
661
|
+
* Array of words in the utterance with the word timestamp. Useful for
|
|
662
|
+
* understanding what word was spoken at what time. Note that the word timestamp is
|
|
663
|
+
* not guaranteed to be accurate, it's more like an approximation.
|
|
664
|
+
*/
|
|
665
|
+
words: Array<TranscriptObject.Word>;
|
|
666
|
+
}
|
|
667
|
+
namespace TranscriptObject {
|
|
668
|
+
interface Word {
|
|
669
|
+
/**
|
|
670
|
+
* End time of the word in the call in second. This is relative audio time, not
|
|
671
|
+
* wall time.
|
|
672
|
+
*/
|
|
673
|
+
end?: number;
|
|
674
|
+
/**
|
|
675
|
+
* Start time of the word in the call in second. This is relative audio time, not
|
|
676
|
+
* wall time.
|
|
677
|
+
*/
|
|
678
|
+
start?: number;
|
|
679
|
+
/**
|
|
680
|
+
* Word transcript (with punctuation if applicable).
|
|
681
|
+
*/
|
|
682
|
+
word?: string;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
interface Utterance {
|
|
686
|
+
/**
|
|
687
|
+
* Transcript of the utterances.
|
|
688
|
+
*/
|
|
689
|
+
content: string;
|
|
690
|
+
/**
|
|
691
|
+
* Documents whether this utterance is spoken by agent or user.
|
|
692
|
+
*/
|
|
693
|
+
role: 'agent' | 'user';
|
|
694
|
+
/**
|
|
695
|
+
* Array of words in the utterance with the word timestamp. Useful for
|
|
696
|
+
* understanding what word was spoken at what time. Note that the word timestamp is
|
|
697
|
+
* not guaranteed to be accurate, it's more like an approximation.
|
|
698
|
+
*/
|
|
699
|
+
words: Array<Utterance.Word>;
|
|
700
|
+
}
|
|
701
|
+
namespace Utterance {
|
|
702
|
+
interface Word {
|
|
703
|
+
/**
|
|
704
|
+
* End time of the word in the call in second. This is relative audio time, not
|
|
705
|
+
* wall time.
|
|
706
|
+
*/
|
|
707
|
+
end?: number;
|
|
708
|
+
/**
|
|
709
|
+
* Start time of the word in the call in second. This is relative audio time, not
|
|
710
|
+
* wall time.
|
|
711
|
+
*/
|
|
712
|
+
start?: number;
|
|
713
|
+
/**
|
|
714
|
+
* Word transcript (with punctuation if applicable).
|
|
715
|
+
*/
|
|
716
|
+
word?: string;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
interface ToolCallInvocationUtterance {
|
|
720
|
+
/**
|
|
721
|
+
* Arguments for this tool call, it's a stringified JSON object.
|
|
722
|
+
*/
|
|
723
|
+
arguments: string;
|
|
724
|
+
/**
|
|
725
|
+
* Name of the function in this tool call.
|
|
726
|
+
*/
|
|
727
|
+
name: string;
|
|
728
|
+
/**
|
|
729
|
+
* This is a tool call invocation.
|
|
730
|
+
*/
|
|
731
|
+
role: 'tool_call_invocation';
|
|
732
|
+
/**
|
|
733
|
+
* Tool call id, globally unique.
|
|
734
|
+
*/
|
|
735
|
+
tool_call_id: string;
|
|
736
|
+
}
|
|
737
|
+
interface ToolCallResultUtterance {
|
|
738
|
+
/**
|
|
739
|
+
* Result of the tool call, can be a string, a stringified json, etc.
|
|
740
|
+
*/
|
|
741
|
+
content: string;
|
|
742
|
+
/**
|
|
743
|
+
* This is result of a tool call.
|
|
744
|
+
*/
|
|
745
|
+
role: 'tool_call_result';
|
|
746
|
+
/**
|
|
747
|
+
* Tool call id, globally unique.
|
|
748
|
+
*/
|
|
749
|
+
tool_call_id: string;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
export type CallListResponse = Array<CallResponse>;
|
|
181
753
|
export interface CallListParams {
|
|
182
754
|
filter_criteria?: CallListParams.FilterCriteria;
|
|
183
755
|
/**
|
|
@@ -269,8 +841,8 @@ export interface CallCreateWebCallParams {
|
|
|
269
841
|
export declare namespace Call {
|
|
270
842
|
export import CallResponse = CallAPI.CallResponse;
|
|
271
843
|
export import PhoneCallResponse = CallAPI.PhoneCallResponse;
|
|
844
|
+
export import WebCallResponse = CallAPI.WebCallResponse;
|
|
272
845
|
export import CallListResponse = CallAPI.CallListResponse;
|
|
273
|
-
export import CallCreateWebCallResponse = CallAPI.CallCreateWebCallResponse;
|
|
274
846
|
export import CallListParams = CallAPI.CallListParams;
|
|
275
847
|
export import CallCreatePhoneCallParams = CallAPI.CallCreatePhoneCallParams;
|
|
276
848
|
export import CallCreateWebCallParams = CallAPI.CallCreateWebCallParams;
|