phonic 0.31.11 → 0.31.13
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 +1 -0
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +6 -0
- package/dist/cjs/Client.js +20 -10
- package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +6 -0
- package/dist/cjs/api/errors/UnprocessableEntityError.js +54 -0
- package/dist/cjs/api/errors/index.d.ts +1 -0
- package/dist/cjs/api/errors/index.js +1 -0
- 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/conversationItems/client/Client.d.ts +39 -0
- package/dist/cjs/api/resources/conversationItems/client/Client.js +139 -0
- package/dist/cjs/api/resources/conversationItems/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/conversationItems/client/index.js +17 -0
- package/dist/cjs/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.d.ts +12 -0
- package/dist/cjs/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.js +3 -0
- package/dist/cjs/api/resources/conversationItems/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/conversationItems/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/conversationItems/exports.d.ts +2 -0
- package/dist/cjs/api/resources/conversationItems/exports.js +21 -0
- package/dist/cjs/api/resources/conversationItems/index.d.ts +1 -0
- package/dist/cjs/api/resources/conversationItems/index.js +17 -0
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/conversations/client/Client.js +3 -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/resources/conversations/types/ConversationsListResponse.d.ts +1 -9
- package/dist/cjs/api/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/index.js +5 -1
- package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.d.ts +2 -0
- package/dist/cjs/api/resources/workspace/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/workspace/client/Client.js +110 -0
- package/dist/cjs/api/resources/workspace/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/workspace/client/index.js +2 -0
- package/dist/cjs/api/resources/workspace/exports.d.ts +2 -0
- package/dist/cjs/api/resources/workspace/exports.js +21 -0
- package/dist/cjs/api/resources/workspace/index.d.ts +2 -0
- package/dist/cjs/api/resources/workspace/index.js +18 -0
- package/dist/cjs/api/resources/workspace/types/WorkspaceGetResponse.d.ts +6 -0
- package/dist/cjs/api/resources/workspace/types/WorkspaceGetResponse.js +3 -0
- package/dist/cjs/api/resources/workspace/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/workspace/types/index.js +17 -0
- package/dist/cjs/api/types/Agent.d.ts +2 -0
- package/dist/cjs/api/types/BadRequestErrorBody.d.ts +1 -1
- package/dist/cjs/api/types/ConfigOptions.d.ts +2 -0
- package/dist/cjs/api/types/Conversation.d.ts +10 -0
- package/dist/cjs/api/types/ConversationItem.d.ts +2 -0
- package/dist/cjs/api/types/ConversationsListResponseConversation.d.ts +4 -0
- package/dist/cjs/api/types/ConversationsListResponseConversation.js +3 -0
- package/dist/cjs/api/types/ConversationsListResponseConversations.d.ts +5 -0
- package/dist/cjs/api/types/ConversationsListResponseConversations.js +3 -0
- package/dist/cjs/api/types/ConversationsListResponseConversationsPagination.d.ts +6 -0
- package/dist/cjs/api/types/ConversationsListResponseConversationsPagination.js +3 -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/Project.d.ts +4 -0
- package/dist/cjs/api/types/ReplayConversationItemResponse.d.ts +16 -0
- package/dist/cjs/api/types/ReplayConversationItemResponse.js +3 -0
- package/dist/cjs/api/types/ReplayToolCall.d.ts +29 -0
- package/dist/cjs/api/types/ReplayToolCall.js +12 -0
- package/dist/cjs/api/types/SipCallError.d.ts +24 -0
- package/dist/cjs/api/types/SipCallError.js +16 -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 +8 -0
- package/dist/cjs/api/types/index.js +8 -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/Client.d.mts +6 -0
- package/dist/esm/Client.mjs +10 -0
- package/dist/esm/api/errors/UnprocessableEntityError.d.mts +6 -0
- package/dist/esm/api/errors/UnprocessableEntityError.mjs +17 -0
- package/dist/esm/api/errors/index.d.mts +1 -0
- package/dist/esm/api/errors/index.mjs +1 -0
- 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/conversationItems/client/Client.d.mts +39 -0
- package/dist/esm/api/resources/conversationItems/client/Client.mjs +102 -0
- package/dist/esm/api/resources/conversationItems/client/index.d.mts +1 -0
- package/dist/esm/api/resources/conversationItems/client/index.mjs +1 -0
- package/dist/esm/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.d.mts +12 -0
- package/dist/esm/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.mjs +2 -0
- package/dist/esm/api/resources/conversationItems/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/conversationItems/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/conversationItems/exports.d.mts +2 -0
- package/dist/esm/api/resources/conversationItems/exports.mjs +3 -0
- package/dist/esm/api/resources/conversationItems/index.d.mts +1 -0
- package/dist/esm/api/resources/conversationItems/index.mjs +1 -0
- package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/conversations/client/Client.mjs +3 -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/resources/conversations/types/ConversationsListResponse.d.mts +1 -9
- package/dist/esm/api/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/index.mjs +4 -0
- package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequest.d.mts +2 -0
- package/dist/esm/api/resources/workspace/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/workspace/client/Client.mjs +73 -0
- package/dist/esm/api/resources/workspace/client/index.d.mts +1 -0
- package/dist/esm/api/resources/workspace/client/index.mjs +1 -0
- package/dist/esm/api/resources/workspace/exports.d.mts +2 -0
- package/dist/esm/api/resources/workspace/exports.mjs +3 -0
- package/dist/esm/api/resources/workspace/index.d.mts +2 -0
- package/dist/esm/api/resources/workspace/index.mjs +2 -0
- package/dist/esm/api/resources/workspace/types/WorkspaceGetResponse.d.mts +6 -0
- package/dist/esm/api/resources/workspace/types/WorkspaceGetResponse.mjs +2 -0
- package/dist/esm/api/resources/workspace/types/index.d.mts +1 -0
- package/dist/esm/api/resources/workspace/types/index.mjs +1 -0
- package/dist/esm/api/types/Agent.d.mts +2 -0
- package/dist/esm/api/types/BadRequestErrorBody.d.mts +1 -1
- package/dist/esm/api/types/ConfigOptions.d.mts +2 -0
- package/dist/esm/api/types/Conversation.d.mts +10 -0
- package/dist/esm/api/types/ConversationItem.d.mts +2 -0
- package/dist/esm/api/types/ConversationsListResponseConversation.d.mts +4 -0
- package/dist/esm/api/types/ConversationsListResponseConversation.mjs +2 -0
- package/dist/esm/api/types/ConversationsListResponseConversations.d.mts +5 -0
- package/dist/esm/api/types/ConversationsListResponseConversations.mjs +2 -0
- package/dist/esm/api/types/ConversationsListResponseConversationsPagination.d.mts +6 -0
- package/dist/esm/api/types/ConversationsListResponseConversationsPagination.mjs +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/Project.d.mts +4 -0
- package/dist/esm/api/types/ReplayConversationItemResponse.d.mts +16 -0
- package/dist/esm/api/types/ReplayConversationItemResponse.mjs +2 -0
- package/dist/esm/api/types/ReplayToolCall.d.mts +29 -0
- package/dist/esm/api/types/ReplayToolCall.mjs +9 -0
- package/dist/esm/api/types/SipCallError.d.mts +24 -0
- package/dist/esm/api/types/SipCallError.mjs +13 -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 +8 -0
- package/dist/esm/api/types/index.mjs +8 -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 +23 -1
- package/reference.md +138 -0
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.13",
|
|
47
|
+
"User-Agent": "phonic/0.31.13",
|
|
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);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { AgentsClient } from "./api/resources/agents/client/Client.js";
|
|
2
2
|
import { AuthClient } from "./api/resources/auth/client/Client.js";
|
|
3
|
+
import { ConversationItemsClient } from "./api/resources/conversationItems/client/Client.js";
|
|
3
4
|
import { ConversationsClient } from "./api/resources/conversations/client/Client.js";
|
|
4
5
|
import { ExtractionSchemasClient } from "./api/resources/extractionSchemas/client/Client.js";
|
|
5
6
|
import { ProjectsClient } from "./api/resources/projects/client/Client.js";
|
|
6
7
|
import { ToolsClient } from "./api/resources/tools/client/Client.js";
|
|
7
8
|
import { VoicesClient } from "./api/resources/voices/client/Client.js";
|
|
9
|
+
import { WorkspaceClient } from "./api/resources/workspace/client/Client.js";
|
|
8
10
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
9
11
|
import { type NormalizedClientOptionsWithAuth } from "./BaseClient.js";
|
|
10
12
|
import * as core from "./core/index.js";
|
|
@@ -28,16 +30,20 @@ export declare class PhonicClient {
|
|
|
28
30
|
protected _extractionSchemas: ExtractionSchemasClient | undefined;
|
|
29
31
|
protected _voices: VoicesClient | undefined;
|
|
30
32
|
protected _conversations: ConversationsClient | undefined;
|
|
33
|
+
protected _conversationItems: ConversationItemsClient | undefined;
|
|
31
34
|
protected _auth: AuthClient | undefined;
|
|
32
35
|
protected _projects: ProjectsClient | undefined;
|
|
36
|
+
protected _workspace: WorkspaceClient | undefined;
|
|
33
37
|
constructor(options?: PhonicClient.Options);
|
|
34
38
|
get agents(): AgentsClient;
|
|
35
39
|
get tools(): ToolsClient;
|
|
36
40
|
get extractionSchemas(): ExtractionSchemasClient;
|
|
37
41
|
get voices(): VoicesClient;
|
|
38
42
|
get conversations(): ConversationsClient;
|
|
43
|
+
get conversationItems(): ConversationItemsClient;
|
|
39
44
|
get auth(): AuthClient;
|
|
40
45
|
get projects(): ProjectsClient;
|
|
46
|
+
get workspace(): WorkspaceClient;
|
|
41
47
|
/**
|
|
42
48
|
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
|
43
49
|
* This is useful for making requests to endpoints not yet supported in the SDK.
|
package/dist/cjs/Client.js
CHANGED
|
@@ -46,11 +46,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
46
46
|
exports.PhonicClient = void 0;
|
|
47
47
|
const Client_js_1 = require("./api/resources/agents/client/Client.js");
|
|
48
48
|
const Client_js_2 = require("./api/resources/auth/client/Client.js");
|
|
49
|
-
const Client_js_3 = require("./api/resources/
|
|
50
|
-
const Client_js_4 = require("./api/resources/
|
|
51
|
-
const Client_js_5 = require("./api/resources/
|
|
52
|
-
const Client_js_6 = require("./api/resources/
|
|
53
|
-
const Client_js_7 = require("./api/resources/
|
|
49
|
+
const Client_js_3 = require("./api/resources/conversationItems/client/Client.js");
|
|
50
|
+
const Client_js_4 = require("./api/resources/conversations/client/Client.js");
|
|
51
|
+
const Client_js_5 = require("./api/resources/extractionSchemas/client/Client.js");
|
|
52
|
+
const Client_js_6 = require("./api/resources/projects/client/Client.js");
|
|
53
|
+
const Client_js_7 = require("./api/resources/tools/client/Client.js");
|
|
54
|
+
const Client_js_8 = require("./api/resources/voices/client/Client.js");
|
|
55
|
+
const Client_js_9 = require("./api/resources/workspace/client/Client.js");
|
|
54
56
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
55
57
|
const core = __importStar(require("./core/index.js"));
|
|
56
58
|
const environments = __importStar(require("./environments.js"));
|
|
@@ -64,19 +66,23 @@ class PhonicClient {
|
|
|
64
66
|
}
|
|
65
67
|
get tools() {
|
|
66
68
|
var _a;
|
|
67
|
-
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new
|
|
69
|
+
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new Client_js_7.ToolsClient(this._options)));
|
|
68
70
|
}
|
|
69
71
|
get extractionSchemas() {
|
|
70
72
|
var _a;
|
|
71
|
-
return ((_a = this._extractionSchemas) !== null && _a !== void 0 ? _a : (this._extractionSchemas = new
|
|
73
|
+
return ((_a = this._extractionSchemas) !== null && _a !== void 0 ? _a : (this._extractionSchemas = new Client_js_5.ExtractionSchemasClient(this._options)));
|
|
72
74
|
}
|
|
73
75
|
get voices() {
|
|
74
76
|
var _a;
|
|
75
|
-
return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new
|
|
77
|
+
return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new Client_js_8.VoicesClient(this._options)));
|
|
76
78
|
}
|
|
77
79
|
get conversations() {
|
|
78
80
|
var _a;
|
|
79
|
-
return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new
|
|
81
|
+
return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new Client_js_4.ConversationsClient(this._options)));
|
|
82
|
+
}
|
|
83
|
+
get conversationItems() {
|
|
84
|
+
var _a;
|
|
85
|
+
return ((_a = this._conversationItems) !== null && _a !== void 0 ? _a : (this._conversationItems = new Client_js_3.ConversationItemsClient(this._options)));
|
|
80
86
|
}
|
|
81
87
|
get auth() {
|
|
82
88
|
var _a;
|
|
@@ -84,7 +90,11 @@ class PhonicClient {
|
|
|
84
90
|
}
|
|
85
91
|
get projects() {
|
|
86
92
|
var _a;
|
|
87
|
-
return ((_a = this._projects) !== null && _a !== void 0 ? _a : (this._projects = new
|
|
93
|
+
return ((_a = this._projects) !== null && _a !== void 0 ? _a : (this._projects = new Client_js_6.ProjectsClient(this._options)));
|
|
94
|
+
}
|
|
95
|
+
get workspace() {
|
|
96
|
+
var _a;
|
|
97
|
+
return ((_a = this._workspace) !== null && _a !== void 0 ? _a : (this._workspace = new Client_js_9.WorkspaceClient(this._options)));
|
|
88
98
|
}
|
|
89
99
|
/**
|
|
90
100
|
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.js";
|
|
2
|
+
import * as errors from "../../errors/index.js";
|
|
3
|
+
import type * as Phonic from "../index.js";
|
|
4
|
+
export declare class UnprocessableEntityError extends errors.PhonicError {
|
|
5
|
+
constructor(body: Phonic.BasicError, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.UnprocessableEntityError = void 0;
|
|
38
|
+
const errors = __importStar(require("../../errors/index.js"));
|
|
39
|
+
class UnprocessableEntityError extends errors.PhonicError {
|
|
40
|
+
constructor(body, rawResponse) {
|
|
41
|
+
super({
|
|
42
|
+
message: "UnprocessableEntityError",
|
|
43
|
+
statusCode: 422,
|
|
44
|
+
body: body,
|
|
45
|
+
rawResponse: rawResponse,
|
|
46
|
+
});
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.UnprocessableEntityError = UnprocessableEntityError;
|
|
@@ -21,3 +21,4 @@ __exportStar(require("./GatewayTimeoutError.js"), exports);
|
|
|
21
21
|
__exportStar(require("./InternalServerError.js"), exports);
|
|
22
22
|
__exportStar(require("./NotFoundError.js"), exports);
|
|
23
23
|
__exportStar(require("./UnauthorizedError.js"), exports);
|
|
24
|
+
__exportStar(require("./UnprocessableEntityError.js"), exports);
|
|
@@ -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: {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../core/index.js";
|
|
4
|
+
import * as Phonic from "../../../index.js";
|
|
5
|
+
export declare namespace ConversationItemsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ConversationItemsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ConversationItemsClient.Options>;
|
|
12
|
+
constructor(options?: ConversationItemsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Returns the alternative response(s) the assistant would have
|
|
15
|
+
* produced for this conversation turn given changes to the agent system prompt.
|
|
16
|
+
*
|
|
17
|
+
* Only assistant items from ended conversations can be replayed. The
|
|
18
|
+
* conversation must have an associated agent.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} id - The ID of the conversation item to replay.
|
|
21
|
+
* @param {Phonic.ReplayConversationItemRequest} request
|
|
22
|
+
* @param {ConversationItemsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
23
|
+
*
|
|
24
|
+
* @throws {@link Phonic.BadRequestError}
|
|
25
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
26
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
27
|
+
* @throws {@link Phonic.NotFoundError}
|
|
28
|
+
* @throws {@link Phonic.ConflictError}
|
|
29
|
+
* @throws {@link Phonic.UnprocessableEntityError}
|
|
30
|
+
* @throws {@link Phonic.InternalServerError}
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* await client.conversationItems.replay("id", {
|
|
34
|
+
* system_prompt: "system_prompt"
|
|
35
|
+
* })
|
|
36
|
+
*/
|
|
37
|
+
replay(id: string, request: Phonic.ReplayConversationItemRequest, requestOptions?: ConversationItemsClient.RequestOptions): core.HttpResponsePromise<Phonic.ReplayConversationItemResponse>;
|
|
38
|
+
private __replay;
|
|
39
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.ConversationItemsClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
48
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
49
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
50
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
52
|
+
const errors = __importStar(require("../../../../errors/index.js"));
|
|
53
|
+
const Phonic = __importStar(require("../../../index.js"));
|
|
54
|
+
class ConversationItemsClient {
|
|
55
|
+
constructor(options = {}) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Returns the alternative response(s) the assistant would have
|
|
60
|
+
* produced for this conversation turn given changes to the agent system prompt.
|
|
61
|
+
*
|
|
62
|
+
* Only assistant items from ended conversations can be replayed. The
|
|
63
|
+
* conversation must have an associated agent.
|
|
64
|
+
*
|
|
65
|
+
* @param {string} id - The ID of the conversation item to replay.
|
|
66
|
+
* @param {Phonic.ReplayConversationItemRequest} request
|
|
67
|
+
* @param {ConversationItemsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
|
+
*
|
|
69
|
+
* @throws {@link Phonic.BadRequestError}
|
|
70
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
71
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
72
|
+
* @throws {@link Phonic.NotFoundError}
|
|
73
|
+
* @throws {@link Phonic.ConflictError}
|
|
74
|
+
* @throws {@link Phonic.UnprocessableEntityError}
|
|
75
|
+
* @throws {@link Phonic.InternalServerError}
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* await client.conversationItems.replay("id", {
|
|
79
|
+
* system_prompt: "system_prompt"
|
|
80
|
+
* })
|
|
81
|
+
*/
|
|
82
|
+
replay(id, request, requestOptions) {
|
|
83
|
+
return core.HttpResponsePromise.fromPromise(this.__replay(id, request, requestOptions));
|
|
84
|
+
}
|
|
85
|
+
__replay(id, request, requestOptions) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
88
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
89
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
90
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
91
|
+
url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
|
|
92
|
+
.base, `conversation_items/${core.url.encodePathParam(id)}/replay`),
|
|
93
|
+
method: "POST",
|
|
94
|
+
headers: _headers,
|
|
95
|
+
contentType: "application/json",
|
|
96
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
97
|
+
requestType: "json",
|
|
98
|
+
body: request,
|
|
99
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
100
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
101
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
102
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
103
|
+
logging: this._options.logging,
|
|
104
|
+
});
|
|
105
|
+
if (_response.ok) {
|
|
106
|
+
return {
|
|
107
|
+
data: _response.body,
|
|
108
|
+
rawResponse: _response.rawResponse,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (_response.error.reason === "status-code") {
|
|
112
|
+
switch (_response.error.statusCode) {
|
|
113
|
+
case 400:
|
|
114
|
+
throw new Phonic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
115
|
+
case 401:
|
|
116
|
+
throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
117
|
+
case 403:
|
|
118
|
+
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
119
|
+
case 404:
|
|
120
|
+
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
121
|
+
case 409:
|
|
122
|
+
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
123
|
+
case 422:
|
|
124
|
+
throw new Phonic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
125
|
+
case 500:
|
|
126
|
+
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
127
|
+
default:
|
|
128
|
+
throw new errors.PhonicError({
|
|
129
|
+
statusCode: _response.error.statusCode,
|
|
130
|
+
body: _response.error.body,
|
|
131
|
+
rawResponse: _response.rawResponse,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/conversation_items/{id}/replay");
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
exports.ConversationItemsClient = ConversationItemsClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
package/dist/cjs/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* system_prompt: "system_prompt"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface ReplayConversationItemRequest {
|
|
8
|
+
/** The system prompt to use when generating replay responses. Use this to test prompt changes against this conversation turn. */
|
|
9
|
+
system_prompt: string;
|
|
10
|
+
/** Number of alternative responses to generate. */
|
|
11
|
+
num_responses?: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ReplayConversationItemRequest } from "./ReplayConversationItemRequest.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ConversationItemsClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "ConversationItemsClient", { enumerable: true, get: function () { return Client_js_1.ConversationItemsClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -682,6 +682,7 @@ class ConversationsClient {
|
|
|
682
682
|
*
|
|
683
683
|
* @throws {@link Phonic.BadRequestError}
|
|
684
684
|
* @throws {@link Phonic.UnauthorizedError}
|
|
685
|
+
* @throws {@link Phonic.ConflictError}
|
|
685
686
|
* @throws {@link Phonic.InternalServerError}
|
|
686
687
|
*
|
|
687
688
|
* @example
|
|
@@ -731,6 +732,8 @@ class ConversationsClient {
|
|
|
731
732
|
throw new Phonic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
732
733
|
case 401:
|
|
733
734
|
throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
735
|
+
case 409:
|
|
736
|
+
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
734
737
|
case 500:
|
|
735
738
|
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
736
739
|
default:
|
|
@@ -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"]
|