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
|
@@ -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.13";
|
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.13",
|
|
10
|
+
"User-Agent": "phonic/0.31.13",
|
|
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);
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
|
|
2
2
|
import { AuthClient } from "./api/resources/auth/client/Client.mjs";
|
|
3
|
+
import { ConversationItemsClient } from "./api/resources/conversationItems/client/Client.mjs";
|
|
3
4
|
import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
|
|
4
5
|
import { ExtractionSchemasClient } from "./api/resources/extractionSchemas/client/Client.mjs";
|
|
5
6
|
import { ProjectsClient } from "./api/resources/projects/client/Client.mjs";
|
|
6
7
|
import { ToolsClient } from "./api/resources/tools/client/Client.mjs";
|
|
7
8
|
import { VoicesClient } from "./api/resources/voices/client/Client.mjs";
|
|
9
|
+
import { WorkspaceClient } from "./api/resources/workspace/client/Client.mjs";
|
|
8
10
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
9
11
|
import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
10
12
|
import * as core from "./core/index.mjs";
|
|
@@ -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/esm/Client.mjs
CHANGED
|
@@ -10,11 +10,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
|
|
12
12
|
import { AuthClient } from "./api/resources/auth/client/Client.mjs";
|
|
13
|
+
import { ConversationItemsClient } from "./api/resources/conversationItems/client/Client.mjs";
|
|
13
14
|
import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
|
|
14
15
|
import { ExtractionSchemasClient } from "./api/resources/extractionSchemas/client/Client.mjs";
|
|
15
16
|
import { ProjectsClient } from "./api/resources/projects/client/Client.mjs";
|
|
16
17
|
import { ToolsClient } from "./api/resources/tools/client/Client.mjs";
|
|
17
18
|
import { VoicesClient } from "./api/resources/voices/client/Client.mjs";
|
|
19
|
+
import { WorkspaceClient } from "./api/resources/workspace/client/Client.mjs";
|
|
18
20
|
import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
19
21
|
import * as core from "./core/index.mjs";
|
|
20
22
|
import * as environments from "./environments.mjs";
|
|
@@ -42,6 +44,10 @@ export class PhonicClient {
|
|
|
42
44
|
var _a;
|
|
43
45
|
return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new ConversationsClient(this._options)));
|
|
44
46
|
}
|
|
47
|
+
get conversationItems() {
|
|
48
|
+
var _a;
|
|
49
|
+
return ((_a = this._conversationItems) !== null && _a !== void 0 ? _a : (this._conversationItems = new ConversationItemsClient(this._options)));
|
|
50
|
+
}
|
|
45
51
|
get auth() {
|
|
46
52
|
var _a;
|
|
47
53
|
return ((_a = this._auth) !== null && _a !== void 0 ? _a : (this._auth = new AuthClient(this._options)));
|
|
@@ -50,6 +56,10 @@ export class PhonicClient {
|
|
|
50
56
|
var _a;
|
|
51
57
|
return ((_a = this._projects) !== null && _a !== void 0 ? _a : (this._projects = new ProjectsClient(this._options)));
|
|
52
58
|
}
|
|
59
|
+
get workspace() {
|
|
60
|
+
var _a;
|
|
61
|
+
return ((_a = this._workspace) !== null && _a !== void 0 ? _a : (this._workspace = new WorkspaceClient(this._options)));
|
|
62
|
+
}
|
|
53
63
|
/**
|
|
54
64
|
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
|
55
65
|
* This is useful for making requests to endpoints not yet supported in the SDK.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
import type * as Phonic from "../index.mjs";
|
|
4
|
+
export declare class UnprocessableEntityError extends errors.PhonicError {
|
|
5
|
+
constructor(body: Phonic.BasicError, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class UnprocessableEntityError extends errors.PhonicError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "UnprocessableEntityError",
|
|
7
|
+
statusCode: 422,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -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: {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as Phonic from "../../../index.mjs";
|
|
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,102 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as Phonic from "../../../index.mjs";
|
|
18
|
+
export class ConversationItemsClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns the alternative response(s) the assistant would have
|
|
24
|
+
* produced for this conversation turn given changes to the agent system prompt.
|
|
25
|
+
*
|
|
26
|
+
* Only assistant items from ended conversations can be replayed. The
|
|
27
|
+
* conversation must have an associated agent.
|
|
28
|
+
*
|
|
29
|
+
* @param {string} id - The ID of the conversation item to replay.
|
|
30
|
+
* @param {Phonic.ReplayConversationItemRequest} request
|
|
31
|
+
* @param {ConversationItemsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
+
*
|
|
33
|
+
* @throws {@link Phonic.BadRequestError}
|
|
34
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
35
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
36
|
+
* @throws {@link Phonic.NotFoundError}
|
|
37
|
+
* @throws {@link Phonic.ConflictError}
|
|
38
|
+
* @throws {@link Phonic.UnprocessableEntityError}
|
|
39
|
+
* @throws {@link Phonic.InternalServerError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.conversationItems.replay("id", {
|
|
43
|
+
* system_prompt: "system_prompt"
|
|
44
|
+
* })
|
|
45
|
+
*/
|
|
46
|
+
replay(id, request, requestOptions) {
|
|
47
|
+
return core.HttpResponsePromise.fromPromise(this.__replay(id, request, requestOptions));
|
|
48
|
+
}
|
|
49
|
+
__replay(id, request, requestOptions) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
52
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
53
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
54
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
55
|
+
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)
|
|
56
|
+
.base, `conversation_items/${core.url.encodePathParam(id)}/replay`),
|
|
57
|
+
method: "POST",
|
|
58
|
+
headers: _headers,
|
|
59
|
+
contentType: "application/json",
|
|
60
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
61
|
+
requestType: "json",
|
|
62
|
+
body: request,
|
|
63
|
+
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,
|
|
64
|
+
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,
|
|
65
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
66
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
67
|
+
logging: this._options.logging,
|
|
68
|
+
});
|
|
69
|
+
if (_response.ok) {
|
|
70
|
+
return {
|
|
71
|
+
data: _response.body,
|
|
72
|
+
rawResponse: _response.rawResponse,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (_response.error.reason === "status-code") {
|
|
76
|
+
switch (_response.error.statusCode) {
|
|
77
|
+
case 400:
|
|
78
|
+
throw new Phonic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
79
|
+
case 401:
|
|
80
|
+
throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
81
|
+
case 403:
|
|
82
|
+
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
83
|
+
case 404:
|
|
84
|
+
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
85
|
+
case 409:
|
|
86
|
+
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
87
|
+
case 422:
|
|
88
|
+
throw new Phonic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
89
|
+
case 500:
|
|
90
|
+
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
91
|
+
default:
|
|
92
|
+
throw new errors.PhonicError({
|
|
93
|
+
statusCode: _response.error.statusCode,
|
|
94
|
+
body: _response.error.body,
|
|
95
|
+
rawResponse: _response.rawResponse,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/conversation_items/{id}/replay");
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
package/dist/esm/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.d.mts
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.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -646,6 +646,7 @@ export class ConversationsClient {
|
|
|
646
646
|
*
|
|
647
647
|
* @throws {@link Phonic.BadRequestError}
|
|
648
648
|
* @throws {@link Phonic.UnauthorizedError}
|
|
649
|
+
* @throws {@link Phonic.ConflictError}
|
|
649
650
|
* @throws {@link Phonic.InternalServerError}
|
|
650
651
|
*
|
|
651
652
|
* @example
|
|
@@ -695,6 +696,8 @@ export class ConversationsClient {
|
|
|
695
696
|
throw new Phonic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
696
697
|
case 401:
|
|
697
698
|
throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
699
|
+
case 409:
|
|
700
|
+
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
698
701
|
case 500:
|
|
699
702
|
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
700
703
|
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
|
}
|
|
@@ -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"]
|
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
import type * as Phonic from "../../../index.mjs";
|
|
2
|
-
export type ConversationsListResponse =
|
|
3
|
-
conversations: Phonic.Conversation[];
|
|
4
|
-
pagination: {
|
|
5
|
-
prev_cursor: string | null;
|
|
6
|
-
next_cursor: string | null;
|
|
7
|
-
};
|
|
8
|
-
} | {
|
|
9
|
-
conversation: Phonic.Conversation;
|
|
10
|
-
};
|
|
2
|
+
export type ConversationsListResponse = Phonic.ConversationsListResponseConversations | Phonic.ConversationsListResponseConversation;
|
|
@@ -4,6 +4,8 @@ export * from "./agents/types/index.mjs";
|
|
|
4
4
|
export * from "./auth/client/requests/index.mjs";
|
|
5
5
|
export * as auth from "./auth/index.mjs";
|
|
6
6
|
export * from "./auth/types/index.mjs";
|
|
7
|
+
export * from "./conversationItems/client/requests/index.mjs";
|
|
8
|
+
export * as conversationItems from "./conversationItems/index.mjs";
|
|
7
9
|
export * from "./conversations/client/requests/index.mjs";
|
|
8
10
|
export * as conversations from "./conversations/index.mjs";
|
|
9
11
|
export * from "./conversations/types/index.mjs";
|
|
@@ -19,3 +21,5 @@ export * from "./tools/types/index.mjs";
|
|
|
19
21
|
export * from "./voices/client/requests/index.mjs";
|
|
20
22
|
export * as voices from "./voices/index.mjs";
|
|
21
23
|
export * from "./voices/types/index.mjs";
|
|
24
|
+
export * as workspace from "./workspace/index.mjs";
|
|
25
|
+
export * from "./workspace/types/index.mjs";
|
|
@@ -4,6 +4,8 @@ export * from "./agents/types/index.mjs";
|
|
|
4
4
|
export * from "./auth/client/requests/index.mjs";
|
|
5
5
|
export * as auth from "./auth/index.mjs";
|
|
6
6
|
export * from "./auth/types/index.mjs";
|
|
7
|
+
export * from "./conversationItems/client/requests/index.mjs";
|
|
8
|
+
export * as conversationItems from "./conversationItems/index.mjs";
|
|
7
9
|
export * from "./conversations/client/requests/index.mjs";
|
|
8
10
|
export * as conversations from "./conversations/index.mjs";
|
|
9
11
|
export * from "./conversations/types/index.mjs";
|
|
@@ -19,3 +21,5 @@ export * from "./tools/types/index.mjs";
|
|
|
19
21
|
export * from "./voices/client/requests/index.mjs";
|
|
20
22
|
export * as voices from "./voices/index.mjs";
|
|
21
23
|
export * from "./voices/types/index.mjs";
|
|
24
|
+
export * as workspace from "./workspace/index.mjs";
|
|
25
|
+
export * from "./workspace/types/index.mjs";
|
|
@@ -10,4 +10,6 @@ export interface UpdateProjectRequest {
|
|
|
10
10
|
name?: string;
|
|
11
11
|
/** The name of the new project's default agent. Set to `null` to remove the default agent. */
|
|
12
12
|
default_agent?: string | null;
|
|
13
|
+
/** Maximum number of concurrent conversations allowed for this project. When `null`, the workspace `max_active_conversations` limit is used. */
|
|
14
|
+
max_active_conversations?: number | null;
|
|
13
15
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as Phonic from "../../../index.mjs";
|
|
5
|
+
export declare namespace WorkspaceClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class WorkspaceClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<WorkspaceClient.Options>;
|
|
12
|
+
constructor(options?: WorkspaceClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Returns information about the workspace.
|
|
15
|
+
*
|
|
16
|
+
* @param {WorkspaceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
|
+
*
|
|
18
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
19
|
+
* @throws {@link Phonic.InternalServerError}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await client.workspace.get()
|
|
23
|
+
*/
|
|
24
|
+
get(requestOptions?: WorkspaceClient.RequestOptions): core.HttpResponsePromise<Phonic.WorkspaceGetResponse>;
|
|
25
|
+
private __get;
|
|
26
|
+
}
|