twilio 5.2.3 → 5.3.1
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/lib/rest/Assistants.d.ts +4 -0
- package/lib/rest/Assistants.js +8 -0
- package/lib/rest/AssistantsBase.d.ts +13 -0
- package/lib/rest/AssistantsBase.js +31 -0
- package/lib/rest/Iam.d.ts +4 -0
- package/lib/rest/Iam.js +8 -0
- package/lib/rest/IamBase.d.ts +13 -0
- package/lib/rest/IamBase.js +31 -0
- package/lib/rest/Twilio.d.ts +10 -0
- package/lib/rest/Twilio.js +11 -0
- package/lib/rest/assistants/V1.d.ts +35 -0
- package/lib/rest/assistants/V1.js +60 -0
- package/lib/rest/assistants/v1/assistant/feedback.d.ts +231 -0
- package/lib/rest/assistants/v1/assistant/feedback.js +161 -0
- package/lib/rest/assistants/v1/assistant.d.ts +466 -0
- package/lib/rest/assistants/v1/assistant.js +284 -0
- package/lib/rest/assistants/v1/knowledge/chunk.d.ts +167 -0
- package/lib/rest/assistants/v1/knowledge/chunk.js +130 -0
- package/lib/rest/assistants/v1/knowledge.d.ts +385 -0
- package/lib/rest/assistants/v1/knowledge.js +273 -0
- package/lib/rest/assistants/v1/policy.d.ts +202 -0
- package/lib/rest/assistants/v1/policy.js +138 -0
- package/lib/rest/assistants/v1/session/message.d.ts +197 -0
- package/lib/rest/assistants/v1/session/message.js +140 -0
- package/lib/rest/assistants/v1/session.d.ts +231 -0
- package/lib/rest/assistants/v1/session.js +194 -0
- package/lib/rest/assistants/v1/tool.d.ts +378 -0
- package/lib/rest/assistants/v1/tool.js +242 -0
- package/lib/rest/content/v1/content/approvalFetch.d.ts +5 -5
- package/lib/rest/content/v1/content/approvalFetch.js +14 -14
- package/lib/rest/content/v1/content.d.ts +33 -3
- package/lib/rest/content/v1/content.js +16 -1
- package/lib/rest/iam/V1.d.ts +25 -0
- package/lib/rest/iam/V1.js +48 -0
- package/lib/rest/iam/v1/apiKey.d.ts +167 -0
- package/lib/rest/iam/v1/apiKey.js +161 -0
- package/lib/rest/iam/v1/getApiKeys.d.ts +163 -0
- package/lib/rest/iam/v1/getApiKeys.js +124 -0
- package/lib/rest/iam/v1/newApiKey.d.ts +90 -0
- package/lib/rest/iam/v1/newApiKey.js +90 -0
- package/lib/rest/intelligence/v2/operatorType.d.ts +1 -1
- package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.d.ts +12 -18
- package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.js +3 -6
- package/lib/rest/marketplace/v1/moduleDataManagement.d.ts +14 -6
- package/lib/rest/marketplace/v1/moduleDataManagement.js +4 -0
- package/lib/rest/numbers/v1/portingPortIn.js +1 -1
- package/lib/rest/numbers/v2/bundleClone.d.ts +1 -1
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +4 -4
- package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.d.ts +6 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.js +2 -0
- package/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.d.ts +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Assistants
|
|
9
|
+
* This is the public Twilio REST API.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.FeedbackPage = exports.FeedbackInstance = exports.FeedbackListInstance = exports.AssistantsV1ServiceCreateFeedbackRequest = void 0;
|
|
20
|
+
const util_1 = require("util");
|
|
21
|
+
const Page_1 = __importDefault(require("../../../../base/Page"));
|
|
22
|
+
const deserialize = require("../../../../base/deserialize");
|
|
23
|
+
const serialize = require("../../../../base/serialize");
|
|
24
|
+
const utility_1 = require("../../../../base/utility");
|
|
25
|
+
class AssistantsV1ServiceCreateFeedbackRequest {
|
|
26
|
+
}
|
|
27
|
+
exports.AssistantsV1ServiceCreateFeedbackRequest = AssistantsV1ServiceCreateFeedbackRequest;
|
|
28
|
+
function FeedbackListInstance(version, id) {
|
|
29
|
+
if (!(0, utility_1.isValidPathParam)(id)) {
|
|
30
|
+
throw new Error("Parameter 'id' is not valid.");
|
|
31
|
+
}
|
|
32
|
+
const instance = {};
|
|
33
|
+
instance._version = version;
|
|
34
|
+
instance._solution = { id };
|
|
35
|
+
instance._uri = `/Assistants/${id}/Feedbacks`;
|
|
36
|
+
instance.create = function create(params, callback) {
|
|
37
|
+
if (params === null || params === undefined) {
|
|
38
|
+
throw new Error('Required parameter "params" missing.');
|
|
39
|
+
}
|
|
40
|
+
let data = {};
|
|
41
|
+
data = params;
|
|
42
|
+
const headers = {};
|
|
43
|
+
headers["Content-Type"] = "application/json";
|
|
44
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
45
|
+
uri: instance._uri,
|
|
46
|
+
method: "post",
|
|
47
|
+
data,
|
|
48
|
+
headers,
|
|
49
|
+
});
|
|
50
|
+
operationPromise = operationPromise.then((payload) => new FeedbackInstance(operationVersion, payload, instance._solution.id));
|
|
51
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
52
|
+
return operationPromise;
|
|
53
|
+
};
|
|
54
|
+
instance.page = function page(params, callback) {
|
|
55
|
+
if (params instanceof Function) {
|
|
56
|
+
callback = params;
|
|
57
|
+
params = {};
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
params = params || {};
|
|
61
|
+
}
|
|
62
|
+
let data = {};
|
|
63
|
+
if (params["pageSize"] !== undefined)
|
|
64
|
+
data["PageSize"] = params["pageSize"];
|
|
65
|
+
if (params.pageNumber !== undefined)
|
|
66
|
+
data["Page"] = params.pageNumber;
|
|
67
|
+
if (params.pageToken !== undefined)
|
|
68
|
+
data["PageToken"] = params.pageToken;
|
|
69
|
+
const headers = {};
|
|
70
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
71
|
+
uri: instance._uri,
|
|
72
|
+
method: "get",
|
|
73
|
+
params: data,
|
|
74
|
+
headers,
|
|
75
|
+
});
|
|
76
|
+
operationPromise = operationPromise.then((payload) => new FeedbackPage(operationVersion, payload, instance._solution));
|
|
77
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
78
|
+
return operationPromise;
|
|
79
|
+
};
|
|
80
|
+
instance.each = instance._version.each;
|
|
81
|
+
instance.list = instance._version.list;
|
|
82
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
83
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
84
|
+
method: "get",
|
|
85
|
+
uri: targetUrl,
|
|
86
|
+
});
|
|
87
|
+
let pagePromise = operationPromise.then((payload) => new FeedbackPage(instance._version, payload, instance._solution));
|
|
88
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
89
|
+
return pagePromise;
|
|
90
|
+
};
|
|
91
|
+
instance.toJSON = function toJSON() {
|
|
92
|
+
return instance._solution;
|
|
93
|
+
};
|
|
94
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
95
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
96
|
+
};
|
|
97
|
+
return instance;
|
|
98
|
+
}
|
|
99
|
+
exports.FeedbackListInstance = FeedbackListInstance;
|
|
100
|
+
class FeedbackInstance {
|
|
101
|
+
constructor(_version, payload, id) {
|
|
102
|
+
this._version = _version;
|
|
103
|
+
this.assistantId = payload.assistant_id;
|
|
104
|
+
this.id = payload.id;
|
|
105
|
+
this.accountSid = payload.account_sid;
|
|
106
|
+
this.userSid = payload.user_sid;
|
|
107
|
+
this.messageId = payload.message_id;
|
|
108
|
+
this.score = payload.score;
|
|
109
|
+
this.sessionId = payload.session_id;
|
|
110
|
+
this.text = payload.text;
|
|
111
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
112
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Provide a user-friendly representation
|
|
116
|
+
*
|
|
117
|
+
* @returns Object
|
|
118
|
+
*/
|
|
119
|
+
toJSON() {
|
|
120
|
+
return {
|
|
121
|
+
assistantId: this.assistantId,
|
|
122
|
+
id: this.id,
|
|
123
|
+
accountSid: this.accountSid,
|
|
124
|
+
userSid: this.userSid,
|
|
125
|
+
messageId: this.messageId,
|
|
126
|
+
score: this.score,
|
|
127
|
+
sessionId: this.sessionId,
|
|
128
|
+
text: this.text,
|
|
129
|
+
dateCreated: this.dateCreated,
|
|
130
|
+
dateUpdated: this.dateUpdated,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
[util_1.inspect.custom](_depth, options) {
|
|
134
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.FeedbackInstance = FeedbackInstance;
|
|
138
|
+
class FeedbackPage extends Page_1.default {
|
|
139
|
+
/**
|
|
140
|
+
* Initialize the FeedbackPage
|
|
141
|
+
*
|
|
142
|
+
* @param version - Version of the resource
|
|
143
|
+
* @param response - Response from the API
|
|
144
|
+
* @param solution - Path solution
|
|
145
|
+
*/
|
|
146
|
+
constructor(version, response, solution) {
|
|
147
|
+
super(version, response, solution);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Build an instance of FeedbackInstance
|
|
151
|
+
*
|
|
152
|
+
* @param payload - Payload response from the API
|
|
153
|
+
*/
|
|
154
|
+
getInstance(payload) {
|
|
155
|
+
return new FeedbackInstance(this._version, payload, this._solution.id);
|
|
156
|
+
}
|
|
157
|
+
[util_1.inspect.custom](depth, options) {
|
|
158
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.FeedbackPage = FeedbackPage;
|
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
|
4
|
+
import Response from "../../../http/response";
|
|
5
|
+
import V1 from "../V1";
|
|
6
|
+
import { FeedbackListInstance } from "./assistant/feedback";
|
|
7
|
+
export declare class AssistantsV1ServiceCreateAssistantRequest {
|
|
8
|
+
"customerAi"?: AssistantsV1ServiceCustomerAi;
|
|
9
|
+
/**
|
|
10
|
+
* The name of the assistant.
|
|
11
|
+
*/
|
|
12
|
+
"name": string;
|
|
13
|
+
/**
|
|
14
|
+
* The owner/company of the assistant.
|
|
15
|
+
*/
|
|
16
|
+
"owner"?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The personality prompt to be used for assistant.
|
|
19
|
+
*/
|
|
20
|
+
"personalityPrompt"?: string;
|
|
21
|
+
"segmentCredential"?: AssistantsV1ServiceSegmentCredential;
|
|
22
|
+
}
|
|
23
|
+
export declare class AssistantsV1ServiceCustomerAi {
|
|
24
|
+
/**
|
|
25
|
+
* True if the perception engine is enabled.
|
|
26
|
+
*/
|
|
27
|
+
"perceptionEngineEnabled": boolean;
|
|
28
|
+
/**
|
|
29
|
+
* True if the personalization engine is enabled.
|
|
30
|
+
*/
|
|
31
|
+
"personalizationEngineEnabled": boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare class AssistantsV1ServiceKnowledge {
|
|
34
|
+
/**
|
|
35
|
+
* The type of knowledge source.
|
|
36
|
+
*/
|
|
37
|
+
"description"?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The description of knowledge.
|
|
40
|
+
*/
|
|
41
|
+
"id"?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
|
|
44
|
+
*/
|
|
45
|
+
"accountSid"?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The details of the knowledge source based on the type.
|
|
48
|
+
*/
|
|
49
|
+
"knowledgeSourceDetails"?: Record<string, object>;
|
|
50
|
+
/**
|
|
51
|
+
* The name of the knowledge source.
|
|
52
|
+
*/
|
|
53
|
+
"name"?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The status of processing the knowledge source (\'QUEUED\', \'PROCESSING\', \'COMPLETED\', \'FAILED\')
|
|
56
|
+
*/
|
|
57
|
+
"status"?: string;
|
|
58
|
+
/**
|
|
59
|
+
* The type of knowledge source (\'Web\', \'Database\', \'Text\', \'File\')
|
|
60
|
+
*/
|
|
61
|
+
"type"?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
64
|
+
*/
|
|
65
|
+
"dateCreated"?: Date;
|
|
66
|
+
/**
|
|
67
|
+
* The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
68
|
+
*/
|
|
69
|
+
"dateUpdated"?: Date;
|
|
70
|
+
}
|
|
71
|
+
export declare class AssistantsV1ServiceSegmentCredential {
|
|
72
|
+
/**
|
|
73
|
+
* The profile API key.
|
|
74
|
+
*/
|
|
75
|
+
"profileApiKey"?: string;
|
|
76
|
+
/**
|
|
77
|
+
* The space ID.
|
|
78
|
+
*/
|
|
79
|
+
"spaceId"?: string;
|
|
80
|
+
/**
|
|
81
|
+
* The write key.
|
|
82
|
+
*/
|
|
83
|
+
"writeKey"?: string;
|
|
84
|
+
}
|
|
85
|
+
export declare class AssistantsV1ServiceTool {
|
|
86
|
+
/**
|
|
87
|
+
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Tool resource.
|
|
88
|
+
*/
|
|
89
|
+
"accountSid"?: string;
|
|
90
|
+
/**
|
|
91
|
+
* The description of the tool.
|
|
92
|
+
*/
|
|
93
|
+
"description": string;
|
|
94
|
+
/**
|
|
95
|
+
* True if the tool is enabled.
|
|
96
|
+
*/
|
|
97
|
+
"enabled": boolean;
|
|
98
|
+
/**
|
|
99
|
+
* The tool ID.
|
|
100
|
+
*/
|
|
101
|
+
"id": string;
|
|
102
|
+
/**
|
|
103
|
+
* The metadata related to method, url, input_schema to used with the Tool.
|
|
104
|
+
*/
|
|
105
|
+
"meta": Record<string, object>;
|
|
106
|
+
/**
|
|
107
|
+
* The name of the tool.
|
|
108
|
+
*/
|
|
109
|
+
"name": string;
|
|
110
|
+
/**
|
|
111
|
+
* The authentication requirement for the tool.
|
|
112
|
+
*/
|
|
113
|
+
"requiresAuth": boolean;
|
|
114
|
+
/**
|
|
115
|
+
* The type of the tool. (\'WEBHOOK\')
|
|
116
|
+
*/
|
|
117
|
+
"type": string;
|
|
118
|
+
/**
|
|
119
|
+
* The date and time in GMT when the Tool was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
120
|
+
*/
|
|
121
|
+
"dateCreated": Date;
|
|
122
|
+
/**
|
|
123
|
+
* The date and time in GMT when the Tool was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
124
|
+
*/
|
|
125
|
+
"dateUpdated": Date;
|
|
126
|
+
}
|
|
127
|
+
export declare class AssistantsV1ServiceUpdateAssistantRequest {
|
|
128
|
+
"customerAi"?: AssistantsV1ServiceCustomerAi;
|
|
129
|
+
/**
|
|
130
|
+
* The name of the assistant.
|
|
131
|
+
*/
|
|
132
|
+
"name"?: string;
|
|
133
|
+
/**
|
|
134
|
+
* The owner/company of the assistant.
|
|
135
|
+
*/
|
|
136
|
+
"owner"?: string;
|
|
137
|
+
/**
|
|
138
|
+
* The personality prompt to be used for assistant.
|
|
139
|
+
*/
|
|
140
|
+
"personalityPrompt"?: string;
|
|
141
|
+
"segmentCredential"?: AssistantsV1ServiceSegmentCredential;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Options to pass to update a AssistantInstance
|
|
145
|
+
*/
|
|
146
|
+
export interface AssistantContextUpdateOptions {
|
|
147
|
+
/** */
|
|
148
|
+
assistantsV1ServiceUpdateAssistantRequest?: AssistantsV1ServiceUpdateAssistantRequest;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Options to pass to create a AssistantInstance
|
|
152
|
+
*/
|
|
153
|
+
export interface AssistantListInstanceCreateOptions {
|
|
154
|
+
/** */
|
|
155
|
+
assistantsV1ServiceCreateAssistantRequest: AssistantsV1ServiceCreateAssistantRequest;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Options to pass to each
|
|
159
|
+
*/
|
|
160
|
+
export interface AssistantListInstanceEachOptions {
|
|
161
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
162
|
+
pageSize?: number;
|
|
163
|
+
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
164
|
+
callback?: (item: AssistantInstance, done: (err?: Error) => void) => void;
|
|
165
|
+
/** Function to be called upon completion of streaming */
|
|
166
|
+
done?: Function;
|
|
167
|
+
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
168
|
+
limit?: number;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Options to pass to list
|
|
172
|
+
*/
|
|
173
|
+
export interface AssistantListInstanceOptions {
|
|
174
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
175
|
+
pageSize?: number;
|
|
176
|
+
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
|
177
|
+
limit?: number;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Options to pass to page
|
|
181
|
+
*/
|
|
182
|
+
export interface AssistantListInstancePageOptions {
|
|
183
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
184
|
+
pageSize?: number;
|
|
185
|
+
/** Page Number, this value is simply for client state */
|
|
186
|
+
pageNumber?: number;
|
|
187
|
+
/** PageToken provided by the API */
|
|
188
|
+
pageToken?: string;
|
|
189
|
+
}
|
|
190
|
+
export interface AssistantContext {
|
|
191
|
+
feedbacks: FeedbackListInstance;
|
|
192
|
+
/**
|
|
193
|
+
* Remove a AssistantInstance
|
|
194
|
+
*
|
|
195
|
+
* @param callback - Callback to handle processed record
|
|
196
|
+
*
|
|
197
|
+
* @returns Resolves to processed boolean
|
|
198
|
+
*/
|
|
199
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
200
|
+
/**
|
|
201
|
+
* Fetch a AssistantInstance
|
|
202
|
+
*
|
|
203
|
+
* @param callback - Callback to handle processed record
|
|
204
|
+
*
|
|
205
|
+
* @returns Resolves to processed AssistantInstance
|
|
206
|
+
*/
|
|
207
|
+
fetch(callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
|
|
208
|
+
/**
|
|
209
|
+
* Update a AssistantInstance
|
|
210
|
+
*
|
|
211
|
+
* @param callback - Callback to handle processed record
|
|
212
|
+
*
|
|
213
|
+
* @returns Resolves to processed AssistantInstance
|
|
214
|
+
*/
|
|
215
|
+
update(callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
|
|
216
|
+
/**
|
|
217
|
+
* Update a AssistantInstance
|
|
218
|
+
*
|
|
219
|
+
* @param params - Body for request
|
|
220
|
+
* @param callback - Callback to handle processed record
|
|
221
|
+
*
|
|
222
|
+
* @returns Resolves to processed AssistantInstance
|
|
223
|
+
*/
|
|
224
|
+
update(params: AssistantsV1ServiceUpdateAssistantRequest, callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
|
|
225
|
+
/**
|
|
226
|
+
* Provide a user-friendly representation
|
|
227
|
+
*/
|
|
228
|
+
toJSON(): any;
|
|
229
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
230
|
+
}
|
|
231
|
+
export interface AssistantContextSolution {
|
|
232
|
+
id: string;
|
|
233
|
+
}
|
|
234
|
+
export declare class AssistantContextImpl implements AssistantContext {
|
|
235
|
+
protected _version: V1;
|
|
236
|
+
protected _solution: AssistantContextSolution;
|
|
237
|
+
protected _uri: string;
|
|
238
|
+
protected _feedbacks?: FeedbackListInstance;
|
|
239
|
+
constructor(_version: V1, id: string);
|
|
240
|
+
get feedbacks(): FeedbackListInstance;
|
|
241
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
242
|
+
fetch(callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
|
|
243
|
+
update(params?: AssistantsV1ServiceUpdateAssistantRequest | ((error: Error | null, item?: AssistantInstance) => any), callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
|
|
244
|
+
/**
|
|
245
|
+
* Provide a user-friendly representation
|
|
246
|
+
*
|
|
247
|
+
* @returns Object
|
|
248
|
+
*/
|
|
249
|
+
toJSON(): AssistantContextSolution;
|
|
250
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
251
|
+
}
|
|
252
|
+
interface AssistantPayload extends TwilioResponsePayload {
|
|
253
|
+
assistants: AssistantResource[];
|
|
254
|
+
}
|
|
255
|
+
interface AssistantResource {
|
|
256
|
+
account_sid: string;
|
|
257
|
+
customer_ai: Record<string, object>;
|
|
258
|
+
id: string;
|
|
259
|
+
model: string;
|
|
260
|
+
name: string;
|
|
261
|
+
owner: string;
|
|
262
|
+
personality_prompt: string;
|
|
263
|
+
date_created: Date;
|
|
264
|
+
date_updated: Date;
|
|
265
|
+
knowledge: Array<AssistantsV1ServiceKnowledge>;
|
|
266
|
+
tools: Array<AssistantsV1ServiceTool>;
|
|
267
|
+
}
|
|
268
|
+
export declare class AssistantInstance {
|
|
269
|
+
protected _version: V1;
|
|
270
|
+
protected _solution: AssistantContextSolution;
|
|
271
|
+
protected _context?: AssistantContext;
|
|
272
|
+
constructor(_version: V1, payload: AssistantResource, id?: string);
|
|
273
|
+
/**
|
|
274
|
+
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource.
|
|
275
|
+
*/
|
|
276
|
+
accountSid: string;
|
|
277
|
+
/**
|
|
278
|
+
* The Personalization and Perception Engine settings.
|
|
279
|
+
*/
|
|
280
|
+
customerAi: Record<string, object>;
|
|
281
|
+
/**
|
|
282
|
+
* The Assistant ID.
|
|
283
|
+
*/
|
|
284
|
+
id: string;
|
|
285
|
+
/**
|
|
286
|
+
* The default model used by the assistant.
|
|
287
|
+
*/
|
|
288
|
+
model: string;
|
|
289
|
+
/**
|
|
290
|
+
* The name of the assistant.
|
|
291
|
+
*/
|
|
292
|
+
name: string;
|
|
293
|
+
/**
|
|
294
|
+
* The owner/company of the assistant.
|
|
295
|
+
*/
|
|
296
|
+
owner: string;
|
|
297
|
+
/**
|
|
298
|
+
* The personality prompt to be used for assistant.
|
|
299
|
+
*/
|
|
300
|
+
personalityPrompt: string;
|
|
301
|
+
/**
|
|
302
|
+
* The date and time in GMT when the Assistant was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
303
|
+
*/
|
|
304
|
+
dateCreated: Date;
|
|
305
|
+
/**
|
|
306
|
+
* The date and time in GMT when the Assistant was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
307
|
+
*/
|
|
308
|
+
dateUpdated: Date;
|
|
309
|
+
/**
|
|
310
|
+
* The list of knowledge sources associated with the assistant.
|
|
311
|
+
*/
|
|
312
|
+
knowledge: Array<AssistantsV1ServiceKnowledge>;
|
|
313
|
+
/**
|
|
314
|
+
* The list of tools associated with the assistant.
|
|
315
|
+
*/
|
|
316
|
+
tools: Array<AssistantsV1ServiceTool>;
|
|
317
|
+
private get _proxy();
|
|
318
|
+
/**
|
|
319
|
+
* Remove a AssistantInstance
|
|
320
|
+
*
|
|
321
|
+
* @param callback - Callback to handle processed record
|
|
322
|
+
*
|
|
323
|
+
* @returns Resolves to processed boolean
|
|
324
|
+
*/
|
|
325
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
326
|
+
/**
|
|
327
|
+
* Fetch a AssistantInstance
|
|
328
|
+
*
|
|
329
|
+
* @param callback - Callback to handle processed record
|
|
330
|
+
*
|
|
331
|
+
* @returns Resolves to processed AssistantInstance
|
|
332
|
+
*/
|
|
333
|
+
fetch(callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
|
|
334
|
+
/**
|
|
335
|
+
* Update a AssistantInstance
|
|
336
|
+
*
|
|
337
|
+
* @param callback - Callback to handle processed record
|
|
338
|
+
*
|
|
339
|
+
* @returns Resolves to processed AssistantInstance
|
|
340
|
+
*/
|
|
341
|
+
update(callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
|
|
342
|
+
/**
|
|
343
|
+
* Update a AssistantInstance
|
|
344
|
+
*
|
|
345
|
+
* @param params - Body for request
|
|
346
|
+
* @param callback - Callback to handle processed record
|
|
347
|
+
*
|
|
348
|
+
* @returns Resolves to processed AssistantInstance
|
|
349
|
+
*/
|
|
350
|
+
update(params: AssistantsV1ServiceUpdateAssistantRequest, callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
|
|
351
|
+
/**
|
|
352
|
+
* Access the feedbacks.
|
|
353
|
+
*/
|
|
354
|
+
feedbacks(): FeedbackListInstance;
|
|
355
|
+
/**
|
|
356
|
+
* Provide a user-friendly representation
|
|
357
|
+
*
|
|
358
|
+
* @returns Object
|
|
359
|
+
*/
|
|
360
|
+
toJSON(): {
|
|
361
|
+
accountSid: string;
|
|
362
|
+
customerAi: Record<string, object>;
|
|
363
|
+
id: string;
|
|
364
|
+
model: string;
|
|
365
|
+
name: string;
|
|
366
|
+
owner: string;
|
|
367
|
+
personalityPrompt: string;
|
|
368
|
+
dateCreated: Date;
|
|
369
|
+
dateUpdated: Date;
|
|
370
|
+
knowledge: AssistantsV1ServiceKnowledge[];
|
|
371
|
+
tools: AssistantsV1ServiceTool[];
|
|
372
|
+
};
|
|
373
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
374
|
+
}
|
|
375
|
+
export interface AssistantSolution {
|
|
376
|
+
}
|
|
377
|
+
export interface AssistantListInstance {
|
|
378
|
+
_version: V1;
|
|
379
|
+
_solution: AssistantSolution;
|
|
380
|
+
_uri: string;
|
|
381
|
+
(id: string): AssistantContext;
|
|
382
|
+
get(id: string): AssistantContext;
|
|
383
|
+
/**
|
|
384
|
+
* Create a AssistantInstance
|
|
385
|
+
*
|
|
386
|
+
* @param params - Body for request
|
|
387
|
+
* @param callback - Callback to handle processed record
|
|
388
|
+
*
|
|
389
|
+
* @returns Resolves to processed AssistantInstance
|
|
390
|
+
*/
|
|
391
|
+
create(params: AssistantsV1ServiceCreateAssistantRequest, callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
|
|
392
|
+
/**
|
|
393
|
+
* Streams AssistantInstance records from the API.
|
|
394
|
+
*
|
|
395
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
396
|
+
* is reached.
|
|
397
|
+
*
|
|
398
|
+
* The results are passed into the callback function, so this operation is memory
|
|
399
|
+
* efficient.
|
|
400
|
+
*
|
|
401
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
402
|
+
* function.
|
|
403
|
+
*
|
|
404
|
+
* @param { AssistantListInstanceEachOptions } [params] - Options for request
|
|
405
|
+
* @param { function } [callback] - Function to process each record
|
|
406
|
+
*/
|
|
407
|
+
each(callback?: (item: AssistantInstance, done: (err?: Error) => void) => void): void;
|
|
408
|
+
each(params: AssistantListInstanceEachOptions, callback?: (item: AssistantInstance, done: (err?: Error) => void) => void): void;
|
|
409
|
+
/**
|
|
410
|
+
* Retrieve a single target page of AssistantInstance records from the API.
|
|
411
|
+
*
|
|
412
|
+
* The request is executed immediately.
|
|
413
|
+
*
|
|
414
|
+
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
415
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
416
|
+
*/
|
|
417
|
+
getPage(targetUrl: string, callback?: (error: Error | null, items: AssistantPage) => any): Promise<AssistantPage>;
|
|
418
|
+
/**
|
|
419
|
+
* Lists AssistantInstance records from the API as a list.
|
|
420
|
+
*
|
|
421
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
422
|
+
* function.
|
|
423
|
+
*
|
|
424
|
+
* @param { AssistantListInstanceOptions } [params] - Options for request
|
|
425
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
426
|
+
*/
|
|
427
|
+
list(callback?: (error: Error | null, items: AssistantInstance[]) => any): Promise<AssistantInstance[]>;
|
|
428
|
+
list(params: AssistantListInstanceOptions, callback?: (error: Error | null, items: AssistantInstance[]) => any): Promise<AssistantInstance[]>;
|
|
429
|
+
/**
|
|
430
|
+
* Retrieve a single page of AssistantInstance records from the API.
|
|
431
|
+
*
|
|
432
|
+
* The request is executed immediately.
|
|
433
|
+
*
|
|
434
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
435
|
+
* function.
|
|
436
|
+
*
|
|
437
|
+
* @param { AssistantListInstancePageOptions } [params] - Options for request
|
|
438
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
439
|
+
*/
|
|
440
|
+
page(callback?: (error: Error | null, items: AssistantPage) => any): Promise<AssistantPage>;
|
|
441
|
+
page(params: AssistantListInstancePageOptions, callback?: (error: Error | null, items: AssistantPage) => any): Promise<AssistantPage>;
|
|
442
|
+
/**
|
|
443
|
+
* Provide a user-friendly representation
|
|
444
|
+
*/
|
|
445
|
+
toJSON(): any;
|
|
446
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
447
|
+
}
|
|
448
|
+
export declare function AssistantListInstance(version: V1): AssistantListInstance;
|
|
449
|
+
export declare class AssistantPage extends Page<V1, AssistantPayload, AssistantResource, AssistantInstance> {
|
|
450
|
+
/**
|
|
451
|
+
* Initialize the AssistantPage
|
|
452
|
+
*
|
|
453
|
+
* @param version - Version of the resource
|
|
454
|
+
* @param response - Response from the API
|
|
455
|
+
* @param solution - Path solution
|
|
456
|
+
*/
|
|
457
|
+
constructor(version: V1, response: Response<string>, solution: AssistantSolution);
|
|
458
|
+
/**
|
|
459
|
+
* Build an instance of AssistantInstance
|
|
460
|
+
*
|
|
461
|
+
* @param payload - Payload response from the API
|
|
462
|
+
*/
|
|
463
|
+
getInstance(payload: AssistantResource): AssistantInstance;
|
|
464
|
+
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
465
|
+
}
|
|
466
|
+
export {};
|