phonic 0.6.0 → 0.6.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 +13 -9
- package/dist/index.d.ts +13 -9
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -18,6 +18,13 @@ type DataOrError<T> = Promise<{
|
|
|
18
18
|
error: ErrorResponse;
|
|
19
19
|
}>;
|
|
20
20
|
|
|
21
|
+
type PhonicSTSConfig = {
|
|
22
|
+
input_format: "pcm_44100" | "mulaw_8000";
|
|
23
|
+
system_prompt?: string;
|
|
24
|
+
welcome_message?: string;
|
|
25
|
+
voice_id?: string;
|
|
26
|
+
output_format?: "pcm_44100" | "mulaw_8000";
|
|
27
|
+
};
|
|
21
28
|
type PhonicSTSWebSocketResponseMessage = {
|
|
22
29
|
type: "input_text";
|
|
23
30
|
text: string;
|
|
@@ -25,6 +32,9 @@ type PhonicSTSWebSocketResponseMessage = {
|
|
|
25
32
|
type: "audio_chunk";
|
|
26
33
|
text: string;
|
|
27
34
|
audio: string;
|
|
35
|
+
} | {
|
|
36
|
+
type: "is_user_speaking";
|
|
37
|
+
isUserSpeaking: boolean;
|
|
28
38
|
} | {
|
|
29
39
|
type: "error";
|
|
30
40
|
error: {
|
|
@@ -32,10 +42,10 @@ type PhonicSTSWebSocketResponseMessage = {
|
|
|
32
42
|
code?: string;
|
|
33
43
|
};
|
|
34
44
|
paramErrors?: {
|
|
45
|
+
input_format?: string;
|
|
35
46
|
system_prompt?: string;
|
|
36
47
|
welcome_message?: string;
|
|
37
48
|
voice_id?: string;
|
|
38
|
-
input_format?: string;
|
|
39
49
|
output_format?: string;
|
|
40
50
|
};
|
|
41
51
|
};
|
|
@@ -52,13 +62,7 @@ declare class PhonicSTSWebSocket {
|
|
|
52
62
|
onMessage(callback: OnMessageCallback): void;
|
|
53
63
|
onClose(callback: OnCloseCallback): void;
|
|
54
64
|
onError(callback: OnErrorCallback): void;
|
|
55
|
-
config(message:
|
|
56
|
-
system_prompt?: string;
|
|
57
|
-
welcome_message?: string;
|
|
58
|
-
voice_id?: string;
|
|
59
|
-
input_format?: "pcm_44100" | "mulaw_8000";
|
|
60
|
-
output_format?: "pcm_44100" | "mulaw_8000";
|
|
61
|
-
}): void;
|
|
65
|
+
config(message: PhonicSTSConfig): void;
|
|
62
66
|
audioChunk(message: {
|
|
63
67
|
audio: string;
|
|
64
68
|
}): void;
|
|
@@ -110,4 +114,4 @@ declare class Phonic {
|
|
|
110
114
|
}>;
|
|
111
115
|
}
|
|
112
116
|
|
|
113
|
-
export { Phonic, PhonicSTSWebSocket };
|
|
117
|
+
export { Phonic, type PhonicSTSConfig, PhonicSTSWebSocket };
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,13 @@ type DataOrError<T> = Promise<{
|
|
|
18
18
|
error: ErrorResponse;
|
|
19
19
|
}>;
|
|
20
20
|
|
|
21
|
+
type PhonicSTSConfig = {
|
|
22
|
+
input_format: "pcm_44100" | "mulaw_8000";
|
|
23
|
+
system_prompt?: string;
|
|
24
|
+
welcome_message?: string;
|
|
25
|
+
voice_id?: string;
|
|
26
|
+
output_format?: "pcm_44100" | "mulaw_8000";
|
|
27
|
+
};
|
|
21
28
|
type PhonicSTSWebSocketResponseMessage = {
|
|
22
29
|
type: "input_text";
|
|
23
30
|
text: string;
|
|
@@ -25,6 +32,9 @@ type PhonicSTSWebSocketResponseMessage = {
|
|
|
25
32
|
type: "audio_chunk";
|
|
26
33
|
text: string;
|
|
27
34
|
audio: string;
|
|
35
|
+
} | {
|
|
36
|
+
type: "is_user_speaking";
|
|
37
|
+
isUserSpeaking: boolean;
|
|
28
38
|
} | {
|
|
29
39
|
type: "error";
|
|
30
40
|
error: {
|
|
@@ -32,10 +42,10 @@ type PhonicSTSWebSocketResponseMessage = {
|
|
|
32
42
|
code?: string;
|
|
33
43
|
};
|
|
34
44
|
paramErrors?: {
|
|
45
|
+
input_format?: string;
|
|
35
46
|
system_prompt?: string;
|
|
36
47
|
welcome_message?: string;
|
|
37
48
|
voice_id?: string;
|
|
38
|
-
input_format?: string;
|
|
39
49
|
output_format?: string;
|
|
40
50
|
};
|
|
41
51
|
};
|
|
@@ -52,13 +62,7 @@ declare class PhonicSTSWebSocket {
|
|
|
52
62
|
onMessage(callback: OnMessageCallback): void;
|
|
53
63
|
onClose(callback: OnCloseCallback): void;
|
|
54
64
|
onError(callback: OnErrorCallback): void;
|
|
55
|
-
config(message:
|
|
56
|
-
system_prompt?: string;
|
|
57
|
-
welcome_message?: string;
|
|
58
|
-
voice_id?: string;
|
|
59
|
-
input_format?: "pcm_44100" | "mulaw_8000";
|
|
60
|
-
output_format?: "pcm_44100" | "mulaw_8000";
|
|
61
|
-
}): void;
|
|
65
|
+
config(message: PhonicSTSConfig): void;
|
|
62
66
|
audioChunk(message: {
|
|
63
67
|
audio: string;
|
|
64
68
|
}): void;
|
|
@@ -110,4 +114,4 @@ declare class Phonic {
|
|
|
110
114
|
}>;
|
|
111
115
|
}
|
|
112
116
|
|
|
113
|
-
export { Phonic, PhonicSTSWebSocket };
|
|
117
|
+
export { Phonic, type PhonicSTSConfig, PhonicSTSWebSocket };
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED