phonic 0.30.38 → 0.30.40

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.
@@ -51,8 +51,8 @@ class PhonicClient {
51
51
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
52
52
  "X-Fern-Language": "JavaScript",
53
53
  "X-Fern-SDK-Name": "phonic",
54
- "X-Fern-SDK-Version": "0.30.38",
55
- "User-Agent": "phonic/0.30.38",
54
+ "X-Fern-SDK-Version": "0.30.40",
55
+ "User-Agent": "phonic/0.30.40",
56
56
  "X-Fern-Runtime": core.RUNTIME.type,
57
57
  "X-Fern-Runtime-Version": core.RUNTIME.version,
58
58
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -7,7 +7,7 @@ export declare namespace ConversationsSocket {
7
7
  interface Args {
8
8
  socket: core.ReconnectingWebSocket;
9
9
  }
10
- type Response = Phonic.ReadyToStartConversationPayload | Phonic.ConversationCreatedPayload | Phonic.InputTextPayload | Phonic.InputCancelledPayload | Phonic.AudioChunkResponsePayload | Phonic.UserStartedSpeakingPayload | Phonic.UserFinishedSpeakingPayload | Phonic.DtmfPayload | Phonic.ToolCallPayload | Phonic.ToolCallOutputProcessedPayload | Phonic.ToolCallInterruptedPayload | Phonic.AssistantChoseNotToRespondPayload | Phonic.AssistantEndedConversationPayload | Phonic.ErrorPayload;
10
+ type Response = Phonic.ReadyToStartConversationPayload | Phonic.ConversationCreatedPayload | Phonic.InputTextPayload | Phonic.InputCancelledPayload | Phonic.AudioChunkResponsePayload | Phonic.UserStartedSpeakingPayload | Phonic.UserFinishedSpeakingPayload | Phonic.DtmfPayload | Phonic.ToolCallPayload | Phonic.ToolCallOutputProcessedPayload | Phonic.ToolCallInterruptedPayload | Phonic.AssistantChoseNotToRespondPayload | Phonic.AssistantEndedConversationPayload | Phonic.AssistantStartedSpeakingPayload | Phonic.AssistantFinishedSpeakingPayload | Phonic.ErrorPayload;
11
11
  type EventHandlers = {
12
12
  open?: () => void;
13
13
  message?: (message: Response) => void;
@@ -40,8 +40,8 @@ export declare class ConversationsSocket {
40
40
  sendConfig(message: Phonic.ConfigPayload): void;
41
41
  sendAudioChunk(message: Phonic.AudioChunkPayload): void;
42
42
  sendUpdateSystemPrompt(message: Phonic.UpdateSystemPromptPayload): void;
43
+ sendAddSystemMessage(message: Phonic.AddSystemMessagePayload): void;
43
44
  sendSetExternalId(message: Phonic.SetExternalIdPayload): void;
44
- sendSetTwilioCallSid(message: Phonic.SetTwilioCallSidPayload): void;
45
45
  sendToolCallOutput(message: Phonic.ToolCallOutputPayload): void;
46
46
  /** Connect to the websocket and register event handlers. */
47
47
  connect(): ConversationsSocket;
@@ -60,5 +60,5 @@ export declare class ConversationsSocket {
60
60
  /** Send a binary payload to the websocket. */
61
61
  protected sendBinary(payload: ArrayBufferLike | Blob | ArrayBufferView): void;
62
62
  /** Send a JSON payload to the websocket. */
63
- protected sendJson(payload: Phonic.ConfigPayload | Phonic.AudioChunkPayload | Phonic.UpdateSystemPromptPayload | Phonic.SetExternalIdPayload | Phonic.SetTwilioCallSidPayload | Phonic.ToolCallOutputPayload): void;
63
+ protected sendJson(payload: Phonic.ConfigPayload | Phonic.AudioChunkPayload | Phonic.UpdateSystemPromptPayload | Phonic.AddSystemMessagePayload | Phonic.SetExternalIdPayload | Phonic.ToolCallOutputPayload): void;
64
64
  }
@@ -103,10 +103,10 @@ class ConversationsSocket {
103
103
  sendUpdateSystemPrompt(message) {
104
104
  this.sendWithBuffering(() => this.sendJson(message));
105
105
  }
106
- sendSetExternalId(message) {
106
+ sendAddSystemMessage(message) {
107
107
  this.sendWithBuffering(() => this.sendJson(message));
108
108
  }
109
- sendSetTwilioCallSid(message) {
109
+ sendSetExternalId(message) {
110
110
  this.sendWithBuffering(() => this.sendJson(message));
111
111
  }
112
112
  sendToolCallOutput(message) {
@@ -35,10 +35,6 @@ export interface ConfigPayload {
35
35
  vad_min_silence_duration_ms?: number;
36
36
  /** Voice activity detection threshold */
37
37
  vad_threshold?: number;
38
- /** Enable document RAG */
39
- enable_documents_rag?: boolean;
40
- /** Enable transcript RAG */
41
- enable_transcripts_rag?: boolean;
42
38
  /** Whether to have the no-input poke text be generated by AI */
43
39
  generate_no_input_poke_text?: boolean;
44
40
  /** Seconds of silence before poke message */
@@ -51,8 +47,8 @@ export interface ConfigPayload {
51
47
  recognized_languages?: string[];
52
48
  /** Keywords to boost in speech recognition */
53
49
  boosted_keywords?: string[];
54
- /** Tools available to the assistant */
55
- tools?: string[];
50
+ /** Names of tools available to the assistant. */
51
+ tools?: ConfigPayload.Tools.Item[];
56
52
  /** Template variables for system prompt and welcome message */
57
53
  template_variables?: Record<string, string>;
58
54
  }
@@ -86,4 +82,8 @@ export declare namespace ConfigPayload {
86
82
  readonly Pcm8000: "pcm_8000";
87
83
  readonly Mulaw8000: "mulaw_8000";
88
84
  };
85
+ type Tools = Tools.Item[];
86
+ namespace Tools {
87
+ type Item = string | Record<string, unknown>;
88
+ }
89
89
  }
@@ -23,6 +23,8 @@ export interface Conversation {
23
23
  welcome_message: string | null;
24
24
  /** Template variables used in the conversation. */
25
25
  template_variables: Record<string, string>;
26
+ /** System prompt used in the conversation. */
27
+ system_prompt?: string;
26
28
  /** Audio input format. */
27
29
  input_format: string;
28
30
  /** Audio output format. */
@@ -26,7 +26,6 @@ export * from "./AudioChunkPayload.js";
26
26
  export * from "./UpdateSystemPromptPayload.js";
27
27
  export * from "./AddSystemMessagePayload.js";
28
28
  export * from "./SetExternalIdPayload.js";
29
- export * from "./SetTwilioCallSidPayload.js";
30
29
  export * from "./ToolCallOutputPayload.js";
31
30
  export * from "./ReadyToStartConversationPayload.js";
32
31
  export * from "./ConversationCreatedPayload.js";
@@ -37,7 +36,6 @@ export * from "./UserStartedSpeakingPayload.js";
37
36
  export * from "./UserFinishedSpeakingPayload.js";
38
37
  export * from "./AssistantStartedSpeakingPayload.js";
39
38
  export * from "./AssistantFinishedSpeakingPayload.js";
40
- export * from "./IsUserSpeakingPayload.js";
41
39
  export * from "./DtmfPayload.js";
42
40
  export * from "./ToolCallPayload.js";
43
41
  export * from "./ToolCallOutputProcessedPayload.js";
@@ -42,7 +42,6 @@ __exportStar(require("./AudioChunkPayload.js"), exports);
42
42
  __exportStar(require("./UpdateSystemPromptPayload.js"), exports);
43
43
  __exportStar(require("./AddSystemMessagePayload.js"), exports);
44
44
  __exportStar(require("./SetExternalIdPayload.js"), exports);
45
- __exportStar(require("./SetTwilioCallSidPayload.js"), exports);
46
45
  __exportStar(require("./ToolCallOutputPayload.js"), exports);
47
46
  __exportStar(require("./ReadyToStartConversationPayload.js"), exports);
48
47
  __exportStar(require("./ConversationCreatedPayload.js"), exports);
@@ -53,7 +52,6 @@ __exportStar(require("./UserStartedSpeakingPayload.js"), exports);
53
52
  __exportStar(require("./UserFinishedSpeakingPayload.js"), exports);
54
53
  __exportStar(require("./AssistantStartedSpeakingPayload.js"), exports);
55
54
  __exportStar(require("./AssistantFinishedSpeakingPayload.js"), exports);
56
- __exportStar(require("./IsUserSpeakingPayload.js"), exports);
57
55
  __exportStar(require("./DtmfPayload.js"), exports);
58
56
  __exportStar(require("./ToolCallPayload.js"), exports);
59
57
  __exportStar(require("./ToolCallOutputProcessedPayload.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.30.38";
1
+ export declare const SDK_VERSION = "0.30.40";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.30.38";
4
+ exports.SDK_VERSION = "0.30.40";
@@ -15,8 +15,8 @@ export class PhonicClient {
15
15
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
16
16
  "X-Fern-Language": "JavaScript",
17
17
  "X-Fern-SDK-Name": "phonic",
18
- "X-Fern-SDK-Version": "0.30.38",
19
- "User-Agent": "phonic/0.30.38",
18
+ "X-Fern-SDK-Version": "0.30.40",
19
+ "User-Agent": "phonic/0.30.40",
20
20
  "X-Fern-Runtime": core.RUNTIME.type,
21
21
  "X-Fern-Runtime-Version": core.RUNTIME.version,
22
22
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -7,7 +7,7 @@ export declare namespace ConversationsSocket {
7
7
  interface Args {
8
8
  socket: core.ReconnectingWebSocket;
9
9
  }
10
- type Response = Phonic.ReadyToStartConversationPayload | Phonic.ConversationCreatedPayload | Phonic.InputTextPayload | Phonic.InputCancelledPayload | Phonic.AudioChunkResponsePayload | Phonic.UserStartedSpeakingPayload | Phonic.UserFinishedSpeakingPayload | Phonic.DtmfPayload | Phonic.ToolCallPayload | Phonic.ToolCallOutputProcessedPayload | Phonic.ToolCallInterruptedPayload | Phonic.AssistantChoseNotToRespondPayload | Phonic.AssistantEndedConversationPayload | Phonic.ErrorPayload;
10
+ type Response = Phonic.ReadyToStartConversationPayload | Phonic.ConversationCreatedPayload | Phonic.InputTextPayload | Phonic.InputCancelledPayload | Phonic.AudioChunkResponsePayload | Phonic.UserStartedSpeakingPayload | Phonic.UserFinishedSpeakingPayload | Phonic.DtmfPayload | Phonic.ToolCallPayload | Phonic.ToolCallOutputProcessedPayload | Phonic.ToolCallInterruptedPayload | Phonic.AssistantChoseNotToRespondPayload | Phonic.AssistantEndedConversationPayload | Phonic.AssistantStartedSpeakingPayload | Phonic.AssistantFinishedSpeakingPayload | Phonic.ErrorPayload;
11
11
  type EventHandlers = {
12
12
  open?: () => void;
13
13
  message?: (message: Response) => void;
@@ -40,8 +40,8 @@ export declare class ConversationsSocket {
40
40
  sendConfig(message: Phonic.ConfigPayload): void;
41
41
  sendAudioChunk(message: Phonic.AudioChunkPayload): void;
42
42
  sendUpdateSystemPrompt(message: Phonic.UpdateSystemPromptPayload): void;
43
+ sendAddSystemMessage(message: Phonic.AddSystemMessagePayload): void;
43
44
  sendSetExternalId(message: Phonic.SetExternalIdPayload): void;
44
- sendSetTwilioCallSid(message: Phonic.SetTwilioCallSidPayload): void;
45
45
  sendToolCallOutput(message: Phonic.ToolCallOutputPayload): void;
46
46
  /** Connect to the websocket and register event handlers. */
47
47
  connect(): ConversationsSocket;
@@ -60,5 +60,5 @@ export declare class ConversationsSocket {
60
60
  /** Send a binary payload to the websocket. */
61
61
  protected sendBinary(payload: ArrayBufferLike | Blob | ArrayBufferView): void;
62
62
  /** Send a JSON payload to the websocket. */
63
- protected sendJson(payload: Phonic.ConfigPayload | Phonic.AudioChunkPayload | Phonic.UpdateSystemPromptPayload | Phonic.SetExternalIdPayload | Phonic.SetTwilioCallSidPayload | Phonic.ToolCallOutputPayload): void;
63
+ protected sendJson(payload: Phonic.ConfigPayload | Phonic.AudioChunkPayload | Phonic.UpdateSystemPromptPayload | Phonic.AddSystemMessagePayload | Phonic.SetExternalIdPayload | Phonic.ToolCallOutputPayload): void;
64
64
  }
@@ -67,10 +67,10 @@ export class ConversationsSocket {
67
67
  sendUpdateSystemPrompt(message) {
68
68
  this.sendWithBuffering(() => this.sendJson(message));
69
69
  }
70
- sendSetExternalId(message) {
70
+ sendAddSystemMessage(message) {
71
71
  this.sendWithBuffering(() => this.sendJson(message));
72
72
  }
73
- sendSetTwilioCallSid(message) {
73
+ sendSetExternalId(message) {
74
74
  this.sendWithBuffering(() => this.sendJson(message));
75
75
  }
76
76
  sendToolCallOutput(message) {
@@ -35,10 +35,6 @@ export interface ConfigPayload {
35
35
  vad_min_silence_duration_ms?: number;
36
36
  /** Voice activity detection threshold */
37
37
  vad_threshold?: number;
38
- /** Enable document RAG */
39
- enable_documents_rag?: boolean;
40
- /** Enable transcript RAG */
41
- enable_transcripts_rag?: boolean;
42
38
  /** Whether to have the no-input poke text be generated by AI */
43
39
  generate_no_input_poke_text?: boolean;
44
40
  /** Seconds of silence before poke message */
@@ -51,8 +47,8 @@ export interface ConfigPayload {
51
47
  recognized_languages?: string[];
52
48
  /** Keywords to boost in speech recognition */
53
49
  boosted_keywords?: string[];
54
- /** Tools available to the assistant */
55
- tools?: string[];
50
+ /** Names of tools available to the assistant. */
51
+ tools?: ConfigPayload.Tools.Item[];
56
52
  /** Template variables for system prompt and welcome message */
57
53
  template_variables?: Record<string, string>;
58
54
  }
@@ -86,4 +82,8 @@ export declare namespace ConfigPayload {
86
82
  readonly Pcm8000: "pcm_8000";
87
83
  readonly Mulaw8000: "mulaw_8000";
88
84
  };
85
+ type Tools = Tools.Item[];
86
+ namespace Tools {
87
+ type Item = string | Record<string, unknown>;
88
+ }
89
89
  }
@@ -23,6 +23,8 @@ export interface Conversation {
23
23
  welcome_message: string | null;
24
24
  /** Template variables used in the conversation. */
25
25
  template_variables: Record<string, string>;
26
+ /** System prompt used in the conversation. */
27
+ system_prompt?: string;
26
28
  /** Audio input format. */
27
29
  input_format: string;
28
30
  /** Audio output format. */
@@ -26,7 +26,6 @@ export * from "./AudioChunkPayload.mjs";
26
26
  export * from "./UpdateSystemPromptPayload.mjs";
27
27
  export * from "./AddSystemMessagePayload.mjs";
28
28
  export * from "./SetExternalIdPayload.mjs";
29
- export * from "./SetTwilioCallSidPayload.mjs";
30
29
  export * from "./ToolCallOutputPayload.mjs";
31
30
  export * from "./ReadyToStartConversationPayload.mjs";
32
31
  export * from "./ConversationCreatedPayload.mjs";
@@ -37,7 +36,6 @@ export * from "./UserStartedSpeakingPayload.mjs";
37
36
  export * from "./UserFinishedSpeakingPayload.mjs";
38
37
  export * from "./AssistantStartedSpeakingPayload.mjs";
39
38
  export * from "./AssistantFinishedSpeakingPayload.mjs";
40
- export * from "./IsUserSpeakingPayload.mjs";
41
39
  export * from "./DtmfPayload.mjs";
42
40
  export * from "./ToolCallPayload.mjs";
43
41
  export * from "./ToolCallOutputProcessedPayload.mjs";
@@ -26,7 +26,6 @@ export * from "./AudioChunkPayload.mjs";
26
26
  export * from "./UpdateSystemPromptPayload.mjs";
27
27
  export * from "./AddSystemMessagePayload.mjs";
28
28
  export * from "./SetExternalIdPayload.mjs";
29
- export * from "./SetTwilioCallSidPayload.mjs";
30
29
  export * from "./ToolCallOutputPayload.mjs";
31
30
  export * from "./ReadyToStartConversationPayload.mjs";
32
31
  export * from "./ConversationCreatedPayload.mjs";
@@ -37,7 +36,6 @@ export * from "./UserStartedSpeakingPayload.mjs";
37
36
  export * from "./UserFinishedSpeakingPayload.mjs";
38
37
  export * from "./AssistantStartedSpeakingPayload.mjs";
39
38
  export * from "./AssistantFinishedSpeakingPayload.mjs";
40
- export * from "./IsUserSpeakingPayload.mjs";
41
39
  export * from "./DtmfPayload.mjs";
42
40
  export * from "./ToolCallPayload.mjs";
43
41
  export * from "./ToolCallOutputProcessedPayload.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.30.38";
1
+ export declare const SDK_VERSION = "0.30.40";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.30.38";
1
+ export const SDK_VERSION = "0.30.40";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phonic",
3
- "version": "0.30.38",
3
+ "version": "0.30.40",
4
4
  "private": false,
5
5
  "repository": "github:Phonic-Co/phonic-node",
6
6
  "type": "commonjs",