phonic 0.31.10 → 0.31.12
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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/agents/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/agents/client/Client.js +3 -0
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +3 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +3 -0
- package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +1 -0
- package/dist/cjs/api/resources/conversations/client/Socket.d.ts +3 -1
- package/dist/cjs/api/resources/conversations/client/Socket.js +8 -0
- package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.d.ts +1 -0
- package/dist/cjs/api/types/Agent.d.ts +2 -0
- package/dist/cjs/api/types/ConfigOptions.d.ts +2 -0
- package/dist/cjs/api/types/Conversation.d.ts +2 -0
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +2 -0
- package/dist/cjs/api/types/MutePayload.d.ts +3 -0
- package/dist/cjs/api/types/MutePayload.js +3 -0
- package/dist/cjs/api/types/OutboundCallConfig.d.ts +2 -0
- package/dist/cjs/api/types/UnmutePayload.d.ts +3 -0
- package/dist/cjs/api/types/UnmutePayload.js +3 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/custom/ReconnectableConversationsSocket.d.ts +2 -0
- package/dist/cjs/custom/ReconnectableConversationsSocket.js +6 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/agents/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/agents/client/Client.mjs +3 -0
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +3 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +3 -0
- package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +1 -0
- package/dist/esm/api/resources/conversations/client/Socket.d.mts +3 -1
- package/dist/esm/api/resources/conversations/client/Socket.mjs +8 -0
- package/dist/esm/api/resources/conversations/client/requests/OutboundCallRequest.d.mts +1 -0
- package/dist/esm/api/types/Agent.d.mts +2 -0
- package/dist/esm/api/types/ConfigOptions.d.mts +2 -0
- package/dist/esm/api/types/Conversation.d.mts +2 -0
- package/dist/esm/api/types/CreateAgentRequest.d.mts +2 -0
- package/dist/esm/api/types/MutePayload.d.mts +3 -0
- package/dist/esm/api/types/MutePayload.mjs +2 -0
- package/dist/esm/api/types/OutboundCallConfig.d.mts +2 -0
- package/dist/esm/api/types/UnmutePayload.d.mts +3 -0
- package/dist/esm/api/types/UnmutePayload.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/custom/ReconnectableConversationsSocket.d.mts +2 -0
- package/dist/esm/custom/ReconnectableConversationsSocket.mjs +6 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -1
- package/reference.md +4 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Phonic.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "phonic",
|
|
46
|
-
"X-Fern-SDK-Version": "0.31.
|
|
47
|
-
"User-Agent": "phonic/0.31.
|
|
46
|
+
"X-Fern-SDK-Version": "0.31.12",
|
|
47
|
+
"User-Agent": "phonic/0.31.12",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -62,6 +62,7 @@ export declare class AgentsClient {
|
|
|
62
62
|
* default_language: "en",
|
|
63
63
|
* additional_languages: ["es"],
|
|
64
64
|
* multilingual_mode: "request",
|
|
65
|
+
* push_to_talk: false,
|
|
65
66
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
66
67
|
* min_words_to_interrupt: 1,
|
|
67
68
|
* configuration_endpoint: {
|
|
@@ -111,6 +112,7 @@ export declare class AgentsClient {
|
|
|
111
112
|
* default_language: "en",
|
|
112
113
|
* additional_languages: ["es"],
|
|
113
114
|
* multilingual_mode: "request",
|
|
115
|
+
* push_to_talk: false,
|
|
114
116
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
115
117
|
* min_words_to_interrupt: 1,
|
|
116
118
|
* configuration_endpoint: {
|
|
@@ -196,6 +198,7 @@ export declare class AgentsClient {
|
|
|
196
198
|
* default_language: "en",
|
|
197
199
|
* additional_languages: ["es"],
|
|
198
200
|
* multilingual_mode: "request",
|
|
201
|
+
* push_to_talk: false,
|
|
199
202
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
200
203
|
* min_words_to_interrupt: 1,
|
|
201
204
|
* configuration_endpoint: {
|
|
@@ -160,6 +160,7 @@ class AgentsClient {
|
|
|
160
160
|
* default_language: "en",
|
|
161
161
|
* additional_languages: ["es"],
|
|
162
162
|
* multilingual_mode: "request",
|
|
163
|
+
* push_to_talk: false,
|
|
163
164
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
164
165
|
* min_words_to_interrupt: 1,
|
|
165
166
|
* configuration_endpoint: {
|
|
@@ -258,6 +259,7 @@ class AgentsClient {
|
|
|
258
259
|
* default_language: "en",
|
|
259
260
|
* additional_languages: ["es"],
|
|
260
261
|
* multilingual_mode: "request",
|
|
262
|
+
* push_to_talk: false,
|
|
261
263
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
262
264
|
* min_words_to_interrupt: 1,
|
|
263
265
|
* configuration_endpoint: {
|
|
@@ -472,6 +474,7 @@ class AgentsClient {
|
|
|
472
474
|
* default_language: "en",
|
|
473
475
|
* additional_languages: ["es"],
|
|
474
476
|
* multilingual_mode: "request",
|
|
477
|
+
* push_to_talk: false,
|
|
475
478
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
476
479
|
* min_words_to_interrupt: 1,
|
|
477
480
|
* configuration_endpoint: {
|
|
@@ -27,6 +27,7 @@ import type * as Phonic from "../../../../index.js";
|
|
|
27
27
|
* default_language: "en",
|
|
28
28
|
* additional_languages: ["es"],
|
|
29
29
|
* multilingual_mode: "request",
|
|
30
|
+
* push_to_talk: false,
|
|
30
31
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
31
32
|
* min_words_to_interrupt: 1,
|
|
32
33
|
* configuration_endpoint: {
|
|
@@ -89,6 +90,8 @@ export interface AgentsCreateRequest {
|
|
|
89
90
|
languages?: Phonic.LanguageCode[];
|
|
90
91
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
91
92
|
multilingual_mode?: Phonic.CreateAgentRequest.MultilingualMode;
|
|
93
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
94
|
+
push_to_talk?: boolean;
|
|
92
95
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
93
96
|
boosted_keywords?: string[];
|
|
94
97
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -27,6 +27,7 @@ import type * as Phonic from "../../../../index.js";
|
|
|
27
27
|
* default_language: "en",
|
|
28
28
|
* additional_languages: ["es"],
|
|
29
29
|
* multilingual_mode: "request",
|
|
30
|
+
* push_to_talk: false,
|
|
30
31
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
31
32
|
* min_words_to_interrupt: 1,
|
|
32
33
|
* configuration_endpoint: {
|
|
@@ -89,6 +90,8 @@ export interface UpdateAgentRequest {
|
|
|
89
90
|
languages?: Phonic.LanguageCode[];
|
|
90
91
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
91
92
|
multilingual_mode?: UpdateAgentRequest.MultilingualMode;
|
|
93
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
94
|
+
push_to_talk?: boolean;
|
|
92
95
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
93
96
|
boosted_keywords?: string[];
|
|
94
97
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -27,6 +27,7 @@ import type * as Phonic from "../../../../index.js";
|
|
|
27
27
|
* default_language: "en",
|
|
28
28
|
* additional_languages: ["es"],
|
|
29
29
|
* multilingual_mode: "request",
|
|
30
|
+
* push_to_talk: false,
|
|
30
31
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
31
32
|
* min_words_to_interrupt: 1,
|
|
32
33
|
* configuration_endpoint: {
|
|
@@ -39,6 +39,8 @@ export declare class ConversationsSocket {
|
|
|
39
39
|
sendAddSystemMessage(message: Phonic.AddSystemMessagePayload): void;
|
|
40
40
|
sendSetExternalId(message: Phonic.SetExternalIdPayload): void;
|
|
41
41
|
sendToolCallOutput(message: Phonic.ToolCallOutputPayload): void;
|
|
42
|
+
sendUnmute(message: Phonic.UnmutePayload): void;
|
|
43
|
+
sendMute(message: Phonic.MutePayload): void;
|
|
42
44
|
sendGenerateReply(message: Phonic.GenerateReplyPayload): void;
|
|
43
45
|
sendSay(message: Phonic.SayPayload): void;
|
|
44
46
|
sendReset(message: Phonic.ResetPayload): void;
|
|
@@ -53,5 +55,5 @@ export declare class ConversationsSocket {
|
|
|
53
55
|
/** Send a binary payload to the websocket. */
|
|
54
56
|
protected sendBinary(payload: ArrayBuffer | Blob | ArrayBufferView): void;
|
|
55
57
|
/** Send a JSON payload to the websocket. */
|
|
56
|
-
protected sendJson(payload: Phonic.ConfigPayload | Phonic.AudioChunkPayload | Phonic.UpdateSystemPromptPayload | Phonic.AddSystemMessagePayload | Phonic.SetExternalIdPayload | Phonic.ToolCallOutputPayload | Phonic.GenerateReplyPayload | Phonic.SayPayload | Phonic.ResetPayload): void;
|
|
58
|
+
protected sendJson(payload: Phonic.ConfigPayload | Phonic.AudioChunkPayload | Phonic.UpdateSystemPromptPayload | Phonic.AddSystemMessagePayload | Phonic.SetExternalIdPayload | Phonic.ToolCallOutputPayload | Phonic.UnmutePayload | Phonic.MutePayload | Phonic.GenerateReplyPayload | Phonic.SayPayload | Phonic.ResetPayload): void;
|
|
57
59
|
}
|
|
@@ -114,6 +114,14 @@ class ConversationsSocket {
|
|
|
114
114
|
this.assertSocketIsOpen();
|
|
115
115
|
this.sendJson(message);
|
|
116
116
|
}
|
|
117
|
+
sendUnmute(message) {
|
|
118
|
+
this.assertSocketIsOpen();
|
|
119
|
+
this.sendJson(message);
|
|
120
|
+
}
|
|
121
|
+
sendMute(message) {
|
|
122
|
+
this.assertSocketIsOpen();
|
|
123
|
+
this.sendJson(message);
|
|
124
|
+
}
|
|
117
125
|
sendGenerateReply(message) {
|
|
118
126
|
this.assertSocketIsOpen();
|
|
119
127
|
this.sendJson(message);
|
|
@@ -19,6 +19,7 @@ import type * as Phonic from "../../../../index.js";
|
|
|
19
19
|
* default_language: "en",
|
|
20
20
|
* additional_languages: ["es"],
|
|
21
21
|
* multilingual_mode: "request",
|
|
22
|
+
* push_to_talk: false,
|
|
22
23
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
23
24
|
* min_words_to_interrupt: 1,
|
|
24
25
|
* tools: ["keypad_input"]
|
|
@@ -50,6 +50,8 @@ export interface Agent {
|
|
|
50
50
|
languages?: Phonic.LanguageCode[] | undefined;
|
|
51
51
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
52
52
|
multilingual_mode: Agent.MultilingualMode;
|
|
53
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
54
|
+
push_to_talk: boolean;
|
|
53
55
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
54
56
|
boosted_keywords: string[];
|
|
55
57
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -50,6 +50,8 @@ export interface ConfigOptions {
|
|
|
50
50
|
additional_languages?: string[] | undefined;
|
|
51
51
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
52
52
|
multilingual_mode?: ConfigOptions.MultilingualMode | undefined;
|
|
53
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
54
|
+
push_to_talk?: boolean | undefined;
|
|
53
55
|
/** Keywords to boost in speech recognition */
|
|
54
56
|
boosted_keywords?: string[] | undefined;
|
|
55
57
|
/** Names of tools available to the assistant. */
|
|
@@ -54,6 +54,8 @@ export interface Conversation {
|
|
|
54
54
|
additional_languages: string[] | null;
|
|
55
55
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
56
56
|
multilingual_mode: Conversation.MultilingualMode;
|
|
57
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
58
|
+
push_to_talk: boolean;
|
|
57
59
|
/** Array of ISO 639-1 language codes recognized by the model. This field is deprecated. Use `default_language` and `additional_languages` instead. */
|
|
58
60
|
languages?: (string[] | null) | undefined;
|
|
59
61
|
/** Whether the no-input poke text was generated by AI. */
|
|
@@ -48,6 +48,8 @@ export interface CreateAgentRequest {
|
|
|
48
48
|
languages?: Phonic.LanguageCode[] | undefined;
|
|
49
49
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
50
50
|
multilingual_mode?: CreateAgentRequest.MultilingualMode | undefined;
|
|
51
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
52
|
+
push_to_talk?: boolean | undefined;
|
|
51
53
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
52
54
|
boosted_keywords?: string[] | undefined;
|
|
53
55
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -31,6 +31,8 @@ export interface OutboundCallConfig {
|
|
|
31
31
|
languages?: Phonic.LanguageCode[] | undefined;
|
|
32
32
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
33
33
|
multilingual_mode?: OutboundCallConfig.MultilingualMode | undefined;
|
|
34
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
35
|
+
push_to_talk?: boolean | undefined;
|
|
34
36
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
35
37
|
boosted_keywords?: string[] | undefined;
|
|
36
38
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -29,6 +29,7 @@ export * from "./GenerateReplyPayload.js";
|
|
|
29
29
|
export * from "./InputCancelledPayload.js";
|
|
30
30
|
export * from "./InputTextPayload.js";
|
|
31
31
|
export * from "./LanguageCode.js";
|
|
32
|
+
export * from "./MutePayload.js";
|
|
32
33
|
export * from "./OutboundCallConfig.js";
|
|
33
34
|
export * from "./OutboundCallInitiatedResponse.js";
|
|
34
35
|
export * from "./OutboundDryRunResponse.js";
|
|
@@ -46,6 +47,7 @@ export * from "./ToolCallOutputPayload.js";
|
|
|
46
47
|
export * from "./ToolCallOutputProcessedPayload.js";
|
|
47
48
|
export * from "./ToolCallPayload.js";
|
|
48
49
|
export * from "./ToolParameter.js";
|
|
50
|
+
export * from "./UnmutePayload.js";
|
|
49
51
|
export * from "./UpdateSystemPromptPayload.js";
|
|
50
52
|
export * from "./UserFinishedSpeakingPayload.js";
|
|
51
53
|
export * from "./UserStartedSpeakingPayload.js";
|
|
@@ -45,6 +45,7 @@ __exportStar(require("./GenerateReplyPayload.js"), exports);
|
|
|
45
45
|
__exportStar(require("./InputCancelledPayload.js"), exports);
|
|
46
46
|
__exportStar(require("./InputTextPayload.js"), exports);
|
|
47
47
|
__exportStar(require("./LanguageCode.js"), exports);
|
|
48
|
+
__exportStar(require("./MutePayload.js"), exports);
|
|
48
49
|
__exportStar(require("./OutboundCallConfig.js"), exports);
|
|
49
50
|
__exportStar(require("./OutboundCallInitiatedResponse.js"), exports);
|
|
50
51
|
__exportStar(require("./OutboundDryRunResponse.js"), exports);
|
|
@@ -62,6 +63,7 @@ __exportStar(require("./ToolCallOutputPayload.js"), exports);
|
|
|
62
63
|
__exportStar(require("./ToolCallOutputProcessedPayload.js"), exports);
|
|
63
64
|
__exportStar(require("./ToolCallPayload.js"), exports);
|
|
64
65
|
__exportStar(require("./ToolParameter.js"), exports);
|
|
66
|
+
__exportStar(require("./UnmutePayload.js"), exports);
|
|
65
67
|
__exportStar(require("./UpdateSystemPromptPayload.js"), exports);
|
|
66
68
|
__exportStar(require("./UserFinishedSpeakingPayload.js"), exports);
|
|
67
69
|
__exportStar(require("./UserStartedSpeakingPayload.js"), exports);
|
|
@@ -57,6 +57,8 @@ export declare class ReconnectableConversationsSocket {
|
|
|
57
57
|
sendGenerateReply(message: Phonic.GenerateReplyPayload): void;
|
|
58
58
|
sendSay(message: Phonic.SayPayload): void;
|
|
59
59
|
sendReset(message: Phonic.ResetPayload): void;
|
|
60
|
+
sendMute(message: Phonic.MutePayload): void;
|
|
61
|
+
sendUnmute(message: Phonic.UnmutePayload): void;
|
|
60
62
|
/**
|
|
61
63
|
* Not supported — reconnection after 1006 is handled automatically.
|
|
62
64
|
* To start a new conversation, create a new socket via client.conversations.connect().
|
|
@@ -134,6 +134,12 @@ class ReconnectableConversationsSocket {
|
|
|
134
134
|
sendReset(message) {
|
|
135
135
|
this._safeSend((inner) => inner.sendReset(message));
|
|
136
136
|
}
|
|
137
|
+
sendMute(message) {
|
|
138
|
+
this._safeSend((inner) => inner.sendMute(message));
|
|
139
|
+
}
|
|
140
|
+
sendUnmute(message) {
|
|
141
|
+
this._safeSend((inner) => inner.sendUnmute(message));
|
|
142
|
+
}
|
|
137
143
|
/**
|
|
138
144
|
* Not supported — reconnection after 1006 is handled automatically.
|
|
139
145
|
* To start a new conversation, create a new socket via client.conversations.connect().
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.31.
|
|
1
|
+
export declare const SDK_VERSION = "0.31.12";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "phonic",
|
|
9
|
-
"X-Fern-SDK-Version": "0.31.
|
|
10
|
-
"User-Agent": "phonic/0.31.
|
|
9
|
+
"X-Fern-SDK-Version": "0.31.12",
|
|
10
|
+
"User-Agent": "phonic/0.31.12",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -62,6 +62,7 @@ export declare class AgentsClient {
|
|
|
62
62
|
* default_language: "en",
|
|
63
63
|
* additional_languages: ["es"],
|
|
64
64
|
* multilingual_mode: "request",
|
|
65
|
+
* push_to_talk: false,
|
|
65
66
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
66
67
|
* min_words_to_interrupt: 1,
|
|
67
68
|
* configuration_endpoint: {
|
|
@@ -111,6 +112,7 @@ export declare class AgentsClient {
|
|
|
111
112
|
* default_language: "en",
|
|
112
113
|
* additional_languages: ["es"],
|
|
113
114
|
* multilingual_mode: "request",
|
|
115
|
+
* push_to_talk: false,
|
|
114
116
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
115
117
|
* min_words_to_interrupt: 1,
|
|
116
118
|
* configuration_endpoint: {
|
|
@@ -196,6 +198,7 @@ export declare class AgentsClient {
|
|
|
196
198
|
* default_language: "en",
|
|
197
199
|
* additional_languages: ["es"],
|
|
198
200
|
* multilingual_mode: "request",
|
|
201
|
+
* push_to_talk: false,
|
|
199
202
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
200
203
|
* min_words_to_interrupt: 1,
|
|
201
204
|
* configuration_endpoint: {
|
|
@@ -124,6 +124,7 @@ export class AgentsClient {
|
|
|
124
124
|
* default_language: "en",
|
|
125
125
|
* additional_languages: ["es"],
|
|
126
126
|
* multilingual_mode: "request",
|
|
127
|
+
* push_to_talk: false,
|
|
127
128
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
128
129
|
* min_words_to_interrupt: 1,
|
|
129
130
|
* configuration_endpoint: {
|
|
@@ -222,6 +223,7 @@ export class AgentsClient {
|
|
|
222
223
|
* default_language: "en",
|
|
223
224
|
* additional_languages: ["es"],
|
|
224
225
|
* multilingual_mode: "request",
|
|
226
|
+
* push_to_talk: false,
|
|
225
227
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
226
228
|
* min_words_to_interrupt: 1,
|
|
227
229
|
* configuration_endpoint: {
|
|
@@ -436,6 +438,7 @@ export class AgentsClient {
|
|
|
436
438
|
* default_language: "en",
|
|
437
439
|
* additional_languages: ["es"],
|
|
438
440
|
* multilingual_mode: "request",
|
|
441
|
+
* push_to_talk: false,
|
|
439
442
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
440
443
|
* min_words_to_interrupt: 1,
|
|
441
444
|
* configuration_endpoint: {
|
|
@@ -27,6 +27,7 @@ import type * as Phonic from "../../../../index.mjs";
|
|
|
27
27
|
* default_language: "en",
|
|
28
28
|
* additional_languages: ["es"],
|
|
29
29
|
* multilingual_mode: "request",
|
|
30
|
+
* push_to_talk: false,
|
|
30
31
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
31
32
|
* min_words_to_interrupt: 1,
|
|
32
33
|
* configuration_endpoint: {
|
|
@@ -89,6 +90,8 @@ export interface AgentsCreateRequest {
|
|
|
89
90
|
languages?: Phonic.LanguageCode[];
|
|
90
91
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
91
92
|
multilingual_mode?: Phonic.CreateAgentRequest.MultilingualMode;
|
|
93
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
94
|
+
push_to_talk?: boolean;
|
|
92
95
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
93
96
|
boosted_keywords?: string[];
|
|
94
97
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -27,6 +27,7 @@ import type * as Phonic from "../../../../index.mjs";
|
|
|
27
27
|
* default_language: "en",
|
|
28
28
|
* additional_languages: ["es"],
|
|
29
29
|
* multilingual_mode: "request",
|
|
30
|
+
* push_to_talk: false,
|
|
30
31
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
31
32
|
* min_words_to_interrupt: 1,
|
|
32
33
|
* configuration_endpoint: {
|
|
@@ -89,6 +90,8 @@ export interface UpdateAgentRequest {
|
|
|
89
90
|
languages?: Phonic.LanguageCode[];
|
|
90
91
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
91
92
|
multilingual_mode?: UpdateAgentRequest.MultilingualMode;
|
|
93
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
94
|
+
push_to_talk?: boolean;
|
|
92
95
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
93
96
|
boosted_keywords?: string[];
|
|
94
97
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -27,6 +27,7 @@ import type * as Phonic from "../../../../index.mjs";
|
|
|
27
27
|
* default_language: "en",
|
|
28
28
|
* additional_languages: ["es"],
|
|
29
29
|
* multilingual_mode: "request",
|
|
30
|
+
* push_to_talk: false,
|
|
30
31
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
31
32
|
* min_words_to_interrupt: 1,
|
|
32
33
|
* configuration_endpoint: {
|
|
@@ -39,6 +39,8 @@ export declare class ConversationsSocket {
|
|
|
39
39
|
sendAddSystemMessage(message: Phonic.AddSystemMessagePayload): void;
|
|
40
40
|
sendSetExternalId(message: Phonic.SetExternalIdPayload): void;
|
|
41
41
|
sendToolCallOutput(message: Phonic.ToolCallOutputPayload): void;
|
|
42
|
+
sendUnmute(message: Phonic.UnmutePayload): void;
|
|
43
|
+
sendMute(message: Phonic.MutePayload): void;
|
|
42
44
|
sendGenerateReply(message: Phonic.GenerateReplyPayload): void;
|
|
43
45
|
sendSay(message: Phonic.SayPayload): void;
|
|
44
46
|
sendReset(message: Phonic.ResetPayload): void;
|
|
@@ -53,5 +55,5 @@ export declare class ConversationsSocket {
|
|
|
53
55
|
/** Send a binary payload to the websocket. */
|
|
54
56
|
protected sendBinary(payload: ArrayBuffer | Blob | ArrayBufferView): void;
|
|
55
57
|
/** Send a JSON payload to the websocket. */
|
|
56
|
-
protected sendJson(payload: Phonic.ConfigPayload | Phonic.AudioChunkPayload | Phonic.UpdateSystemPromptPayload | Phonic.AddSystemMessagePayload | Phonic.SetExternalIdPayload | Phonic.ToolCallOutputPayload | Phonic.GenerateReplyPayload | Phonic.SayPayload | Phonic.ResetPayload): void;
|
|
58
|
+
protected sendJson(payload: Phonic.ConfigPayload | Phonic.AudioChunkPayload | Phonic.UpdateSystemPromptPayload | Phonic.AddSystemMessagePayload | Phonic.SetExternalIdPayload | Phonic.ToolCallOutputPayload | Phonic.UnmutePayload | Phonic.MutePayload | Phonic.GenerateReplyPayload | Phonic.SayPayload | Phonic.ResetPayload): void;
|
|
57
59
|
}
|
|
@@ -78,6 +78,14 @@ export class ConversationsSocket {
|
|
|
78
78
|
this.assertSocketIsOpen();
|
|
79
79
|
this.sendJson(message);
|
|
80
80
|
}
|
|
81
|
+
sendUnmute(message) {
|
|
82
|
+
this.assertSocketIsOpen();
|
|
83
|
+
this.sendJson(message);
|
|
84
|
+
}
|
|
85
|
+
sendMute(message) {
|
|
86
|
+
this.assertSocketIsOpen();
|
|
87
|
+
this.sendJson(message);
|
|
88
|
+
}
|
|
81
89
|
sendGenerateReply(message) {
|
|
82
90
|
this.assertSocketIsOpen();
|
|
83
91
|
this.sendJson(message);
|
|
@@ -19,6 +19,7 @@ import type * as Phonic from "../../../../index.mjs";
|
|
|
19
19
|
* default_language: "en",
|
|
20
20
|
* additional_languages: ["es"],
|
|
21
21
|
* multilingual_mode: "request",
|
|
22
|
+
* push_to_talk: false,
|
|
22
23
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
23
24
|
* min_words_to_interrupt: 1,
|
|
24
25
|
* tools: ["keypad_input"]
|
|
@@ -50,6 +50,8 @@ export interface Agent {
|
|
|
50
50
|
languages?: Phonic.LanguageCode[] | undefined;
|
|
51
51
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
52
52
|
multilingual_mode: Agent.MultilingualMode;
|
|
53
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
54
|
+
push_to_talk: boolean;
|
|
53
55
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
54
56
|
boosted_keywords: string[];
|
|
55
57
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -50,6 +50,8 @@ export interface ConfigOptions {
|
|
|
50
50
|
additional_languages?: string[] | undefined;
|
|
51
51
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
52
52
|
multilingual_mode?: ConfigOptions.MultilingualMode | undefined;
|
|
53
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
54
|
+
push_to_talk?: boolean | undefined;
|
|
53
55
|
/** Keywords to boost in speech recognition */
|
|
54
56
|
boosted_keywords?: string[] | undefined;
|
|
55
57
|
/** Names of tools available to the assistant. */
|
|
@@ -54,6 +54,8 @@ export interface Conversation {
|
|
|
54
54
|
additional_languages: string[] | null;
|
|
55
55
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
56
56
|
multilingual_mode: Conversation.MultilingualMode;
|
|
57
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
58
|
+
push_to_talk: boolean;
|
|
57
59
|
/** Array of ISO 639-1 language codes recognized by the model. This field is deprecated. Use `default_language` and `additional_languages` instead. */
|
|
58
60
|
languages?: (string[] | null) | undefined;
|
|
59
61
|
/** Whether the no-input poke text was generated by AI. */
|
|
@@ -48,6 +48,8 @@ export interface CreateAgentRequest {
|
|
|
48
48
|
languages?: Phonic.LanguageCode[] | undefined;
|
|
49
49
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
50
50
|
multilingual_mode?: CreateAgentRequest.MultilingualMode | undefined;
|
|
51
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
52
|
+
push_to_talk?: boolean | undefined;
|
|
51
53
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
52
54
|
boosted_keywords?: string[] | undefined;
|
|
53
55
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -31,6 +31,8 @@ export interface OutboundCallConfig {
|
|
|
31
31
|
languages?: Phonic.LanguageCode[] | undefined;
|
|
32
32
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
33
33
|
multilingual_mode?: OutboundCallConfig.MultilingualMode | undefined;
|
|
34
|
+
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
35
|
+
push_to_talk?: boolean | undefined;
|
|
34
36
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
35
37
|
boosted_keywords?: string[] | undefined;
|
|
36
38
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -29,6 +29,7 @@ export * from "./GenerateReplyPayload.mjs";
|
|
|
29
29
|
export * from "./InputCancelledPayload.mjs";
|
|
30
30
|
export * from "./InputTextPayload.mjs";
|
|
31
31
|
export * from "./LanguageCode.mjs";
|
|
32
|
+
export * from "./MutePayload.mjs";
|
|
32
33
|
export * from "./OutboundCallConfig.mjs";
|
|
33
34
|
export * from "./OutboundCallInitiatedResponse.mjs";
|
|
34
35
|
export * from "./OutboundDryRunResponse.mjs";
|
|
@@ -46,6 +47,7 @@ export * from "./ToolCallOutputPayload.mjs";
|
|
|
46
47
|
export * from "./ToolCallOutputProcessedPayload.mjs";
|
|
47
48
|
export * from "./ToolCallPayload.mjs";
|
|
48
49
|
export * from "./ToolParameter.mjs";
|
|
50
|
+
export * from "./UnmutePayload.mjs";
|
|
49
51
|
export * from "./UpdateSystemPromptPayload.mjs";
|
|
50
52
|
export * from "./UserFinishedSpeakingPayload.mjs";
|
|
51
53
|
export * from "./UserStartedSpeakingPayload.mjs";
|
|
@@ -29,6 +29,7 @@ export * from "./GenerateReplyPayload.mjs";
|
|
|
29
29
|
export * from "./InputCancelledPayload.mjs";
|
|
30
30
|
export * from "./InputTextPayload.mjs";
|
|
31
31
|
export * from "./LanguageCode.mjs";
|
|
32
|
+
export * from "./MutePayload.mjs";
|
|
32
33
|
export * from "./OutboundCallConfig.mjs";
|
|
33
34
|
export * from "./OutboundCallInitiatedResponse.mjs";
|
|
34
35
|
export * from "./OutboundDryRunResponse.mjs";
|
|
@@ -46,6 +47,7 @@ export * from "./ToolCallOutputPayload.mjs";
|
|
|
46
47
|
export * from "./ToolCallOutputProcessedPayload.mjs";
|
|
47
48
|
export * from "./ToolCallPayload.mjs";
|
|
48
49
|
export * from "./ToolParameter.mjs";
|
|
50
|
+
export * from "./UnmutePayload.mjs";
|
|
49
51
|
export * from "./UpdateSystemPromptPayload.mjs";
|
|
50
52
|
export * from "./UserFinishedSpeakingPayload.mjs";
|
|
51
53
|
export * from "./UserStartedSpeakingPayload.mjs";
|
|
@@ -57,6 +57,8 @@ export declare class ReconnectableConversationsSocket {
|
|
|
57
57
|
sendGenerateReply(message: Phonic.GenerateReplyPayload): void;
|
|
58
58
|
sendSay(message: Phonic.SayPayload): void;
|
|
59
59
|
sendReset(message: Phonic.ResetPayload): void;
|
|
60
|
+
sendMute(message: Phonic.MutePayload): void;
|
|
61
|
+
sendUnmute(message: Phonic.UnmutePayload): void;
|
|
60
62
|
/**
|
|
61
63
|
* Not supported — reconnection after 1006 is handled automatically.
|
|
62
64
|
* To start a new conversation, create a new socket via client.conversations.connect().
|
|
@@ -98,6 +98,12 @@ export class ReconnectableConversationsSocket {
|
|
|
98
98
|
sendReset(message) {
|
|
99
99
|
this._safeSend((inner) => inner.sendReset(message));
|
|
100
100
|
}
|
|
101
|
+
sendMute(message) {
|
|
102
|
+
this._safeSend((inner) => inner.sendMute(message));
|
|
103
|
+
}
|
|
104
|
+
sendUnmute(message) {
|
|
105
|
+
this._safeSend((inner) => inner.sendUnmute(message));
|
|
106
|
+
}
|
|
101
107
|
/**
|
|
102
108
|
* Not supported — reconnection after 1006 is handled automatically.
|
|
103
109
|
* To start a new conversation, create a new socket via client.conversations.connect().
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.31.
|
|
1
|
+
export declare const SDK_VERSION = "0.31.12";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.31.
|
|
1
|
+
export const SDK_VERSION = "0.31.12";
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phonic",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/Phonic-Co/phonic-node.git"
|
|
8
8
|
},
|
|
9
|
+
"license": "MIT",
|
|
9
10
|
"type": "commonjs",
|
|
10
11
|
"main": "./dist/cjs/index.js",
|
|
11
12
|
"module": "./dist/esm/index.mjs",
|
package/reference.md
CHANGED
|
@@ -116,6 +116,7 @@ await client.agents.create({
|
|
|
116
116
|
default_language: "en",
|
|
117
117
|
additional_languages: ["es"],
|
|
118
118
|
multilingual_mode: "request",
|
|
119
|
+
push_to_talk: false,
|
|
119
120
|
boosted_keywords: ["Load ID", "dispatch"],
|
|
120
121
|
min_words_to_interrupt: 1,
|
|
121
122
|
configuration_endpoint: {
|
|
@@ -214,6 +215,7 @@ await client.agents.upsert({
|
|
|
214
215
|
default_language: "en",
|
|
215
216
|
additional_languages: ["es"],
|
|
216
217
|
multilingual_mode: "request",
|
|
218
|
+
push_to_talk: false,
|
|
217
219
|
boosted_keywords: ["Load ID", "dispatch"],
|
|
218
220
|
min_words_to_interrupt: 1,
|
|
219
221
|
configuration_endpoint: {
|
|
@@ -458,6 +460,7 @@ await client.agents.update("nameOrId", {
|
|
|
458
460
|
default_language: "en",
|
|
459
461
|
additional_languages: ["es"],
|
|
460
462
|
multilingual_mode: "request",
|
|
463
|
+
push_to_talk: false,
|
|
461
464
|
boosted_keywords: ["Load ID", "dispatch"],
|
|
462
465
|
min_words_to_interrupt: 1,
|
|
463
466
|
configuration_endpoint: {
|
|
@@ -2198,6 +2201,7 @@ await client.conversations.outboundCall({
|
|
|
2198
2201
|
default_language: "en",
|
|
2199
2202
|
additional_languages: ["es"],
|
|
2200
2203
|
multilingual_mode: "request",
|
|
2204
|
+
push_to_talk: false,
|
|
2201
2205
|
boosted_keywords: ["Load ID", "dispatch"],
|
|
2202
2206
|
min_words_to_interrupt: 1,
|
|
2203
2207
|
tools: ["keypad_input"]
|