@roarkanalytics/sdk 0.320.0 → 0.322.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 +17 -0
- package/README.md +21 -61
- package/index.d.mts +3 -3
- package/index.d.ts +3 -3
- package/index.d.ts.map +1 -1
- package/index.js +3 -3
- package/index.js.map +1 -1
- package/index.mjs +3 -3
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/evaluations.d.ts +255 -0
- package/resources/evaluations.d.ts.map +1 -0
- package/resources/evaluations.js +15 -0
- package/resources/evaluations.js.map +1 -0
- package/resources/evaluations.mjs +11 -0
- package/resources/evaluations.mjs.map +1 -0
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/src/index.ts +6 -12
- package/src/resources/evaluations.ts +352 -0
- package/src/resources/index.ts +1 -6
- 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-analysis.d.ts +0 -220
- package/resources/call-analysis.d.ts.map +0 -1
- package/resources/call-analysis.js +0 -39
- package/resources/call-analysis.js.map +0 -1
- package/resources/call-analysis.mjs +0 -35
- package/resources/call-analysis.mjs.map +0 -1
- package/src/resources/call-analysis.ts +0 -314
package/resources/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAAwG;AAA/F,0GAAA,WAAW,OAAA;AACpB,sCAA0D;AAAjD,gGAAA,MAAM,OAAA"}
|
package/resources/index.mjs
CHANGED
package/resources/index.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAA8D;OAC3E,EAAE,MAAM,EAA0B"}
|
package/src/index.ts
CHANGED
@@ -5,12 +5,7 @@ import * as Core from './core';
|
|
5
5
|
import * as Errors from './error';
|
6
6
|
import * as Uploads from './uploads';
|
7
7
|
import * as API from './resources/index';
|
8
|
-
import {
|
9
|
-
CallAnalysis,
|
10
|
-
CallAnalysisCreateParams,
|
11
|
-
CallAnalysisCreateResponse,
|
12
|
-
CallAnalysisRetrieveResponse,
|
13
|
-
} from './resources/call-analysis';
|
8
|
+
import { EvaluationCreateParams, EvaluationCreateResponse, Evaluations } from './resources/evaluations';
|
14
9
|
import { Health, HealthGetResponse } from './resources/health';
|
15
10
|
|
16
11
|
export interface ClientOptions {
|
@@ -127,7 +122,7 @@ export class Roark extends Core.APIClient {
|
|
127
122
|
}
|
128
123
|
|
129
124
|
health: API.Health = new API.Health(this);
|
130
|
-
|
125
|
+
evaluations: API.Evaluations = new API.Evaluations(this);
|
131
126
|
|
132
127
|
protected override defaultQuery(): Core.DefaultQuery | undefined {
|
133
128
|
return this._options.defaultQuery;
|
@@ -166,17 +161,16 @@ export class Roark extends Core.APIClient {
|
|
166
161
|
}
|
167
162
|
|
168
163
|
Roark.Health = Health;
|
169
|
-
Roark.
|
164
|
+
Roark.Evaluations = Evaluations;
|
170
165
|
export declare namespace Roark {
|
171
166
|
export type RequestOptions = Core.RequestOptions;
|
172
167
|
|
173
168
|
export { Health as Health, type HealthGetResponse as HealthGetResponse };
|
174
169
|
|
175
170
|
export {
|
176
|
-
|
177
|
-
type
|
178
|
-
type
|
179
|
-
type CallAnalysisCreateParams as CallAnalysisCreateParams,
|
171
|
+
Evaluations as Evaluations,
|
172
|
+
type EvaluationCreateResponse as EvaluationCreateResponse,
|
173
|
+
type EvaluationCreateParams as EvaluationCreateParams,
|
180
174
|
};
|
181
175
|
}
|
182
176
|
|
@@ -0,0 +1,352 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
import { APIResource } from '../resource';
|
4
|
+
import * as Core from '../core';
|
5
|
+
|
6
|
+
export class Evaluations extends APIResource {
|
7
|
+
/**
|
8
|
+
* Create evaluation jobs for a dataset of calls
|
9
|
+
*/
|
10
|
+
create(
|
11
|
+
body: EvaluationCreateParams,
|
12
|
+
options?: Core.RequestOptions,
|
13
|
+
): Core.APIPromise<EvaluationCreateResponse> {
|
14
|
+
return this._client.post('/v1/evaluations', { body, ...options });
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
export interface EvaluationCreateResponse {
|
19
|
+
data: EvaluationCreateResponse.Data;
|
20
|
+
}
|
21
|
+
|
22
|
+
export namespace EvaluationCreateResponse {
|
23
|
+
export interface Data {
|
24
|
+
/**
|
25
|
+
* ID of the evaluation job
|
26
|
+
*/
|
27
|
+
jobId: string;
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Status of the evaluation job
|
31
|
+
*/
|
32
|
+
status: 'PENDING' | 'PROCESSING' | 'SUCCESS' | 'FAILURE';
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
export interface EvaluationCreateParams {
|
37
|
+
/**
|
38
|
+
* List of evaluators to evaluate the calls or "all" to evaluate all evaluators
|
39
|
+
*/
|
40
|
+
evaluators: Array<string> | 'all';
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Call to evaluate
|
44
|
+
*/
|
45
|
+
call?: EvaluationCreateParams.Call;
|
46
|
+
|
47
|
+
dataset?: EvaluationCreateParams.Dataset;
|
48
|
+
}
|
49
|
+
|
50
|
+
export namespace EvaluationCreateParams {
|
51
|
+
/**
|
52
|
+
* Call to evaluate
|
53
|
+
*/
|
54
|
+
export interface Call {
|
55
|
+
/**
|
56
|
+
* Direction of the call (INBOUND or OUTBOUND)
|
57
|
+
*/
|
58
|
+
callDirection: 'INBOUND' | 'OUTBOUND';
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Interface type of the call (PHONE or WEB)
|
62
|
+
*/
|
63
|
+
interfaceType: 'PHONE' | 'WEB';
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Exactly two participants in the call
|
67
|
+
*/
|
68
|
+
participants: Array<Call.Participant>;
|
69
|
+
|
70
|
+
/**
|
71
|
+
* URL of source recording (must be an accessible WAV or MP3 file). Can be a signed
|
72
|
+
* URL.
|
73
|
+
*/
|
74
|
+
recordingUrl: string;
|
75
|
+
|
76
|
+
/**
|
77
|
+
* When the call started (ISO 8601 format)
|
78
|
+
*/
|
79
|
+
startedAt: string;
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Additional context on why the call terminated with the endedStatus
|
83
|
+
*/
|
84
|
+
endedReason?: string;
|
85
|
+
|
86
|
+
/**
|
87
|
+
* High-level call end status, indicating how the call terminated
|
88
|
+
*/
|
89
|
+
endedStatus?:
|
90
|
+
| 'AGENT_ENDED_CALL'
|
91
|
+
| 'AGENT_TRANSFERRED_CALL'
|
92
|
+
| 'AGENT_ERROR'
|
93
|
+
| 'CUSTOMER_ENDED_CALL'
|
94
|
+
| 'VOICE_MAIL_REACHED'
|
95
|
+
| 'SILENCE_TIME_OUT'
|
96
|
+
| 'PHONE_CALL_PROVIDER_CONNECTION_ERROR'
|
97
|
+
| 'CUSTOMER_DID_NOT_ANSWER'
|
98
|
+
| 'CUSTOMER_BUSY'
|
99
|
+
| 'DIAL_ERROR'
|
100
|
+
| 'MAX_DURATION_REACHED'
|
101
|
+
| 'UNKNOWN';
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Whether this is a test call
|
105
|
+
*/
|
106
|
+
isTest?: boolean;
|
107
|
+
|
108
|
+
/**
|
109
|
+
* Custom properties to include with the call. These can be used for filtering and
|
110
|
+
* will show in the call details page
|
111
|
+
*/
|
112
|
+
properties?: Record<string, unknown>;
|
113
|
+
|
114
|
+
/**
|
115
|
+
* Retell call ID if call is being imported from Retell
|
116
|
+
*/
|
117
|
+
retellCallId?: string;
|
118
|
+
|
119
|
+
/**
|
120
|
+
* URL of source stereo recording in WAV format. Must be accessible. Can be a
|
121
|
+
* signed URL. While optional it allows for a richer audio player
|
122
|
+
*/
|
123
|
+
stereoRecordingUrl?: string;
|
124
|
+
|
125
|
+
/**
|
126
|
+
* List of tool invocations made during the call
|
127
|
+
*/
|
128
|
+
toolInvocations?: Array<Call.ToolInvocation>;
|
129
|
+
|
130
|
+
/**
|
131
|
+
* Vapi call ID if call is being imported from Vapi
|
132
|
+
*/
|
133
|
+
vapiCallId?: string;
|
134
|
+
}
|
135
|
+
|
136
|
+
export namespace Call {
|
137
|
+
export interface Participant {
|
138
|
+
role: 'AGENT' | 'CUSTOMER';
|
139
|
+
|
140
|
+
isSimulated?: boolean;
|
141
|
+
|
142
|
+
name?: string | null;
|
143
|
+
|
144
|
+
phoneNumber?: string | null;
|
145
|
+
|
146
|
+
spokeFirst?: boolean;
|
147
|
+
}
|
148
|
+
|
149
|
+
export interface ToolInvocation {
|
150
|
+
/**
|
151
|
+
* Name of the tool that was invoked
|
152
|
+
*/
|
153
|
+
name: string;
|
154
|
+
|
155
|
+
/**
|
156
|
+
* Parameters provided to the tool during invocation
|
157
|
+
*/
|
158
|
+
parameters: Record<string, ToolInvocation.UnionMember0 | unknown>;
|
159
|
+
|
160
|
+
/**
|
161
|
+
* Result returned by the tool after execution. Can be a string or a JSON object
|
162
|
+
*/
|
163
|
+
result: string | Record<string, unknown>;
|
164
|
+
|
165
|
+
/**
|
166
|
+
* Offset in milliseconds from the start of the call when the tool was invoked
|
167
|
+
*/
|
168
|
+
startOffsetMs: number;
|
169
|
+
|
170
|
+
/**
|
171
|
+
* Description of when the tool should be invoked
|
172
|
+
*/
|
173
|
+
description?: string;
|
174
|
+
|
175
|
+
/**
|
176
|
+
* Offset in milliseconds from the start of the call when the tool execution
|
177
|
+
* completed. Used to calculate duration of the tool execution
|
178
|
+
*/
|
179
|
+
endOffsetMs?: number;
|
180
|
+
}
|
181
|
+
|
182
|
+
export namespace ToolInvocation {
|
183
|
+
export interface UnionMember0 {
|
184
|
+
description?: string;
|
185
|
+
|
186
|
+
type?: 'string' | 'number' | 'boolean';
|
187
|
+
|
188
|
+
value?: unknown;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
|
193
|
+
export interface Dataset {
|
194
|
+
/**
|
195
|
+
* List of calls to evaluate
|
196
|
+
*/
|
197
|
+
calls: Array<Dataset.Call>;
|
198
|
+
|
199
|
+
/**
|
200
|
+
* Name of the dataset
|
201
|
+
*/
|
202
|
+
name: string;
|
203
|
+
}
|
204
|
+
|
205
|
+
export namespace Dataset {
|
206
|
+
export interface Call {
|
207
|
+
/**
|
208
|
+
* Direction of the call (INBOUND or OUTBOUND)
|
209
|
+
*/
|
210
|
+
callDirection: 'INBOUND' | 'OUTBOUND';
|
211
|
+
|
212
|
+
/**
|
213
|
+
* Interface type of the call (PHONE or WEB)
|
214
|
+
*/
|
215
|
+
interfaceType: 'PHONE' | 'WEB';
|
216
|
+
|
217
|
+
/**
|
218
|
+
* Exactly two participants in the call
|
219
|
+
*/
|
220
|
+
participants: Array<Call.Participant>;
|
221
|
+
|
222
|
+
/**
|
223
|
+
* URL of source recording (must be an accessible WAV or MP3 file). Can be a signed
|
224
|
+
* URL.
|
225
|
+
*/
|
226
|
+
recordingUrl: string;
|
227
|
+
|
228
|
+
/**
|
229
|
+
* When the call started (ISO 8601 format)
|
230
|
+
*/
|
231
|
+
startedAt: string;
|
232
|
+
|
233
|
+
/**
|
234
|
+
* Additional context on why the call terminated with the endedStatus
|
235
|
+
*/
|
236
|
+
endedReason?: string;
|
237
|
+
|
238
|
+
/**
|
239
|
+
* High-level call end status, indicating how the call terminated
|
240
|
+
*/
|
241
|
+
endedStatus?:
|
242
|
+
| 'AGENT_ENDED_CALL'
|
243
|
+
| 'AGENT_TRANSFERRED_CALL'
|
244
|
+
| 'AGENT_ERROR'
|
245
|
+
| 'CUSTOMER_ENDED_CALL'
|
246
|
+
| 'VOICE_MAIL_REACHED'
|
247
|
+
| 'SILENCE_TIME_OUT'
|
248
|
+
| 'PHONE_CALL_PROVIDER_CONNECTION_ERROR'
|
249
|
+
| 'CUSTOMER_DID_NOT_ANSWER'
|
250
|
+
| 'CUSTOMER_BUSY'
|
251
|
+
| 'DIAL_ERROR'
|
252
|
+
| 'MAX_DURATION_REACHED'
|
253
|
+
| 'UNKNOWN';
|
254
|
+
|
255
|
+
/**
|
256
|
+
* Whether this is a test call
|
257
|
+
*/
|
258
|
+
isTest?: boolean;
|
259
|
+
|
260
|
+
/**
|
261
|
+
* Custom properties to include with the call. These can be used for filtering and
|
262
|
+
* will show in the call details page
|
263
|
+
*/
|
264
|
+
properties?: Record<string, unknown>;
|
265
|
+
|
266
|
+
/**
|
267
|
+
* Retell call ID if call is being imported from Retell
|
268
|
+
*/
|
269
|
+
retellCallId?: string;
|
270
|
+
|
271
|
+
/**
|
272
|
+
* URL of source stereo recording in WAV format. Must be accessible. Can be a
|
273
|
+
* signed URL. While optional it allows for a richer audio player
|
274
|
+
*/
|
275
|
+
stereoRecordingUrl?: string;
|
276
|
+
|
277
|
+
/**
|
278
|
+
* List of tool invocations made during the call
|
279
|
+
*/
|
280
|
+
toolInvocations?: Array<Call.ToolInvocation>;
|
281
|
+
|
282
|
+
/**
|
283
|
+
* Vapi call ID if call is being imported from Vapi
|
284
|
+
*/
|
285
|
+
vapiCallId?: string;
|
286
|
+
}
|
287
|
+
|
288
|
+
export namespace Call {
|
289
|
+
export interface Participant {
|
290
|
+
role: 'AGENT' | 'CUSTOMER';
|
291
|
+
|
292
|
+
isSimulated?: boolean;
|
293
|
+
|
294
|
+
name?: string | null;
|
295
|
+
|
296
|
+
phoneNumber?: string | null;
|
297
|
+
|
298
|
+
spokeFirst?: boolean;
|
299
|
+
}
|
300
|
+
|
301
|
+
export interface ToolInvocation {
|
302
|
+
/**
|
303
|
+
* Name of the tool that was invoked
|
304
|
+
*/
|
305
|
+
name: string;
|
306
|
+
|
307
|
+
/**
|
308
|
+
* Parameters provided to the tool during invocation
|
309
|
+
*/
|
310
|
+
parameters: Record<string, ToolInvocation.UnionMember0 | unknown>;
|
311
|
+
|
312
|
+
/**
|
313
|
+
* Result returned by the tool after execution. Can be a string or a JSON object
|
314
|
+
*/
|
315
|
+
result: string | Record<string, unknown>;
|
316
|
+
|
317
|
+
/**
|
318
|
+
* Offset in milliseconds from the start of the call when the tool was invoked
|
319
|
+
*/
|
320
|
+
startOffsetMs: number;
|
321
|
+
|
322
|
+
/**
|
323
|
+
* Description of when the tool should be invoked
|
324
|
+
*/
|
325
|
+
description?: string;
|
326
|
+
|
327
|
+
/**
|
328
|
+
* Offset in milliseconds from the start of the call when the tool execution
|
329
|
+
* completed. Used to calculate duration of the tool execution
|
330
|
+
*/
|
331
|
+
endOffsetMs?: number;
|
332
|
+
}
|
333
|
+
|
334
|
+
export namespace ToolInvocation {
|
335
|
+
export interface UnionMember0 {
|
336
|
+
description?: string;
|
337
|
+
|
338
|
+
type?: 'string' | 'number' | 'boolean';
|
339
|
+
|
340
|
+
value?: unknown;
|
341
|
+
}
|
342
|
+
}
|
343
|
+
}
|
344
|
+
}
|
345
|
+
}
|
346
|
+
|
347
|
+
export declare namespace Evaluations {
|
348
|
+
export {
|
349
|
+
type EvaluationCreateResponse as EvaluationCreateResponse,
|
350
|
+
type EvaluationCreateParams as EvaluationCreateParams,
|
351
|
+
};
|
352
|
+
}
|
package/src/resources/index.ts
CHANGED
@@ -1,9 +1,4 @@
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
|
3
|
-
export {
|
4
|
-
CallAnalysis,
|
5
|
-
type CallAnalysisCreateResponse,
|
6
|
-
type CallAnalysisRetrieveResponse,
|
7
|
-
type CallAnalysisCreateParams,
|
8
|
-
} from './call-analysis';
|
3
|
+
export { Evaluations, type EvaluationCreateResponse, type EvaluationCreateParams } from './evaluations';
|
9
4
|
export { Health, type HealthGetResponse } from './health';
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const VERSION = '0.
|
1
|
+
export const VERSION = '0.322.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const VERSION = "0.
|
1
|
+
export declare const VERSION = "0.322.0";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const VERSION = '0.
|
1
|
+
export const VERSION = '0.322.0'; // x-release-please-version
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
@@ -1,220 +0,0 @@
|
|
1
|
-
import { APIResource } from "../resource.js";
|
2
|
-
import * as Core from "../core.js";
|
3
|
-
export declare class CallAnalysis extends APIResource {
|
4
|
-
/**
|
5
|
-
* Upload a new call recording
|
6
|
-
*
|
7
|
-
* @example
|
8
|
-
* ```ts
|
9
|
-
* const callAnalysis = await client.callAnalysis.create({
|
10
|
-
* callDirection: 'INBOUND',
|
11
|
-
* interfaceType: 'WEB',
|
12
|
-
* participants: [{ role: 'AGENT' }, { role: 'CUSTOMER' }],
|
13
|
-
* recordingUrl: 'https://example.com/recording.wav',
|
14
|
-
* startedAt: '2025-06-02T13:42:03.028Z',
|
15
|
-
* });
|
16
|
-
* ```
|
17
|
-
*/
|
18
|
-
create(body: CallAnalysisCreateParams, options?: Core.RequestOptions): Core.APIPromise<CallAnalysisCreateResponse>;
|
19
|
-
/**
|
20
|
-
* Fetch a call analysis job by ID
|
21
|
-
*
|
22
|
-
* @example
|
23
|
-
* ```ts
|
24
|
-
* const callAnalysis = await client.callAnalysis.retrieve(
|
25
|
-
* 'jobId',
|
26
|
-
* );
|
27
|
-
* ```
|
28
|
-
*/
|
29
|
-
retrieve(jobId: string, options?: Core.RequestOptions): Core.APIPromise<CallAnalysisRetrieveResponse>;
|
30
|
-
}
|
31
|
-
export interface CallAnalysisCreateResponse {
|
32
|
-
/**
|
33
|
-
* Analysis job with associated call context
|
34
|
-
*/
|
35
|
-
data: CallAnalysisCreateResponse.Data;
|
36
|
-
}
|
37
|
-
export declare namespace CallAnalysisCreateResponse {
|
38
|
-
/**
|
39
|
-
* Analysis job with associated call context
|
40
|
-
*/
|
41
|
-
interface Data {
|
42
|
-
call: Data.Call;
|
43
|
-
/**
|
44
|
-
* Analysis job ID for tracking progress
|
45
|
-
*/
|
46
|
-
jobId: string;
|
47
|
-
status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED';
|
48
|
-
}
|
49
|
-
namespace Data {
|
50
|
-
interface Call {
|
51
|
-
id: string;
|
52
|
-
callDirection: 'INBOUND' | 'OUTBOUND';
|
53
|
-
isTest: boolean;
|
54
|
-
participants: Array<Call.Participant>;
|
55
|
-
startedAt: string;
|
56
|
-
status: 'RINGING' | 'IN_PROGRESS' | 'ENDED' | null;
|
57
|
-
durationMs?: number | null;
|
58
|
-
endedAt?: string | null;
|
59
|
-
endedReason?: string | null;
|
60
|
-
properties?: Record<string, unknown> | null;
|
61
|
-
summary?: string | null;
|
62
|
-
}
|
63
|
-
namespace Call {
|
64
|
-
interface Participant {
|
65
|
-
role: 'AGENT' | 'CUSTOMER';
|
66
|
-
isSimulated?: boolean;
|
67
|
-
name?: string | null;
|
68
|
-
phoneNumber?: string | null;
|
69
|
-
spokeFirst?: boolean;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}
|
74
|
-
export interface CallAnalysisRetrieveResponse {
|
75
|
-
/**
|
76
|
-
* Analysis job with associated call context
|
77
|
-
*/
|
78
|
-
data: CallAnalysisRetrieveResponse.Data;
|
79
|
-
}
|
80
|
-
export declare namespace CallAnalysisRetrieveResponse {
|
81
|
-
/**
|
82
|
-
* Analysis job with associated call context
|
83
|
-
*/
|
84
|
-
interface Data {
|
85
|
-
call: Data.Call;
|
86
|
-
/**
|
87
|
-
* Analysis job ID for tracking progress
|
88
|
-
*/
|
89
|
-
jobId: string;
|
90
|
-
status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED';
|
91
|
-
}
|
92
|
-
namespace Data {
|
93
|
-
interface Call {
|
94
|
-
id: string;
|
95
|
-
callDirection: 'INBOUND' | 'OUTBOUND';
|
96
|
-
isTest: boolean;
|
97
|
-
participants: Array<Call.Participant>;
|
98
|
-
startedAt: string;
|
99
|
-
status: 'RINGING' | 'IN_PROGRESS' | 'ENDED' | null;
|
100
|
-
durationMs?: number | null;
|
101
|
-
endedAt?: string | null;
|
102
|
-
endedReason?: string | null;
|
103
|
-
properties?: Record<string, unknown> | null;
|
104
|
-
summary?: string | null;
|
105
|
-
}
|
106
|
-
namespace Call {
|
107
|
-
interface Participant {
|
108
|
-
role: 'AGENT' | 'CUSTOMER';
|
109
|
-
isSimulated?: boolean;
|
110
|
-
name?: string | null;
|
111
|
-
phoneNumber?: string | null;
|
112
|
-
spokeFirst?: boolean;
|
113
|
-
}
|
114
|
-
}
|
115
|
-
}
|
116
|
-
}
|
117
|
-
export interface CallAnalysisCreateParams {
|
118
|
-
/**
|
119
|
-
* Direction of the call (INBOUND or OUTBOUND)
|
120
|
-
*/
|
121
|
-
callDirection: 'INBOUND' | 'OUTBOUND';
|
122
|
-
/**
|
123
|
-
* Interface type of the call (PHONE or WEB)
|
124
|
-
*/
|
125
|
-
interfaceType: 'PHONE' | 'WEB';
|
126
|
-
/**
|
127
|
-
* Exactly two participants in the call
|
128
|
-
*/
|
129
|
-
participants: Array<CallAnalysisCreateParams.Participant>;
|
130
|
-
/**
|
131
|
-
* URL of source recording (must be an accessible WAV or MP3 file). Can be a signed
|
132
|
-
* URL.
|
133
|
-
*/
|
134
|
-
recordingUrl: string;
|
135
|
-
/**
|
136
|
-
* When the call started (ISO 8601 format)
|
137
|
-
*/
|
138
|
-
startedAt: string;
|
139
|
-
/**
|
140
|
-
* Additional context on why the call terminated with the endedStatus
|
141
|
-
*/
|
142
|
-
endedReason?: string;
|
143
|
-
/**
|
144
|
-
* High-level call end status, indicating how the call terminated
|
145
|
-
*/
|
146
|
-
endedStatus?: 'AGENT_ENDED_CALL' | 'AGENT_TRANSFERRED_CALL' | 'AGENT_ERROR' | 'CUSTOMER_ENDED_CALL' | 'VOICE_MAIL_REACHED' | 'SILENCE_TIME_OUT' | 'PHONE_CALL_PROVIDER_CONNECTION_ERROR' | 'CUSTOMER_DID_NOT_ANSWER' | 'CUSTOMER_BUSY' | 'DIAL_ERROR' | 'MAX_DURATION_REACHED' | 'UNKNOWN';
|
147
|
-
/**
|
148
|
-
* Whether this is a test call
|
149
|
-
*/
|
150
|
-
isTest?: boolean;
|
151
|
-
/**
|
152
|
-
* Custom properties to include with the call. These can be used for filtering and
|
153
|
-
* will show in the call details page
|
154
|
-
*/
|
155
|
-
properties?: Record<string, unknown>;
|
156
|
-
/**
|
157
|
-
* Retell call ID if call is being imported from Retell
|
158
|
-
*/
|
159
|
-
retellCallId?: string;
|
160
|
-
/**
|
161
|
-
* URL of source stereo recording in WAV format. Must be accessible. Can be a
|
162
|
-
* signed URL. While optional it allows for a richer audio player
|
163
|
-
*/
|
164
|
-
stereoRecordingUrl?: string;
|
165
|
-
/**
|
166
|
-
* List of tool invocations made during the call
|
167
|
-
*/
|
168
|
-
toolInvocations?: Array<CallAnalysisCreateParams.ToolInvocation>;
|
169
|
-
/**
|
170
|
-
* Vapi call ID if call is being imported from Vapi
|
171
|
-
*/
|
172
|
-
vapiCallId?: string;
|
173
|
-
}
|
174
|
-
export declare namespace CallAnalysisCreateParams {
|
175
|
-
interface Participant {
|
176
|
-
role: 'AGENT' | 'CUSTOMER';
|
177
|
-
isSimulated?: boolean;
|
178
|
-
name?: string | null;
|
179
|
-
phoneNumber?: string | null;
|
180
|
-
spokeFirst?: boolean;
|
181
|
-
}
|
182
|
-
interface ToolInvocation {
|
183
|
-
/**
|
184
|
-
* Name of the tool that was invoked
|
185
|
-
*/
|
186
|
-
name: string;
|
187
|
-
/**
|
188
|
-
* Parameters provided to the tool during invocation
|
189
|
-
*/
|
190
|
-
parameters: Record<string, ToolInvocation.UnionMember0 | unknown>;
|
191
|
-
/**
|
192
|
-
* Result returned by the tool after execution. Can be a string or a JSON object
|
193
|
-
*/
|
194
|
-
result: string | Record<string, unknown>;
|
195
|
-
/**
|
196
|
-
* Offset in milliseconds from the start of the call when the tool was invoked
|
197
|
-
*/
|
198
|
-
startOffsetMs: number;
|
199
|
-
/**
|
200
|
-
* Description of when the tool should be invoked
|
201
|
-
*/
|
202
|
-
description?: string;
|
203
|
-
/**
|
204
|
-
* Offset in milliseconds from the start of the call when the tool execution
|
205
|
-
* completed. Used to calculate duration of the tool execution
|
206
|
-
*/
|
207
|
-
endOffsetMs?: number;
|
208
|
-
}
|
209
|
-
namespace ToolInvocation {
|
210
|
-
interface UnionMember0 {
|
211
|
-
description?: string;
|
212
|
-
type?: 'string' | 'number' | 'boolean';
|
213
|
-
value?: unknown;
|
214
|
-
}
|
215
|
-
}
|
216
|
-
}
|
217
|
-
export declare namespace CallAnalysis {
|
218
|
-
export { type CallAnalysisCreateResponse as CallAnalysisCreateResponse, type CallAnalysisRetrieveResponse as CallAnalysisRetrieveResponse, type CallAnalysisCreateParams as CallAnalysisCreateParams, };
|
219
|
-
}
|
220
|
-
//# sourceMappingURL=call-analysis.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"call-analysis.d.ts","sourceRoot":"","sources":["../src/resources/call-analysis.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,IAAI,CAAC,c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