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 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
@@ -35,7 +35,7 @@ __export(index_exports, {
35
35
  module.exports = __toCommonJS(index_exports);
36
36
 
37
37
  // package.json
38
- var version = "0.6.0";
38
+ var version = "0.6.1";
39
39
 
40
40
  // src/sts/index.ts
41
41
  var import_ws = __toESM(require("ws"));
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.6.0";
2
+ var version = "0.6.1";
3
3
 
4
4
  // src/sts/index.ts
5
5
  import WebSocket from "ws";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phonic",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Phonic Node.js SDK",
5
5
  "scripts": {
6
6
  "build": "tsup",