phonic 0.29.0 → 0.29.1
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/dist/index.d.mts +76 -34
- package/dist/index.d.ts +76 -34
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -36,7 +36,79 @@ type DataOrError<T> = Promise<{
|
|
|
36
36
|
};
|
|
37
37
|
}>;
|
|
38
38
|
type ISODate = `${string}-${string}-${string}`;
|
|
39
|
-
type ISODateTime
|
|
39
|
+
type ISODateTime = `${string}Z`;
|
|
40
|
+
type TaskStatus = "pending" | "completed" | "failed";
|
|
41
|
+
type TaskResult = {
|
|
42
|
+
name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
status: TaskStatus;
|
|
45
|
+
commentary: string | null;
|
|
46
|
+
};
|
|
47
|
+
type TaskResults = {
|
|
48
|
+
results: Array<TaskResult>;
|
|
49
|
+
};
|
|
50
|
+
type ConversationItem = {
|
|
51
|
+
role: "user";
|
|
52
|
+
item_idx: number;
|
|
53
|
+
text: string;
|
|
54
|
+
duration_ms: number;
|
|
55
|
+
started_at: string;
|
|
56
|
+
} | {
|
|
57
|
+
role: "assistant";
|
|
58
|
+
item_idx: number;
|
|
59
|
+
text: string;
|
|
60
|
+
voice_id: string;
|
|
61
|
+
system_prompt: string;
|
|
62
|
+
audio_speed: number;
|
|
63
|
+
duration_ms: number;
|
|
64
|
+
started_at: string;
|
|
65
|
+
};
|
|
66
|
+
type Conversation = {
|
|
67
|
+
id: string;
|
|
68
|
+
external_id: string | null;
|
|
69
|
+
workspace: string;
|
|
70
|
+
agent: {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
} | null;
|
|
74
|
+
model: string;
|
|
75
|
+
welcome_message: string | null;
|
|
76
|
+
input_format: "pcm_44100" | "mulaw_8000";
|
|
77
|
+
output_format: "pcm_44100" | "mulaw_8000";
|
|
78
|
+
live_transcript: string;
|
|
79
|
+
post_call_transcript: string | null;
|
|
80
|
+
audio_url: string | null;
|
|
81
|
+
duration_ms: number;
|
|
82
|
+
task_results: TaskResults;
|
|
83
|
+
started_at: ISODateTime;
|
|
84
|
+
ended_at: ISODateTime | null;
|
|
85
|
+
items: Array<ConversationItem>;
|
|
86
|
+
};
|
|
87
|
+
type ConversationEndedWebhookPayload = {
|
|
88
|
+
event_type: "conversation.ended";
|
|
89
|
+
created_at: ISODateTime;
|
|
90
|
+
data: {
|
|
91
|
+
conversation: Conversation;
|
|
92
|
+
call_info: {
|
|
93
|
+
from_phone_number: string;
|
|
94
|
+
to_phone_number: string;
|
|
95
|
+
} | null;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
type ConversationAnalysisWebhookPayload = {
|
|
99
|
+
event_type: "conversation.analysis";
|
|
100
|
+
created_at: ISODateTime;
|
|
101
|
+
data: {
|
|
102
|
+
conversation: {
|
|
103
|
+
latencies_ms: number[];
|
|
104
|
+
interruptions_count: number;
|
|
105
|
+
};
|
|
106
|
+
call_info: {
|
|
107
|
+
from_phone_number: string;
|
|
108
|
+
to_phone_number: string;
|
|
109
|
+
} | null;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
40
112
|
|
|
41
113
|
type PhonicSTSTool = "keypad_input" | "natural_conversation_ending" | (string & {});
|
|
42
114
|
interface PhonicSTSConfigBase {
|
|
@@ -291,36 +363,6 @@ declare class Agents {
|
|
|
291
363
|
delete(nameOrId: string, params?: DeleteAgentParams): DataOrError<DeleteAgentSuccessResponse>;
|
|
292
364
|
}
|
|
293
365
|
|
|
294
|
-
type ISODateTime = `${string}Z`;
|
|
295
|
-
type ConversationItem = {
|
|
296
|
-
role: "user";
|
|
297
|
-
item_idx: number;
|
|
298
|
-
text: string;
|
|
299
|
-
duration_ms: number;
|
|
300
|
-
started_at: string;
|
|
301
|
-
} | {
|
|
302
|
-
role: "assistant";
|
|
303
|
-
item_idx: number;
|
|
304
|
-
text: string;
|
|
305
|
-
voice_id: string;
|
|
306
|
-
system_prompt: string;
|
|
307
|
-
audio_speed: number;
|
|
308
|
-
duration_ms: number;
|
|
309
|
-
started_at: string;
|
|
310
|
-
};
|
|
311
|
-
type Conversation = {
|
|
312
|
-
id: string;
|
|
313
|
-
external_id: string | null;
|
|
314
|
-
model: string;
|
|
315
|
-
welcome_message: string | null;
|
|
316
|
-
input_format: "pcm_44100" | "mulaw_8000";
|
|
317
|
-
output_format: "pcm_44100" | "mulaw_8000";
|
|
318
|
-
text: string;
|
|
319
|
-
duration_ms: number;
|
|
320
|
-
started_at: ISODateTime;
|
|
321
|
-
ended_at: ISODateTime;
|
|
322
|
-
items: Array<ConversationItem>;
|
|
323
|
-
};
|
|
324
366
|
type ConversationSuccessResponse = {
|
|
325
367
|
conversation: Conversation;
|
|
326
368
|
};
|
|
@@ -358,8 +400,8 @@ declare class Conversations {
|
|
|
358
400
|
project?: string;
|
|
359
401
|
durationMin?: number;
|
|
360
402
|
durationMax?: number;
|
|
361
|
-
startedAtMin?: ISODate | ISODateTime
|
|
362
|
-
startedAtMax?: ISODate | ISODateTime
|
|
403
|
+
startedAtMin?: ISODate | ISODateTime;
|
|
404
|
+
startedAtMax?: ISODate | ISODateTime;
|
|
363
405
|
}): DataOrError<ConversationsSuccessResponse>;
|
|
364
406
|
get(id: string): DataOrError<ConversationSuccessResponse>;
|
|
365
407
|
getByExternalId({ project, externalId, }: {
|
|
@@ -639,4 +681,4 @@ declare class Phonic {
|
|
|
639
681
|
}>;
|
|
640
682
|
}
|
|
641
683
|
|
|
642
|
-
export { Phonic, type PhonicConfigurationEndpointRequestPayload, type PhonicConfigurationEndpointResponsePayload, type PhonicSTSConfig, PhonicSTSWebSocket, type PhonicSTSWebSocketResponseMessage };
|
|
684
|
+
export { type ConversationAnalysisWebhookPayload, type ConversationEndedWebhookPayload, Phonic, type PhonicConfigurationEndpointRequestPayload, type PhonicConfigurationEndpointResponsePayload, type PhonicSTSConfig, PhonicSTSWebSocket, type PhonicSTSWebSocketResponseMessage };
|
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,79 @@ type DataOrError<T> = Promise<{
|
|
|
36
36
|
};
|
|
37
37
|
}>;
|
|
38
38
|
type ISODate = `${string}-${string}-${string}`;
|
|
39
|
-
type ISODateTime
|
|
39
|
+
type ISODateTime = `${string}Z`;
|
|
40
|
+
type TaskStatus = "pending" | "completed" | "failed";
|
|
41
|
+
type TaskResult = {
|
|
42
|
+
name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
status: TaskStatus;
|
|
45
|
+
commentary: string | null;
|
|
46
|
+
};
|
|
47
|
+
type TaskResults = {
|
|
48
|
+
results: Array<TaskResult>;
|
|
49
|
+
};
|
|
50
|
+
type ConversationItem = {
|
|
51
|
+
role: "user";
|
|
52
|
+
item_idx: number;
|
|
53
|
+
text: string;
|
|
54
|
+
duration_ms: number;
|
|
55
|
+
started_at: string;
|
|
56
|
+
} | {
|
|
57
|
+
role: "assistant";
|
|
58
|
+
item_idx: number;
|
|
59
|
+
text: string;
|
|
60
|
+
voice_id: string;
|
|
61
|
+
system_prompt: string;
|
|
62
|
+
audio_speed: number;
|
|
63
|
+
duration_ms: number;
|
|
64
|
+
started_at: string;
|
|
65
|
+
};
|
|
66
|
+
type Conversation = {
|
|
67
|
+
id: string;
|
|
68
|
+
external_id: string | null;
|
|
69
|
+
workspace: string;
|
|
70
|
+
agent: {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
} | null;
|
|
74
|
+
model: string;
|
|
75
|
+
welcome_message: string | null;
|
|
76
|
+
input_format: "pcm_44100" | "mulaw_8000";
|
|
77
|
+
output_format: "pcm_44100" | "mulaw_8000";
|
|
78
|
+
live_transcript: string;
|
|
79
|
+
post_call_transcript: string | null;
|
|
80
|
+
audio_url: string | null;
|
|
81
|
+
duration_ms: number;
|
|
82
|
+
task_results: TaskResults;
|
|
83
|
+
started_at: ISODateTime;
|
|
84
|
+
ended_at: ISODateTime | null;
|
|
85
|
+
items: Array<ConversationItem>;
|
|
86
|
+
};
|
|
87
|
+
type ConversationEndedWebhookPayload = {
|
|
88
|
+
event_type: "conversation.ended";
|
|
89
|
+
created_at: ISODateTime;
|
|
90
|
+
data: {
|
|
91
|
+
conversation: Conversation;
|
|
92
|
+
call_info: {
|
|
93
|
+
from_phone_number: string;
|
|
94
|
+
to_phone_number: string;
|
|
95
|
+
} | null;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
type ConversationAnalysisWebhookPayload = {
|
|
99
|
+
event_type: "conversation.analysis";
|
|
100
|
+
created_at: ISODateTime;
|
|
101
|
+
data: {
|
|
102
|
+
conversation: {
|
|
103
|
+
latencies_ms: number[];
|
|
104
|
+
interruptions_count: number;
|
|
105
|
+
};
|
|
106
|
+
call_info: {
|
|
107
|
+
from_phone_number: string;
|
|
108
|
+
to_phone_number: string;
|
|
109
|
+
} | null;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
40
112
|
|
|
41
113
|
type PhonicSTSTool = "keypad_input" | "natural_conversation_ending" | (string & {});
|
|
42
114
|
interface PhonicSTSConfigBase {
|
|
@@ -291,36 +363,6 @@ declare class Agents {
|
|
|
291
363
|
delete(nameOrId: string, params?: DeleteAgentParams): DataOrError<DeleteAgentSuccessResponse>;
|
|
292
364
|
}
|
|
293
365
|
|
|
294
|
-
type ISODateTime = `${string}Z`;
|
|
295
|
-
type ConversationItem = {
|
|
296
|
-
role: "user";
|
|
297
|
-
item_idx: number;
|
|
298
|
-
text: string;
|
|
299
|
-
duration_ms: number;
|
|
300
|
-
started_at: string;
|
|
301
|
-
} | {
|
|
302
|
-
role: "assistant";
|
|
303
|
-
item_idx: number;
|
|
304
|
-
text: string;
|
|
305
|
-
voice_id: string;
|
|
306
|
-
system_prompt: string;
|
|
307
|
-
audio_speed: number;
|
|
308
|
-
duration_ms: number;
|
|
309
|
-
started_at: string;
|
|
310
|
-
};
|
|
311
|
-
type Conversation = {
|
|
312
|
-
id: string;
|
|
313
|
-
external_id: string | null;
|
|
314
|
-
model: string;
|
|
315
|
-
welcome_message: string | null;
|
|
316
|
-
input_format: "pcm_44100" | "mulaw_8000";
|
|
317
|
-
output_format: "pcm_44100" | "mulaw_8000";
|
|
318
|
-
text: string;
|
|
319
|
-
duration_ms: number;
|
|
320
|
-
started_at: ISODateTime;
|
|
321
|
-
ended_at: ISODateTime;
|
|
322
|
-
items: Array<ConversationItem>;
|
|
323
|
-
};
|
|
324
366
|
type ConversationSuccessResponse = {
|
|
325
367
|
conversation: Conversation;
|
|
326
368
|
};
|
|
@@ -358,8 +400,8 @@ declare class Conversations {
|
|
|
358
400
|
project?: string;
|
|
359
401
|
durationMin?: number;
|
|
360
402
|
durationMax?: number;
|
|
361
|
-
startedAtMin?: ISODate | ISODateTime
|
|
362
|
-
startedAtMax?: ISODate | ISODateTime
|
|
403
|
+
startedAtMin?: ISODate | ISODateTime;
|
|
404
|
+
startedAtMax?: ISODate | ISODateTime;
|
|
363
405
|
}): DataOrError<ConversationsSuccessResponse>;
|
|
364
406
|
get(id: string): DataOrError<ConversationSuccessResponse>;
|
|
365
407
|
getByExternalId({ project, externalId, }: {
|
|
@@ -639,4 +681,4 @@ declare class Phonic {
|
|
|
639
681
|
}>;
|
|
640
682
|
}
|
|
641
683
|
|
|
642
|
-
export { Phonic, type PhonicConfigurationEndpointRequestPayload, type PhonicConfigurationEndpointResponsePayload, type PhonicSTSConfig, PhonicSTSWebSocket, type PhonicSTSWebSocketResponseMessage };
|
|
684
|
+
export { type ConversationAnalysisWebhookPayload, type ConversationEndedWebhookPayload, Phonic, type PhonicConfigurationEndpointRequestPayload, type PhonicConfigurationEndpointResponsePayload, type PhonicSTSConfig, PhonicSTSWebSocket, type PhonicSTSWebSocketResponseMessage };
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED