phonic 0.18.4 → 0.18.6

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/README.md CHANGED
@@ -108,12 +108,13 @@ const { data, error } = await phonic.sts.outboundCall("+19189396241", {
108
108
  vad_min_speech_duration_ms: 40,
109
109
  vad_min_silence_duration_ms: 550,
110
110
  vad_threshold: 0.6,
111
+ tools: ["send_dtmf_tone", "end_conversation"], // these are the only available tools so far
111
112
  });
112
113
  ```
113
114
 
114
115
  ### STS outbound call using own Twilio account
115
116
 
116
- In Twilio, create a restricted API key with the following permission: voice -> calls -> create
117
+ In Twilio, create a restricted API key with the following permissions: `voice -> calls -> read` and `voice -> calls -> create`.
117
118
 
118
119
  ```ts
119
120
  const { data, error } = await phonic.sts.twilio.outboundCall(
@@ -135,6 +136,7 @@ const { data, error } = await phonic.sts.twilio.outboundCall(
135
136
  vad_min_speech_duration_ms: 40,
136
137
  vad_min_silence_duration_ms: 550,
137
138
  vad_threshold: 0.6,
139
+ tools: ["send_dtmf_tone", "end_conversation"], // these are the only available tools so far
138
140
  }
139
141
  );
140
142
  ```
@@ -158,6 +160,7 @@ const phonicWebSocket = phonic.sts.websocket({
158
160
  vad_min_speech_duration_ms: 40,
159
161
  vad_min_silence_duration_ms: 550,
160
162
  vad_threshold: 0.6,
163
+ tools: ["send_dtmf_tone", "end_conversation"], // these are the only available tools so far
161
164
  });
162
165
  ```
163
166
 
@@ -278,6 +281,16 @@ Sent after the last "audio_chunk" is sent.
278
281
 
279
282
  Sent when the user interrupts the assistant, after the user has finished speaking.
280
283
 
284
+ #### `assistant_ended_conversation`
285
+
286
+ ```ts
287
+ {
288
+ type: "assistant_ended_conversation";
289
+ }
290
+ ```
291
+
292
+ Sent when the assistant decides to end the conversation.
293
+
281
294
  ## License
282
295
 
283
296
  MIT
package/dist/index.d.mts CHANGED
@@ -80,6 +80,7 @@ declare class Conversations {
80
80
  }): DataOrError<ConversationsSuccessResponse>;
81
81
  }
82
82
 
83
+ type PhonicSTSTool = "send_dtmf_tone" | "end_conversation";
83
84
  type PhonicSTSConfig = {
84
85
  project: string;
85
86
  input_format: "pcm_44100" | "mulaw_8000";
@@ -89,7 +90,7 @@ type PhonicSTSConfig = {
89
90
  output_format?: "pcm_44100" | "mulaw_8000";
90
91
  enable_silent_audio_fallback?: boolean;
91
92
  experimental_params?: Record<string, unknown>;
92
- tools?: string[];
93
+ tools?: Array<PhonicSTSTool>;
93
94
  vad_prebuffer_duration_ms?: number;
94
95
  vad_min_speech_duration_ms?: number;
95
96
  vad_min_silence_duration_ms?: number;
@@ -110,6 +111,8 @@ type PhonicSTSWebSocketResponseMessage = {
110
111
  } | {
111
112
  type: "interrupted_response";
112
113
  interruptedResponse: string;
114
+ } | {
115
+ type: "assistant_ended_conversation";
113
116
  } | {
114
117
  type: "error";
115
118
  error: {
package/dist/index.d.ts CHANGED
@@ -80,6 +80,7 @@ declare class Conversations {
80
80
  }): DataOrError<ConversationsSuccessResponse>;
81
81
  }
82
82
 
83
+ type PhonicSTSTool = "send_dtmf_tone" | "end_conversation";
83
84
  type PhonicSTSConfig = {
84
85
  project: string;
85
86
  input_format: "pcm_44100" | "mulaw_8000";
@@ -89,7 +90,7 @@ type PhonicSTSConfig = {
89
90
  output_format?: "pcm_44100" | "mulaw_8000";
90
91
  enable_silent_audio_fallback?: boolean;
91
92
  experimental_params?: Record<string, unknown>;
92
- tools?: string[];
93
+ tools?: Array<PhonicSTSTool>;
93
94
  vad_prebuffer_duration_ms?: number;
94
95
  vad_min_speech_duration_ms?: number;
95
96
  vad_min_silence_duration_ms?: number;
@@ -110,6 +111,8 @@ type PhonicSTSWebSocketResponseMessage = {
110
111
  } | {
111
112
  type: "interrupted_response";
112
113
  interruptedResponse: string;
114
+ } | {
115
+ type: "assistant_ended_conversation";
113
116
  } | {
114
117
  type: "error";
115
118
  error: {
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.18.4";
38
+ var version = "0.18.6";
39
39
 
40
40
  // src/conversations/index.ts
41
41
  var Conversations = class {
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.18.4";
2
+ var version = "0.18.6";
3
3
 
4
4
  // src/conversations/index.ts
5
5
  var Conversations = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phonic",
3
- "version": "0.18.4",
3
+ "version": "0.18.6",
4
4
  "description": "Phonic Node.js SDK",
5
5
  "scripts": {
6
6
  "build": "tsup",