@superoffice/webapi 11.7.727 → 11.9.1204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +15 -15
- package/README.md +184 -184
- package/__tests__/Appointment63-notz.json +1925 -1925
- package/__tests__/Appointment63-utctz.json +1925 -1925
- package/__tests__/Appointment63.json +1925 -1925
- package/__tests__/AppointmentTzTest.ts +115 -115
- package/__tests__/AxiosNockTest.ts +28 -28
- package/__tests__/ContactDefault.json +699 -699
- package/__tests__/ContactEntity.json +272 -272
- package/__tests__/ContactRestTest.ts +144 -144
- package/__tests__/ContactTest.ts +395 -395
- package/__tests__/ConvertersTest.ts +97 -97
- package/__tests__/DocumentTest.ts +101 -101
- package/__tests__/Person210-notz.json +1932 -1932
- package/__tests__/Person210-utctz.json +1932 -1932
- package/__tests__/Person210.json +1932 -1932
- package/__tests__/PersonImageData.nock +22 -22
- package/__tests__/PersonTest.ts +41 -41
- package/__tests__/PersonTzTest.ts +113 -113
- package/__tests__/RecurrenceInfo.json +55 -55
- package/__tests__/ResponseCallbackTest.ts +23 -23
- package/__tests__/TableRights.json +441 -441
- package/__tests__/WebapiTest.ts +264 -264
- package/__tests__/Webhook.json +16 -16
- package/__tests__/WebhookTest.ts +209 -209
- package/dist/cjs/AIAgent.d.ts +62 -0
- package/dist/cjs/AIAgent.d.ts.map +1 -1
- package/dist/cjs/AIAgent.js +149 -0
- package/dist/cjs/AIAgent.js.map +1 -1
- package/dist/cjs/Carriers.d.ts +640 -14
- package/dist/cjs/Carriers.d.ts.map +1 -1
- package/dist/cjs/Converters.d.ts +24 -0
- package/dist/cjs/Converters.d.ts.map +1 -1
- package/dist/cjs/Converters.js +388 -17
- package/dist/cjs/Converters.js.map +1 -1
- package/dist/cjs/DiagnosticsAgent.d.ts +38 -0
- package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
- package/dist/cjs/DiagnosticsAgent.js +91 -0
- package/dist/cjs/DiagnosticsAgent.js.map +1 -1
- package/dist/cjs/Enums.d.ts +77 -1
- package/dist/cjs/Enums.d.ts.map +1 -1
- package/dist/cjs/Enums.js +83 -4
- package/dist/cjs/Enums.js.map +1 -1
- package/dist/cjs/ListAgent.d.ts +71 -6
- package/dist/cjs/ListAgent.d.ts.map +1 -1
- package/dist/cjs/ListAgent.js +157 -0
- package/dist/cjs/ListAgent.js.map +1 -1
- package/dist/cjs/MarketingAgent.d.ts +68 -0
- package/dist/cjs/MarketingAgent.d.ts.map +1 -1
- package/dist/cjs/MarketingAgent.js +157 -0
- package/dist/cjs/MarketingAgent.js.map +1 -1
- package/dist/cjs/TicketAgent.d.ts +23 -0
- package/dist/cjs/TicketAgent.d.ts.map +1 -1
- package/dist/cjs/TicketAgent.js +65 -0
- package/dist/cjs/TicketAgent.js.map +1 -1
- package/dist/esm/AIAgent.d.ts +62 -0
- package/dist/esm/AIAgent.d.ts.map +1 -1
- package/dist/esm/AIAgent.js +150 -1
- package/dist/esm/AIAgent.js.map +1 -1
- package/dist/esm/Carriers.d.ts +640 -14
- package/dist/esm/Carriers.d.ts.map +1 -1
- package/dist/esm/Converters.d.ts +24 -0
- package/dist/esm/Converters.d.ts.map +1 -1
- package/dist/esm/Converters.js +346 -0
- package/dist/esm/Converters.js.map +1 -1
- package/dist/esm/DiagnosticsAgent.d.ts +38 -0
- package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
- package/dist/esm/DiagnosticsAgent.js +91 -0
- package/dist/esm/DiagnosticsAgent.js.map +1 -1
- package/dist/esm/Enums.d.ts +77 -1
- package/dist/esm/Enums.d.ts.map +1 -1
- package/dist/esm/Enums.js +79 -0
- package/dist/esm/Enums.js.map +1 -1
- package/dist/esm/ListAgent.d.ts +71 -6
- package/dist/esm/ListAgent.d.ts.map +1 -1
- package/dist/esm/ListAgent.js +157 -0
- package/dist/esm/ListAgent.js.map +1 -1
- package/dist/esm/MarketingAgent.d.ts +68 -0
- package/dist/esm/MarketingAgent.d.ts.map +1 -1
- package/dist/esm/MarketingAgent.js +157 -0
- package/dist/esm/MarketingAgent.js.map +1 -1
- package/dist/esm/TicketAgent.d.ts +23 -0
- package/dist/esm/TicketAgent.d.ts.map +1 -1
- package/dist/esm/TicketAgent.js +65 -0
- package/dist/esm/TicketAgent.js.map +1 -1
- package/examples-js/hello.js +12 -12
- package/examples-ts/hello.ts +8 -8
- package/package.json +93 -93
- package/scripts/postbuild.js +22 -22
- package/scripts/setVersion.js +44 -44
- package/src/AIAgent.ts +2239 -1992
- package/src/AppointmentAgent.ts +6263 -6263
- package/src/AppointmentRestApi.ts +225 -225
- package/src/ArchiveAgent.ts +1950 -1950
- package/src/AssociateAgent.ts +422 -422
- package/src/AxiosCacheHandler.ts +74 -74
- package/src/BLOBAgent.ts +2100 -2100
- package/src/Base64.ts +285 -285
- package/src/BatchAgent.ts +910 -910
- package/src/BulkUpdateAgent.ts +504 -504
- package/src/CRMScriptAgent.ts +1390 -1390
- package/src/Carriers.ts +53121 -52274
- package/src/ChatAgent.ts +1422 -1422
- package/src/ConfigurationAgent.ts +2228 -2228
- package/src/ContactAgent.ts +1756 -1756
- package/src/ContactRestApi.ts +237 -237
- package/src/Converters.ts +23496 -23090
- package/src/CustomerServiceAgent.ts +1799 -1799
- package/src/DashAgent.ts +1674 -1674
- package/src/DatabaseAgent.ts +120 -120
- package/src/DatabaseTableAgent.ts +534 -534
- package/src/Day_js.ts +41 -41
- package/src/DiagnosticsAgent.ts +1384 -1240
- package/src/DocumentAgent.ts +5079 -5079
- package/src/DocumentMigrationAgent.ts +524 -524
- package/src/DocumentRestApi.ts +259 -259
- package/src/EMailAgent.ts +5328 -5328
- package/src/Enums.ts +6998 -6916
- package/src/ErpSyncAgent.ts +2658 -2658
- package/src/FavouriteAgent.ts +720 -720
- package/src/FindAgent.ts +2330 -2330
- package/src/ForeignSystemAgent.ts +1710 -1710
- package/src/FreeTextAgent.ts +372 -372
- package/src/ImportAgent.ts +304 -304
- package/src/LicenseAgent.ts +1230 -1230
- package/src/ListAgent.ts +11451 -11237
- package/src/MDOAgent.ts +748 -748
- package/src/MarketingAgent.ts +1146 -890
- package/src/MessagingAgent.ts +384 -384
- package/src/NavigatorAgent.ts +140 -140
- package/src/NumberAllocationAgent.ts +296 -296
- package/src/PersonAgent.ts +3287 -3287
- package/src/PersonRestApi.ts +241 -241
- package/src/PhoneListAgent.ts +458 -458
- package/src/PocketAgent.ts +780 -780
- package/src/PreferenceAgent.ts +1900 -1900
- package/src/PreviewsAgent.ts +116 -116
- package/src/ProjectAgent.ts +2391 -2391
- package/src/ProjectRestApi.ts +239 -239
- package/src/QuoteAgent.ts +5159 -5159
- package/src/RelationAgent.ts +220 -220
- package/src/ReportAgent.ts +154 -154
- package/src/ResourceAgent.ts +358 -358
- package/src/SaintAgent.ts +601 -601
- package/src/SaleAgent.ts +2034 -2034
- package/src/SaleRestApi.ts +233 -233
- package/src/SelectionAgent.ts +3195 -3195
- package/src/SentryAgent.ts +462 -462
- package/src/SoApiConstants.ts +8 -8
- package/src/TargetsAgent.ts +1104 -1104
- package/src/TicketAgent.ts +3708 -3638
- package/src/TimeZoneAgent.ts +528 -528
- package/src/TooltipsAgent.ts +116 -116
- package/src/UserAgent.ts +4856 -4856
- package/src/UserDefinedFieldInfoAgent.ts +1764 -1764
- package/src/ViewStateAgent.ts +858 -858
- package/src/WebApi.ts +872 -872
- package/src/WebApiBase.ts +565 -565
- package/src/WebhookAgent.ts +388 -388
- package/src/WorkflowAgent.ts +1338 -1338
- package/tsconfig.esm.json +8 -8
- package/tsconfig.jest.json +8 -8
- package/tsconfig.json +34 -34
package/src/AIAgent.ts
CHANGED
|
@@ -1,1992 +1,2239 @@
|
|
|
1
|
-
// <auto-generated>
|
|
2
|
-
// SuperOffice Code Generator
|
|
3
|
-
// modelling\templates\servicestswebapi\tswebapiagents.tt
|
|
4
|
-
// </auto-generated>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/* tslint:disable */
|
|
8
|
-
//----------------------------------------------------------------------------
|
|
9
|
-
// G E N E R A T E D F I L E ! D O N O T E D I T !
|
|
10
|
-
//----------------------------------------------------------------------------
|
|
11
|
-
//
|
|
12
|
-
// File: WebApi/AIAgent.ts
|
|
13
|
-
//
|
|
14
|
-
//----------------------------------------------------------------------------
|
|
15
|
-
// Copyright (C) SuperOffice AS
|
|
16
|
-
//----------------------------------------------------------------------------
|
|
17
|
-
|
|
18
|
-
import { AxiosRequestConfig } from 'axios';
|
|
19
|
-
import { Duration } from 'dayjs/plugin/duration';
|
|
20
|
-
import * as enums from './Enums';
|
|
21
|
-
import * as base from './WebApiBase';
|
|
22
|
-
import * as carriers from './Carriers';
|
|
23
|
-
import * as converters from './Converters';
|
|
24
|
-
import { FromBase64ToString, ToBase64 } from './Base64';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* AI services, such as Translation, Statistics, Sentiment analysis, backed by calls to Public Cloud providers
|
|
28
|
-
*/
|
|
29
|
-
export interface IAIAgent {
|
|
30
|
-
createDefaultCopilotDataSourceEntityAsync(): Promise< carriers.CopilotDataSourceEntity >;
|
|
31
|
-
saveCopilotDataSourceEntityAsync(entity: carriers.CopilotDataSourceEntity) : Promise< carriers.CopilotDataSourceEntity >;
|
|
32
|
-
deleteCopilotDataSourceEntityAsync(CopilotDataSourceEntityId: number) : Promise<void>;
|
|
33
|
-
createDefaultCopilotEntityAsync(): Promise< carriers.CopilotEntity >;
|
|
34
|
-
saveCopilotEntityAsync(entity: carriers.CopilotEntity) : Promise< carriers.CopilotEntity >;
|
|
35
|
-
deleteCopilotEntityAsync(CopilotEntityId: number) : Promise<void>;
|
|
36
|
-
summarizeTextAsync(request: carriers.AI_SummarizeTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
37
|
-
summarizeTextAsync(text: string, percentSmaller: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
38
|
-
expandTextAsync(request: carriers.AI_ExpandTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
39
|
-
expandTextAsync(text: string, percentBigger: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
40
|
-
rephraseTextAsync(request: carriers.AI_RephraseTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
41
|
-
rephraseTextAsync(text: string, style: enums.AiTextStyle, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
42
|
-
createTextForAppointmentAsync(request: carriers.AI_CreateTextForAppointmentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
43
|
-
createTextForAppointmentAsync(appointment: carriers.AppointmentEntity, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
44
|
-
analyzeBizCardImageAsync(request: carriers.AI_AnalyzeBizCardImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
45
|
-
analyzeBizCardImageAsync(image: ArrayBuffer|string, mergeWithDatabase: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
46
|
-
analyzeBizCardTextAsync(request: carriers.AI_AnalyzeBizCardTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
47
|
-
analyzeBizCardTextAsync(text: string, mergeWithDatabase: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
48
|
-
getTrainingStatusAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CategorizationStatusResponse >;
|
|
49
|
-
guessCategoryAsync(request: carriers.AI_GuessCategoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
50
|
-
guessCategoryAsync(ticketId: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
51
|
-
trainCategoryGuesserAsync(request: carriers.AI_TrainCategoryGuesserRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
52
|
-
trainCategoryGuesserAsync(selectionId: number, maxItems: number, maxTextLength: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
53
|
-
getChatbotResponseAsync(request: carriers.AI_GetChatbotResponseRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
54
|
-
getChatbotResponseAsync(chatId: string, isoLangCode: string, userPrompt: string, displayValue: string, previousTurns: carriers.ChatbotTurn[], apiUrl: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
55
|
-
getChatbotPromptSuggestionsAsync(request: carriers.AI_GetChatbotPromptSuggestionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
56
|
-
getChatbotPromptSuggestionsAsync(isoLangCode: string, soProtocol: string, currentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
57
|
-
getChatbotTurnsAsync(request: carriers.AI_GetChatbotTurnsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn[] >;
|
|
58
|
-
getChatbotTurnsAsync(chatId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn[] >;
|
|
59
|
-
clearChatbotTurnsAsync(request: carriers.AI_ClearChatbotTurnsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
60
|
-
clearChatbotTurnsAsync(chatId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
61
|
-
getCopilotDataSourceEntityAsync(copilotDataSourceEntityId: number) : Promise< carriers.CopilotDataSourceEntity >;
|
|
62
|
-
getCopilotEntityAsync(copilotEntityId: number) : Promise< carriers.CopilotEntity >;
|
|
63
|
-
getFormDesignFromImageAsync(request: carriers.AI_GetFormDesignFromImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
64
|
-
getFormDesignFromImageAsync(image: ArrayBuffer|string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
65
|
-
getFormDesignFromUrlAsync(request: carriers.AI_GetFormDesignFromUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
66
|
-
getFormDesignFromUrlAsync(url: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
67
|
-
detectLanguageAsync(request: carriers.AI_DetectLanguageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
68
|
-
detectLanguageAsync(text: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
69
|
-
detectSentimentAsync(request: carriers.AI_DetectSentimentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sentiment >;
|
|
70
|
-
detectSentimentAsync(text: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sentiment >;
|
|
71
|
-
translateAsync(request: carriers.AI_TranslateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
72
|
-
translateAsync(text: string, targetLanguage: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
73
|
-
translateEntityAsync(request: carriers.AI_TranslateEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
74
|
-
translateEntityAsync(entityName: string, entityId: number, targetLanguage: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
constructor(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
*
|
|
290
|
-
* @param
|
|
291
|
-
* @
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
*
|
|
348
|
-
* @param
|
|
349
|
-
* @
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
*
|
|
406
|
-
* @param
|
|
407
|
-
* @
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
*
|
|
464
|
-
* @param
|
|
465
|
-
* @returns Agenda text in markdown format
|
|
466
|
-
*/
|
|
467
|
-
public async createTextForAppointmentAsync(
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
_options =
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
*
|
|
520
|
-
* @param
|
|
521
|
-
* @returns Returns a Contact and a Person entity.
|
|
522
|
-
*/
|
|
523
|
-
public async analyzeBizCardImageAsync(
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
_options =
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
*
|
|
577
|
-
* @param
|
|
578
|
-
* @returns Returns a Contact and a Person entity.
|
|
579
|
-
*/
|
|
580
|
-
public async analyzeBizCardTextAsync(
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
_options =
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
*
|
|
662
|
-
* @
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
*
|
|
716
|
-
* @param
|
|
717
|
-
* @
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
*
|
|
774
|
-
* @param
|
|
775
|
-
* @
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
*
|
|
838
|
-
* @param
|
|
839
|
-
* @
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
*
|
|
896
|
-
* @
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
*
|
|
950
|
-
* @
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
*
|
|
1050
|
-
* @
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
*
|
|
1105
|
-
* @
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
*
|
|
1159
|
-
* @
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
*
|
|
1213
|
-
* @
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
*
|
|
1267
|
-
* @param
|
|
1268
|
-
* @returns Translated text
|
|
1269
|
-
*/
|
|
1270
|
-
public async translateAsync(
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
_options =
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
*
|
|
1323
|
-
* @param
|
|
1324
|
-
* @
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
*
|
|
1381
|
-
* @param
|
|
1382
|
-
* @
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
base.
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
*
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
public async
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
*
|
|
1964
|
-
* @
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1
|
+
// <auto-generated>
|
|
2
|
+
// SuperOffice Code Generator
|
|
3
|
+
// modelling\templates\servicestswebapi\tswebapiagents.tt
|
|
4
|
+
// </auto-generated>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/* tslint:disable */
|
|
8
|
+
//----------------------------------------------------------------------------
|
|
9
|
+
// G E N E R A T E D F I L E ! D O N O T E D I T !
|
|
10
|
+
//----------------------------------------------------------------------------
|
|
11
|
+
//
|
|
12
|
+
// File: WebApi/AIAgent.ts
|
|
13
|
+
//
|
|
14
|
+
//----------------------------------------------------------------------------
|
|
15
|
+
// Copyright (C) SuperOffice AS
|
|
16
|
+
//----------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
import { AxiosRequestConfig } from 'axios';
|
|
19
|
+
import { Duration } from 'dayjs/plugin/duration';
|
|
20
|
+
import * as enums from './Enums';
|
|
21
|
+
import * as base from './WebApiBase';
|
|
22
|
+
import * as carriers from './Carriers';
|
|
23
|
+
import * as converters from './Converters';
|
|
24
|
+
import { FromBase64ToString, ToBase64 } from './Base64';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* AI services, such as Translation, Statistics, Sentiment analysis, backed by calls to Public Cloud providers
|
|
28
|
+
*/
|
|
29
|
+
export interface IAIAgent {
|
|
30
|
+
createDefaultCopilotDataSourceEntityAsync(): Promise< carriers.CopilotDataSourceEntity >;
|
|
31
|
+
saveCopilotDataSourceEntityAsync(entity: carriers.CopilotDataSourceEntity) : Promise< carriers.CopilotDataSourceEntity >;
|
|
32
|
+
deleteCopilotDataSourceEntityAsync(CopilotDataSourceEntityId: number) : Promise<void>;
|
|
33
|
+
createDefaultCopilotEntityAsync(): Promise< carriers.CopilotEntity >;
|
|
34
|
+
saveCopilotEntityAsync(entity: carriers.CopilotEntity) : Promise< carriers.CopilotEntity >;
|
|
35
|
+
deleteCopilotEntityAsync(CopilotEntityId: number) : Promise<void>;
|
|
36
|
+
summarizeTextAsync(request: carriers.AI_SummarizeTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
37
|
+
summarizeTextAsync(text: string, percentSmaller: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
38
|
+
expandTextAsync(request: carriers.AI_ExpandTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
39
|
+
expandTextAsync(text: string, percentBigger: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
40
|
+
rephraseTextAsync(request: carriers.AI_RephraseTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
41
|
+
rephraseTextAsync(text: string, style: enums.AiTextStyle, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
42
|
+
createTextForAppointmentAsync(request: carriers.AI_CreateTextForAppointmentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
43
|
+
createTextForAppointmentAsync(appointment: carriers.AppointmentEntity, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
44
|
+
analyzeBizCardImageAsync(request: carriers.AI_AnalyzeBizCardImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
45
|
+
analyzeBizCardImageAsync(image: ArrayBuffer|string, mergeWithDatabase: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
46
|
+
analyzeBizCardTextAsync(request: carriers.AI_AnalyzeBizCardTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
47
|
+
analyzeBizCardTextAsync(text: string, mergeWithDatabase: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
48
|
+
getTrainingStatusAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CategorizationStatusResponse >;
|
|
49
|
+
guessCategoryAsync(request: carriers.AI_GuessCategoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
50
|
+
guessCategoryAsync(ticketId: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
51
|
+
trainCategoryGuesserAsync(request: carriers.AI_TrainCategoryGuesserRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
52
|
+
trainCategoryGuesserAsync(selectionId: number, maxItems: number, maxTextLength: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
53
|
+
getChatbotResponseAsync(request: carriers.AI_GetChatbotResponseRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
54
|
+
getChatbotResponseAsync(chatId: string, isoLangCode: string, userPrompt: string, displayValue: string, previousTurns: carriers.ChatbotTurn[], apiUrl: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
55
|
+
getChatbotPromptSuggestionsAsync(request: carriers.AI_GetChatbotPromptSuggestionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
56
|
+
getChatbotPromptSuggestionsAsync(isoLangCode: string, soProtocol: string, currentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
57
|
+
getChatbotTurnsAsync(request: carriers.AI_GetChatbotTurnsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn[] >;
|
|
58
|
+
getChatbotTurnsAsync(chatId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn[] >;
|
|
59
|
+
clearChatbotTurnsAsync(request: carriers.AI_ClearChatbotTurnsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
60
|
+
clearChatbotTurnsAsync(chatId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
61
|
+
getCopilotDataSourceEntityAsync(copilotDataSourceEntityId: number) : Promise< carriers.CopilotDataSourceEntity >;
|
|
62
|
+
getCopilotEntityAsync(copilotEntityId: number) : Promise< carriers.CopilotEntity >;
|
|
63
|
+
getFormDesignFromImageAsync(request: carriers.AI_GetFormDesignFromImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
64
|
+
getFormDesignFromImageAsync(image: ArrayBuffer|string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
65
|
+
getFormDesignFromUrlAsync(request: carriers.AI_GetFormDesignFromUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
66
|
+
getFormDesignFromUrlAsync(url: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
67
|
+
detectLanguageAsync(request: carriers.AI_DetectLanguageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
68
|
+
detectLanguageAsync(text: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
69
|
+
detectSentimentAsync(request: carriers.AI_DetectSentimentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sentiment >;
|
|
70
|
+
detectSentimentAsync(text: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sentiment >;
|
|
71
|
+
translateAsync(request: carriers.AI_TranslateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
72
|
+
translateAsync(text: string, targetLanguage: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
73
|
+
translateEntityAsync(request: carriers.AI_TranslateEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
74
|
+
translateEntityAsync(entityName: string, entityId: number, targetLanguage: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
75
|
+
parseQueryIntoRestrictionsAsync(request: carriers.AI_ParseQueryIntoRestrictionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NaturalLanguageSearch >;
|
|
76
|
+
parseQueryIntoRestrictionsAsync(query: string, currents: string, previousQuery: carriers.NaturalLanguageSearch, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NaturalLanguageSearch >;
|
|
77
|
+
removePhotoBackgroundAsync(request: carriers.AI_RemovePhotoBackgroundRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
|
|
78
|
+
removePhotoBackgroundAsync(image: ArrayBuffer|string, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
|
|
79
|
+
answerAsync(request: carriers.AI_AnswerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagAnswer >;
|
|
80
|
+
answerAsync(namespaceName: string, query: string, type: enums.RagType, top: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagAnswer >;
|
|
81
|
+
answerFeedbackAsync(request: carriers.AI_AnswerFeedbackRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
82
|
+
answerFeedbackAsync(trackingId: string, isThumbsUp: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
83
|
+
answerAcceptedAsync(request: carriers.AI_AnswerAcceptedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
84
|
+
answerAcceptedAsync(trackingId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
85
|
+
searchAsync(request: carriers.AI_SearchRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagResult[] >;
|
|
86
|
+
searchAsync(namespaceName: string, query: string, type: enums.RagType, top: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagResult[] >;
|
|
87
|
+
startRagIndexingAsync(request: carriers.AI_StartRagIndexingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
88
|
+
startRagIndexingAsync(namespaceName: string, sourceId: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
89
|
+
getIndexingStatusAsync(request: carriers.AI_GetIndexingStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
|
|
90
|
+
getIndexingStatusAsync(namespaceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
|
|
91
|
+
cancelIndexingAsync(request: carriers.AI_CancelIndexingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
|
|
92
|
+
cancelIndexingAsync(namespaceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
|
|
93
|
+
summarizeTicketAsync(request: carriers.AI_SummarizeTicketRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
94
|
+
summarizeTicketAsync(ticketId: number, numSentences: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
95
|
+
getSummarizeTicketPromptAsync(request: carriers.AI_GetSummarizeTicketPromptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
96
|
+
getSummarizeTicketPromptAsync(ticketId: number, numSentences: number, summary: string, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
97
|
+
summarizeContactAsync(request: carriers.AI_SummarizeContactRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
98
|
+
summarizeContactAsync(contactId: number, numSentences: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
99
|
+
getSummarizeContactPromptAsync(request: carriers.AI_GetSummarizeContactPromptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
100
|
+
getSummarizeContactPromptAsync(contactId: number, numSentences: number, summary: string, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
101
|
+
summarizeSaleAsync(request: carriers.AI_SummarizeSaleRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
102
|
+
summarizeSaleAsync(saleId: number, numSentences: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
103
|
+
getSummarizeSalePromptAsync(request: carriers.AI_GetSummarizeSalePromptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
104
|
+
getSummarizeSalePromptAsync(saleId: number, numSentences: number, summary: string, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
105
|
+
} // interface IAIAgent
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* AI services, such as Translation, Statistics, Sentiment analysis, backed by calls to Public Cloud providers
|
|
112
|
+
*/
|
|
113
|
+
export class AIAgent extends base.WebApiBase implements IAIAgent {
|
|
114
|
+
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
115
|
+
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
116
|
+
constructor(baseUrl: string, resourceManager:any);
|
|
117
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
118
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
119
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
120
|
+
constructor(options: base.WebApiOptions);
|
|
121
|
+
|
|
122
|
+
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
123
|
+
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
124
|
+
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
125
|
+
cultureCode?: string,
|
|
126
|
+
) {
|
|
127
|
+
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
128
|
+
options.basePath = "v1/Agents/AI/";
|
|
129
|
+
super(options);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Set default values into a new CopilotDataSourceEntity.
|
|
136
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
137
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
138
|
+
* @returns A blank entity.
|
|
139
|
+
*/
|
|
140
|
+
public async createDefaultCopilotDataSourceEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.CopilotDataSourceEntity > {
|
|
141
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
142
|
+
base.WebApiBase.SetPending(options);
|
|
143
|
+
return new Promise< carriers.CopilotDataSourceEntity >(async (resolve, reject) => {
|
|
144
|
+
try {
|
|
145
|
+
const response = await this._axios.post("CreateDefaultCopilotDataSourceEntity", null, config);
|
|
146
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
147
|
+
const res : carriers.CopilotDataSourceEntity = converters.Create_CopilotDataSourceEntity_From( response.data );
|
|
148
|
+
resolve(res);
|
|
149
|
+
}
|
|
150
|
+
catch( err ) {
|
|
151
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
152
|
+
reject(err);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Replace the existing CopilotDataSourceEntity or creates a new CopilotDataSourceEntity if the id parameter is empty
|
|
158
|
+
* @param entity - The CopilotDataSourceEntity to be saved.
|
|
159
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
160
|
+
* @returns New or updated CopilotDataSourceEntity
|
|
161
|
+
*/
|
|
162
|
+
public async saveCopilotDataSourceEntityAsync(entity: carriers.CopilotDataSourceEntity, options?:base.WebApiRequestOptions) : Promise< carriers.CopilotDataSourceEntity > {
|
|
163
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
164
|
+
base.WebApiBase.SetPending(options);
|
|
165
|
+
return new Promise< carriers.CopilotDataSourceEntity >(async (resolve, reject) => {
|
|
166
|
+
try {
|
|
167
|
+
const response = await this._axios.post("SaveCopilotDataSourceEntity", entity, config);
|
|
168
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
169
|
+
const res : carriers.CopilotDataSourceEntity = converters.Create_CopilotDataSourceEntity_From( response.data );
|
|
170
|
+
resolve(res);
|
|
171
|
+
}
|
|
172
|
+
catch( err ) {
|
|
173
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
174
|
+
reject(err);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Deletes the CopilotDataSourceEntity
|
|
181
|
+
* @param CopilotDataSourceEntityId - The id of the CopilotDataSourceEntity to be deleted.
|
|
182
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
183
|
+
*/
|
|
184
|
+
public async deleteCopilotDataSourceEntityAsync(CopilotDataSourceEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
185
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
186
|
+
base.WebApiBase.SetPending(options);
|
|
187
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
188
|
+
try {
|
|
189
|
+
const response = await this._axios.post("DeleteCopilotDataSourceEntity?CopilotDataSourceEntityId=" + CopilotDataSourceEntityId, null, config );
|
|
190
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
191
|
+
const res = response.data;
|
|
192
|
+
resolve(res);
|
|
193
|
+
}
|
|
194
|
+
catch( err ) {
|
|
195
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
196
|
+
reject(err);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Set default values into a new CopilotEntity.
|
|
203
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
204
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
205
|
+
* @returns A blank entity.
|
|
206
|
+
*/
|
|
207
|
+
public async createDefaultCopilotEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.CopilotEntity > {
|
|
208
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
209
|
+
base.WebApiBase.SetPending(options);
|
|
210
|
+
return new Promise< carriers.CopilotEntity >(async (resolve, reject) => {
|
|
211
|
+
try {
|
|
212
|
+
const response = await this._axios.post("CreateDefaultCopilotEntity", null, config);
|
|
213
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
214
|
+
const res : carriers.CopilotEntity = converters.Create_CopilotEntity_From( response.data );
|
|
215
|
+
resolve(res);
|
|
216
|
+
}
|
|
217
|
+
catch( err ) {
|
|
218
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
219
|
+
reject(err);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Replace the existing CopilotEntity or creates a new CopilotEntity if the id parameter is empty
|
|
225
|
+
* @param entity - The CopilotEntity to be saved.
|
|
226
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
227
|
+
* @returns New or updated CopilotEntity
|
|
228
|
+
*/
|
|
229
|
+
public async saveCopilotEntityAsync(entity: carriers.CopilotEntity, options?:base.WebApiRequestOptions) : Promise< carriers.CopilotEntity > {
|
|
230
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
231
|
+
base.WebApiBase.SetPending(options);
|
|
232
|
+
return new Promise< carriers.CopilotEntity >(async (resolve, reject) => {
|
|
233
|
+
try {
|
|
234
|
+
const response = await this._axios.post("SaveCopilotEntity", entity, config);
|
|
235
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
236
|
+
const res : carriers.CopilotEntity = converters.Create_CopilotEntity_From( response.data );
|
|
237
|
+
resolve(res);
|
|
238
|
+
}
|
|
239
|
+
catch( err ) {
|
|
240
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
241
|
+
reject(err);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Deletes the CopilotEntity
|
|
248
|
+
* @param CopilotEntityId - The id of the CopilotEntity to be deleted.
|
|
249
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
250
|
+
*/
|
|
251
|
+
public async deleteCopilotEntityAsync(CopilotEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
252
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
253
|
+
base.WebApiBase.SetPending(options);
|
|
254
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
255
|
+
try {
|
|
256
|
+
const response = await this._axios.post("DeleteCopilotEntity?CopilotEntityId=" + CopilotEntityId, null, config );
|
|
257
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
258
|
+
const res = response.data;
|
|
259
|
+
resolve(res);
|
|
260
|
+
}
|
|
261
|
+
catch( err ) {
|
|
262
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
263
|
+
reject(err);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
private async _summarizeTextAsync(request: carriers.AI_SummarizeTextRequest, options?:base.WebApiRequestOptions) : Promise< string > {
|
|
269
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
270
|
+
base.WebApiBase.SetPending(options);
|
|
271
|
+
return new Promise< string >(async (resolve, reject) => {
|
|
272
|
+
try {
|
|
273
|
+
config.baseURL = this._options.baseUrl;
|
|
274
|
+
const response = await this._axios.post("SummarizeText", request , config);
|
|
275
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
276
|
+
const res : string = response.data as string;
|
|
277
|
+
resolve(res);
|
|
278
|
+
}
|
|
279
|
+
catch( err ) {
|
|
280
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
281
|
+
reject(err);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Generate a short summary of a text
|
|
290
|
+
* @param request - Text, PercentSmaller, IsoLangCode
|
|
291
|
+
* @returns Short summary of the text
|
|
292
|
+
*/
|
|
293
|
+
public async summarizeTextAsync(request: carriers.AI_SummarizeTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Generate a short summary of a text
|
|
297
|
+
* @param text - Text to summarize
|
|
298
|
+
* @param percentSmaller - How much to shorten.
|
|
299
|
+
* @param isoLangCode - Language returned text should be in. Blank = do not specify language.
|
|
300
|
+
* @returns Short summary of the text
|
|
301
|
+
*/
|
|
302
|
+
public async summarizeTextAsync(text: string, percentSmaller: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
303
|
+
|
|
304
|
+
public async summarizeTextAsync(text:string|carriers.AI_SummarizeTextRequest, percentSmaller?:number|base.WebApiRequestOptions, isoLangCode?:string, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
|
|
305
|
+
let _request : carriers.AI_SummarizeTextRequest = null;
|
|
306
|
+
let _options : base.WebApiRequestOptions = null;
|
|
307
|
+
const first : any = text;
|
|
308
|
+
if( typeof( first ) === "object" && first && ( typeof(first.text)!='undefined' || typeof(first.percentSmaller)!='undefined' || typeof(first.isoLangCode)!='undefined' ) )
|
|
309
|
+
{
|
|
310
|
+
_request = text as carriers.AI_SummarizeTextRequest;
|
|
311
|
+
_options = percentSmaller as base.WebApiRequestOptions;
|
|
312
|
+
}
|
|
313
|
+
else
|
|
314
|
+
{
|
|
315
|
+
_request = {
|
|
316
|
+
text: text as string,
|
|
317
|
+
percentSmaller: percentSmaller as number,
|
|
318
|
+
isoLangCode: isoLangCode as string,
|
|
319
|
+
};
|
|
320
|
+
_options = webapi_options;
|
|
321
|
+
}
|
|
322
|
+
return this._summarizeTextAsync( _request, _options );
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
private async _expandTextAsync(request: carriers.AI_ExpandTextRequest, options?:base.WebApiRequestOptions) : Promise< string > {
|
|
327
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
328
|
+
base.WebApiBase.SetPending(options);
|
|
329
|
+
return new Promise< string >(async (resolve, reject) => {
|
|
330
|
+
try {
|
|
331
|
+
config.baseURL = this._options.baseUrl;
|
|
332
|
+
const response = await this._axios.post("ExpandText", request , config);
|
|
333
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
334
|
+
const res : string = response.data as string;
|
|
335
|
+
resolve(res);
|
|
336
|
+
}
|
|
337
|
+
catch( err ) {
|
|
338
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
339
|
+
reject(err);
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Generate a longer version of a text
|
|
348
|
+
* @param request - Text, PercentBigger, IsoLangCode
|
|
349
|
+
* @returns Expanded version of the text
|
|
350
|
+
*/
|
|
351
|
+
public async expandTextAsync(request: carriers.AI_ExpandTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Generate a longer version of a text
|
|
355
|
+
* @param text - Text to embiggen
|
|
356
|
+
* @param percentBigger - How much to embiggen.
|
|
357
|
+
* @param isoLangCode - Language returned text should be in. Blank = do not specify language.
|
|
358
|
+
* @returns Expanded version of the text
|
|
359
|
+
*/
|
|
360
|
+
public async expandTextAsync(text: string, percentBigger: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
361
|
+
|
|
362
|
+
public async expandTextAsync(text:string|carriers.AI_ExpandTextRequest, percentBigger?:number|base.WebApiRequestOptions, isoLangCode?:string, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
|
|
363
|
+
let _request : carriers.AI_ExpandTextRequest = null;
|
|
364
|
+
let _options : base.WebApiRequestOptions = null;
|
|
365
|
+
const first : any = text;
|
|
366
|
+
if( typeof( first ) === "object" && first && ( typeof(first.text)!='undefined' || typeof(first.percentBigger)!='undefined' || typeof(first.isoLangCode)!='undefined' ) )
|
|
367
|
+
{
|
|
368
|
+
_request = text as carriers.AI_ExpandTextRequest;
|
|
369
|
+
_options = percentBigger as base.WebApiRequestOptions;
|
|
370
|
+
}
|
|
371
|
+
else
|
|
372
|
+
{
|
|
373
|
+
_request = {
|
|
374
|
+
text: text as string,
|
|
375
|
+
percentBigger: percentBigger as number,
|
|
376
|
+
isoLangCode: isoLangCode as string,
|
|
377
|
+
};
|
|
378
|
+
_options = webapi_options;
|
|
379
|
+
}
|
|
380
|
+
return this._expandTextAsync( _request, _options );
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
private async _rephraseTextAsync(request: carriers.AI_RephraseTextRequest, options?:base.WebApiRequestOptions) : Promise< string > {
|
|
385
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
386
|
+
base.WebApiBase.SetPending(options);
|
|
387
|
+
return new Promise< string >(async (resolve, reject) => {
|
|
388
|
+
try {
|
|
389
|
+
config.baseURL = this._options.baseUrl;
|
|
390
|
+
const response = await this._axios.post("RephraseText", request , config);
|
|
391
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
392
|
+
const res : string = response.data as string;
|
|
393
|
+
resolve(res);
|
|
394
|
+
}
|
|
395
|
+
catch( err ) {
|
|
396
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
397
|
+
reject(err);
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Generate a new version of a text
|
|
406
|
+
* @param request - Text, Style, IsoLangCode
|
|
407
|
+
* @returns New version of the text
|
|
408
|
+
*/
|
|
409
|
+
public async rephraseTextAsync(request: carriers.AI_RephraseTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Generate a new version of a text
|
|
413
|
+
* @param text - Text to transform
|
|
414
|
+
* @param style - New style to transform text into (Rephrase, Correct, Casual, Formal)
|
|
415
|
+
* @param isoLangCode - Language returned text should be in. Blank = do not specify language.
|
|
416
|
+
* @returns New version of the text
|
|
417
|
+
*/
|
|
418
|
+
public async rephraseTextAsync(text: string, style: enums.AiTextStyle, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
419
|
+
|
|
420
|
+
public async rephraseTextAsync(text:string|carriers.AI_RephraseTextRequest, style?:enums.AiTextStyle|base.WebApiRequestOptions, isoLangCode?:string, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
|
|
421
|
+
let _request : carriers.AI_RephraseTextRequest = null;
|
|
422
|
+
let _options : base.WebApiRequestOptions = null;
|
|
423
|
+
const first : any = text;
|
|
424
|
+
if( typeof( first ) === "object" && first && ( typeof(first.text)!='undefined' || typeof(first.style)!='undefined' || typeof(first.isoLangCode)!='undefined' ) )
|
|
425
|
+
{
|
|
426
|
+
_request = text as carriers.AI_RephraseTextRequest;
|
|
427
|
+
_options = style as base.WebApiRequestOptions;
|
|
428
|
+
}
|
|
429
|
+
else
|
|
430
|
+
{
|
|
431
|
+
_request = {
|
|
432
|
+
text: text as string,
|
|
433
|
+
style: style as enums.AiTextStyle,
|
|
434
|
+
isoLangCode: isoLangCode as string,
|
|
435
|
+
};
|
|
436
|
+
_options = webapi_options;
|
|
437
|
+
}
|
|
438
|
+
return this._rephraseTextAsync( _request, _options );
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
private async _createTextForAppointmentAsync(request: carriers.AI_CreateTextForAppointmentRequest, options?:base.WebApiRequestOptions) : Promise< string > {
|
|
443
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
444
|
+
base.WebApiBase.SetPending(options);
|
|
445
|
+
return new Promise< string >(async (resolve, reject) => {
|
|
446
|
+
try {
|
|
447
|
+
config.baseURL = this._options.baseUrl;
|
|
448
|
+
const response = await this._axios.post("CreateTextForAppointment", request , config);
|
|
449
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
450
|
+
const res : string = response.data as string;
|
|
451
|
+
resolve(res);
|
|
452
|
+
}
|
|
453
|
+
catch( err ) {
|
|
454
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
455
|
+
reject(err);
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Generate agenda text for an appointment based on appointment's company category, title, person, etc.
|
|
464
|
+
* @param request - Appointment, IsoLangCode
|
|
465
|
+
* @returns Agenda text in markdown format
|
|
466
|
+
*/
|
|
467
|
+
public async createTextForAppointmentAsync(request: carriers.AI_CreateTextForAppointmentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Generate agenda text for an appointment based on appointment's company category, title, person, etc.
|
|
471
|
+
* @param appointment - The appointment object to generate text for.
|
|
472
|
+
* @param isoLangCode - Language returned text should be in. Blank = do not specify language.
|
|
473
|
+
* @returns Agenda text in markdown format
|
|
474
|
+
*/
|
|
475
|
+
public async createTextForAppointmentAsync(appointment: carriers.AppointmentEntity, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
476
|
+
|
|
477
|
+
public async createTextForAppointmentAsync(appointment:carriers.AppointmentEntity|carriers.AI_CreateTextForAppointmentRequest, isoLangCode?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
|
|
478
|
+
let _request : carriers.AI_CreateTextForAppointmentRequest = null;
|
|
479
|
+
let _options : base.WebApiRequestOptions = null;
|
|
480
|
+
const first : any = appointment;
|
|
481
|
+
if( typeof( first ) === "object" && first && ( typeof(first.appointment)!='undefined' || typeof(first.isoLangCode)!='undefined' ) )
|
|
482
|
+
{
|
|
483
|
+
_request = appointment as carriers.AI_CreateTextForAppointmentRequest;
|
|
484
|
+
_options = isoLangCode as base.WebApiRequestOptions;
|
|
485
|
+
}
|
|
486
|
+
else
|
|
487
|
+
{
|
|
488
|
+
_request = {
|
|
489
|
+
appointment: appointment as carriers.AppointmentEntity,
|
|
490
|
+
isoLangCode: isoLangCode as string,
|
|
491
|
+
};
|
|
492
|
+
_options = webapi_options;
|
|
493
|
+
}
|
|
494
|
+
return this._createTextForAppointmentAsync( _request, _options );
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
private async _analyzeBizCardImageAsync(request: carriers.AI_AnalyzeBizCardImageRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BizCard > {
|
|
499
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
500
|
+
base.WebApiBase.SetPending(options);
|
|
501
|
+
return new Promise< carriers.BizCard >(async (resolve, reject) => {
|
|
502
|
+
try {
|
|
503
|
+
config.baseURL = this._options.baseUrl;
|
|
504
|
+
const response = await this._axios.post("AnalyzeBizCardImage", request , config);
|
|
505
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
506
|
+
const res : carriers.BizCard = converters.Create_BizCard_From( response.data );
|
|
507
|
+
resolve(res);
|
|
508
|
+
}
|
|
509
|
+
catch( err ) {
|
|
510
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
511
|
+
reject(err);
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Returns contact and person information from an image. Merges results with matching database records if merge = true
|
|
520
|
+
* @param request - Image, MergeWithDatabase
|
|
521
|
+
* @returns Returns a Contact and a Person entity.
|
|
522
|
+
*/
|
|
523
|
+
public async analyzeBizCardImageAsync(request: carriers.AI_AnalyzeBizCardImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Returns contact and person information from an image. Merges results with matching database records if merge = true
|
|
527
|
+
* @param image - Image data containg a business card
|
|
528
|
+
* @param mergeWithDatabase - Merge results from analysis with matching database records? True: match company/person names and set ids on returned entities.
|
|
529
|
+
* @returns Returns a Contact and a Person entity.
|
|
530
|
+
*/
|
|
531
|
+
public async analyzeBizCardImageAsync(image: ArrayBuffer|string, mergeWithDatabase: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
532
|
+
|
|
533
|
+
public async analyzeBizCardImageAsync(image:ArrayBuffer|string|carriers.AI_AnalyzeBizCardImageRequest, mergeWithDatabase?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard > {
|
|
534
|
+
let _request : carriers.AI_AnalyzeBizCardImageRequest = null;
|
|
535
|
+
let _options : base.WebApiRequestOptions = null;
|
|
536
|
+
const first : any = image;
|
|
537
|
+
if( typeof( first ) === "object" && first && ( typeof(first.image)!='undefined' || typeof(first.mergeWithDatabase)!='undefined' ) )
|
|
538
|
+
{
|
|
539
|
+
_request = image as carriers.AI_AnalyzeBizCardImageRequest;
|
|
540
|
+
_options = mergeWithDatabase as base.WebApiRequestOptions;
|
|
541
|
+
}
|
|
542
|
+
else
|
|
543
|
+
{
|
|
544
|
+
_request = {
|
|
545
|
+
image: image as ArrayBuffer|string,
|
|
546
|
+
mergeWithDatabase: mergeWithDatabase as boolean,
|
|
547
|
+
};
|
|
548
|
+
_options = webapi_options;
|
|
549
|
+
}
|
|
550
|
+
_request.image = ToBase64(_request.image);
|
|
551
|
+
return this._analyzeBizCardImageAsync( _request, _options );
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
private async _analyzeBizCardTextAsync(request: carriers.AI_AnalyzeBizCardTextRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BizCard > {
|
|
556
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
557
|
+
base.WebApiBase.SetPending(options);
|
|
558
|
+
return new Promise< carriers.BizCard >(async (resolve, reject) => {
|
|
559
|
+
try {
|
|
560
|
+
config.baseURL = this._options.baseUrl;
|
|
561
|
+
const response = await this._axios.post("AnalyzeBizCardText", request , config);
|
|
562
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
563
|
+
const res : carriers.BizCard = converters.Create_BizCard_From( response.data );
|
|
564
|
+
resolve(res);
|
|
565
|
+
}
|
|
566
|
+
catch( err ) {
|
|
567
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
568
|
+
reject(err);
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Extract contact and person information from text. Merge results with matching database records if merge = true
|
|
577
|
+
* @param request - Text, MergeWithDatabase
|
|
578
|
+
* @returns Returns a Contact and a Person entity.
|
|
579
|
+
*/
|
|
580
|
+
public async analyzeBizCardTextAsync(request: carriers.AI_AnalyzeBizCardTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Extract contact and person information from text. Merge results with matching database records if merge = true
|
|
584
|
+
* @param text - Text that contains useful contact and person information.
|
|
585
|
+
* @param mergeWithDatabase - Merge results from analysis with matching database records? True: match company/person names and set ids on returned entities.
|
|
586
|
+
* @returns Returns a Contact and a Person entity.
|
|
587
|
+
*/
|
|
588
|
+
public async analyzeBizCardTextAsync(text: string, mergeWithDatabase: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
589
|
+
|
|
590
|
+
public async analyzeBizCardTextAsync(text:string|carriers.AI_AnalyzeBizCardTextRequest, mergeWithDatabase?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard > {
|
|
591
|
+
let _request : carriers.AI_AnalyzeBizCardTextRequest = null;
|
|
592
|
+
let _options : base.WebApiRequestOptions = null;
|
|
593
|
+
const first : any = text;
|
|
594
|
+
if( typeof( first ) === "object" && first && ( typeof(first.text)!='undefined' || typeof(first.mergeWithDatabase)!='undefined' ) )
|
|
595
|
+
{
|
|
596
|
+
_request = text as carriers.AI_AnalyzeBizCardTextRequest;
|
|
597
|
+
_options = mergeWithDatabase as base.WebApiRequestOptions;
|
|
598
|
+
}
|
|
599
|
+
else
|
|
600
|
+
{
|
|
601
|
+
_request = {
|
|
602
|
+
text: text as string,
|
|
603
|
+
mergeWithDatabase: mergeWithDatabase as boolean,
|
|
604
|
+
};
|
|
605
|
+
_options = webapi_options;
|
|
606
|
+
}
|
|
607
|
+
return this._analyzeBizCardTextAsync( _request, _options );
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
private async _getTrainingStatusAsync( options?:base.WebApiRequestOptions) : Promise< carriers.CategorizationStatusResponse > {
|
|
612
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
613
|
+
base.WebApiBase.SetPending(options);
|
|
614
|
+
return new Promise< carriers.CategorizationStatusResponse >(async (resolve, reject) => {
|
|
615
|
+
try {
|
|
616
|
+
config.baseURL = this._options.baseUrl;
|
|
617
|
+
const response = await this._axios.post("GetTrainingStatus", undefined , config);
|
|
618
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
619
|
+
const res : carriers.CategorizationStatusResponse = converters.Create_CategorizationStatusResponse_From( response.data );
|
|
620
|
+
resolve(res);
|
|
621
|
+
}
|
|
622
|
+
catch( err ) {
|
|
623
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
624
|
+
reject(err);
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Calling the HugoAI endpoint to fetch the current training status.
|
|
632
|
+
* @returns Carrier to describe the current status of HugoAI categorization
|
|
633
|
+
*/
|
|
634
|
+
public async getTrainingStatusAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CategorizationStatusResponse >
|
|
635
|
+
{
|
|
636
|
+
return this._getTrainingStatusAsync(webapi_options);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
private async _guessCategoryAsync(request: carriers.AI_GuessCategoryRequest, options?:base.WebApiRequestOptions) : Promise< number > {
|
|
641
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
642
|
+
base.WebApiBase.SetPending(options);
|
|
643
|
+
return new Promise< number >(async (resolve, reject) => {
|
|
644
|
+
try {
|
|
645
|
+
config.baseURL = this._options.baseUrl;
|
|
646
|
+
const response = await this._axios.post("GuessCategory", request , config);
|
|
647
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
648
|
+
const res : number = response.data as number;
|
|
649
|
+
resolve(res);
|
|
650
|
+
}
|
|
651
|
+
catch( err ) {
|
|
652
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
653
|
+
reject(err);
|
|
654
|
+
}
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Given a ticket's id, guess the ticket category it should be placed in. Currently this is based on the first message in the ticket
|
|
662
|
+
* @param request - TicketId
|
|
663
|
+
* @returns Suggested ticket category ID
|
|
664
|
+
*/
|
|
665
|
+
public async guessCategoryAsync(request: carriers.AI_GuessCategoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Given a ticket's id, guess the ticket category it should be placed in. Currently this is based on the first message in the ticket
|
|
669
|
+
* @param ticketId - Id of ticket to guess category for
|
|
670
|
+
* @returns Suggested ticket category ID
|
|
671
|
+
*/
|
|
672
|
+
public async guessCategoryAsync(ticketId: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
673
|
+
|
|
674
|
+
public async guessCategoryAsync(ticketId:number|carriers.AI_GuessCategoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
|
|
675
|
+
let _request : carriers.AI_GuessCategoryRequest = null;
|
|
676
|
+
let _options : base.WebApiRequestOptions = null;
|
|
677
|
+
const first : any = ticketId;
|
|
678
|
+
if( typeof( first ) === "object" && first && ( typeof(first.ticketId)!='undefined' ) )
|
|
679
|
+
{
|
|
680
|
+
_request = ticketId as carriers.AI_GuessCategoryRequest;
|
|
681
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
682
|
+
}
|
|
683
|
+
else
|
|
684
|
+
{
|
|
685
|
+
_request = {
|
|
686
|
+
ticketId: ticketId as number,
|
|
687
|
+
};
|
|
688
|
+
_options = webapi_options;
|
|
689
|
+
}
|
|
690
|
+
return this._guessCategoryAsync( _request, _options );
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
private async _trainCategoryGuesserAsync(request: carriers.AI_TrainCategoryGuesserRequest, options?:base.WebApiRequestOptions) : Promise< string > {
|
|
695
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
696
|
+
base.WebApiBase.SetPending(options);
|
|
697
|
+
return new Promise< string >(async (resolve, reject) => {
|
|
698
|
+
try {
|
|
699
|
+
config.baseURL = this._options.baseUrl;
|
|
700
|
+
const response = await this._axios.post("TrainCategoryGuesser", request , config);
|
|
701
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
702
|
+
const res : string = response.data as string;
|
|
703
|
+
resolve(res);
|
|
704
|
+
}
|
|
705
|
+
catch( err ) {
|
|
706
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
707
|
+
reject(err);
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* The category guesser training API will be called with an array of CategorizationTrainingItem during the (background, Batch) execution of this call
|
|
716
|
+
* @param request - SelectionId, MaxItems, MaxTextLength
|
|
717
|
+
* @returns Placeholder for result... should this be a BatchTaskId? maybe not useful?
|
|
718
|
+
*/
|
|
719
|
+
public async trainCategoryGuesserAsync(request: carriers.AI_TrainCategoryGuesserRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* The category guesser training API will be called with an array of CategorizationTrainingItem during the (background, Batch) execution of this call
|
|
723
|
+
* @param selectionId - Id of selection of tickets, to retrieve training data from
|
|
724
|
+
* @param maxItems - Maximum number of tickets to retrieve data from
|
|
725
|
+
* @param maxTextLength - Maximum length of PlainTextBody or any other large text, truncated to nearest word boundary
|
|
726
|
+
* @returns Placeholder for result... should this be a BatchTaskId? maybe not useful?
|
|
727
|
+
*/
|
|
728
|
+
public async trainCategoryGuesserAsync(selectionId: number, maxItems: number, maxTextLength: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
729
|
+
|
|
730
|
+
public async trainCategoryGuesserAsync(selectionId:number|carriers.AI_TrainCategoryGuesserRequest, maxItems?:number|base.WebApiRequestOptions, maxTextLength?:number, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
|
|
731
|
+
let _request : carriers.AI_TrainCategoryGuesserRequest = null;
|
|
732
|
+
let _options : base.WebApiRequestOptions = null;
|
|
733
|
+
const first : any = selectionId;
|
|
734
|
+
if( typeof( first ) === "object" && first && ( typeof(first.selectionId)!='undefined' || typeof(first.maxItems)!='undefined' || typeof(first.maxTextLength)!='undefined' ) )
|
|
735
|
+
{
|
|
736
|
+
_request = selectionId as carriers.AI_TrainCategoryGuesserRequest;
|
|
737
|
+
_options = maxItems as base.WebApiRequestOptions;
|
|
738
|
+
}
|
|
739
|
+
else
|
|
740
|
+
{
|
|
741
|
+
_request = {
|
|
742
|
+
selectionId: selectionId as number,
|
|
743
|
+
maxItems: maxItems as number,
|
|
744
|
+
maxTextLength: maxTextLength as number,
|
|
745
|
+
};
|
|
746
|
+
_options = webapi_options;
|
|
747
|
+
}
|
|
748
|
+
return this._trainCategoryGuesserAsync( _request, _options );
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
private async _getChatbotResponseAsync(request: carriers.AI_GetChatbotResponseRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn > {
|
|
753
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
754
|
+
base.WebApiBase.SetPending(options);
|
|
755
|
+
return new Promise< carriers.ChatbotTurn >(async (resolve, reject) => {
|
|
756
|
+
try {
|
|
757
|
+
config.baseURL = this._options.baseUrl;
|
|
758
|
+
const response = await this._axios.post("GetChatbotResponse", request , config);
|
|
759
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
760
|
+
const res : carriers.ChatbotTurn = converters.Create_ChatbotTurn_From( response.data );
|
|
761
|
+
resolve(res);
|
|
762
|
+
}
|
|
763
|
+
catch( err ) {
|
|
764
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
765
|
+
reject(err);
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Return a chatbot response given prompt and previous turns. Stores the new turn in the history for the chatId
|
|
774
|
+
* @param request - ChatId, IsoLangCode, UserPrompt, DisplayValue, PreviousTurns, ApiUrl
|
|
775
|
+
* @returns Returns new turn that client can append to its local history.
|
|
776
|
+
*/
|
|
777
|
+
public async getChatbotResponseAsync(request: carriers.AI_GetChatbotResponseRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Return a chatbot response given prompt and previous turns. Stores the new turn in the history for the chatId
|
|
781
|
+
* @param chatId - identifies this chat = arbitrary name (e.g. user-defined) or the soprotocol + id (e.g. ticket-123, contact-43, diary)
|
|
782
|
+
* @param isoLangCode - ISO2 Language code ('en', 'no', 'de'...) for suggestions in response
|
|
783
|
+
* @param userPrompt - User question for chatbot
|
|
784
|
+
* @param displayValue - User question for display - optional - null = use userPrompt
|
|
785
|
+
* @param previousTurns - Chat history - all previous turns in chronological order
|
|
786
|
+
* @param apiUrl - CRM API endpoint URL for chatbot to make callbacks to. 'https://example.com/superoffice/api/'
|
|
787
|
+
* @returns Returns new turn that client can append to its local history.
|
|
788
|
+
*/
|
|
789
|
+
public async getChatbotResponseAsync(chatId: string, isoLangCode: string, userPrompt: string, displayValue: string, previousTurns: carriers.ChatbotTurn[], apiUrl: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
790
|
+
|
|
791
|
+
public async getChatbotResponseAsync(chatId:string|carriers.AI_GetChatbotResponseRequest, isoLangCode?:string|base.WebApiRequestOptions, userPrompt?:string, displayValue?:string, previousTurns?:carriers.ChatbotTurn[], apiUrl?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn > {
|
|
792
|
+
let _request : carriers.AI_GetChatbotResponseRequest = null;
|
|
793
|
+
let _options : base.WebApiRequestOptions = null;
|
|
794
|
+
const first : any = chatId;
|
|
795
|
+
if( typeof( first ) === "object" && first && ( typeof(first.chatId)!='undefined' || typeof(first.isoLangCode)!='undefined' || typeof(first.userPrompt)!='undefined' || typeof(first.displayValue)!='undefined' || typeof(first.previousTurns)!='undefined' || typeof(first.apiUrl)!='undefined' ) )
|
|
796
|
+
{
|
|
797
|
+
_request = chatId as carriers.AI_GetChatbotResponseRequest;
|
|
798
|
+
_options = isoLangCode as base.WebApiRequestOptions;
|
|
799
|
+
}
|
|
800
|
+
else
|
|
801
|
+
{
|
|
802
|
+
_request = {
|
|
803
|
+
chatId: chatId as string,
|
|
804
|
+
isoLangCode: isoLangCode as string,
|
|
805
|
+
userPrompt: userPrompt as string,
|
|
806
|
+
displayValue: displayValue as string,
|
|
807
|
+
previousTurns: previousTurns as carriers.ChatbotTurn[],
|
|
808
|
+
apiUrl: apiUrl as string,
|
|
809
|
+
};
|
|
810
|
+
_options = webapi_options;
|
|
811
|
+
}
|
|
812
|
+
return this._getChatbotResponseAsync( _request, _options );
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
private async _getChatbotPromptSuggestionsAsync(request: carriers.AI_GetChatbotPromptSuggestionsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn > {
|
|
817
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
818
|
+
base.WebApiBase.SetPending(options);
|
|
819
|
+
return new Promise< carriers.ChatbotTurn >(async (resolve, reject) => {
|
|
820
|
+
try {
|
|
821
|
+
config.baseURL = this._options.baseUrl;
|
|
822
|
+
const response = await this._axios.post("GetChatbotPromptSuggestions", request , config);
|
|
823
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
824
|
+
const res : carriers.ChatbotTurn = converters.Create_ChatbotTurn_From( response.data );
|
|
825
|
+
resolve(res);
|
|
826
|
+
}
|
|
827
|
+
catch( err ) {
|
|
828
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
829
|
+
reject(err);
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Return one or more suggested prompts as actions to display in an empty chat window
|
|
838
|
+
* @param request - IsoLangCode, SoProtocol, CurrentId
|
|
839
|
+
* @returns Contains zero or more BotActions, and welcome message in Bot response
|
|
840
|
+
*/
|
|
841
|
+
public async getChatbotPromptSuggestionsAsync(request: carriers.AI_GetChatbotPromptSuggestionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Return one or more suggested prompts as actions to display in an empty chat window
|
|
845
|
+
* @param isoLangCode - ISO2 Language code ('en', 'no', 'de'...) for suggestions in response
|
|
846
|
+
* @param soProtocol - Context for suggestions ('contact.main.activities')
|
|
847
|
+
* @param currentId - current company/person/project id - used for context in suggestions
|
|
848
|
+
* @returns Contains zero or more BotActions, and welcome message in Bot response
|
|
849
|
+
*/
|
|
850
|
+
public async getChatbotPromptSuggestionsAsync(isoLangCode: string, soProtocol: string, currentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
851
|
+
|
|
852
|
+
public async getChatbotPromptSuggestionsAsync(isoLangCode:string|carriers.AI_GetChatbotPromptSuggestionsRequest, soProtocol?:string|base.WebApiRequestOptions, currentId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn > {
|
|
853
|
+
let _request : carriers.AI_GetChatbotPromptSuggestionsRequest = null;
|
|
854
|
+
let _options : base.WebApiRequestOptions = null;
|
|
855
|
+
const first : any = isoLangCode;
|
|
856
|
+
if( typeof( first ) === "object" && first && ( typeof(first.isoLangCode)!='undefined' || typeof(first.soProtocol)!='undefined' || typeof(first.currentId)!='undefined' ) )
|
|
857
|
+
{
|
|
858
|
+
_request = isoLangCode as carriers.AI_GetChatbotPromptSuggestionsRequest;
|
|
859
|
+
_options = soProtocol as base.WebApiRequestOptions;
|
|
860
|
+
}
|
|
861
|
+
else
|
|
862
|
+
{
|
|
863
|
+
_request = {
|
|
864
|
+
isoLangCode: isoLangCode as string,
|
|
865
|
+
soProtocol: soProtocol as string,
|
|
866
|
+
currentId: currentId as number,
|
|
867
|
+
};
|
|
868
|
+
_options = webapi_options;
|
|
869
|
+
}
|
|
870
|
+
return this._getChatbotPromptSuggestionsAsync( _request, _options );
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
private async _getChatbotTurnsAsync(request: carriers.AI_GetChatbotTurnsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn[] > {
|
|
875
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
876
|
+
base.WebApiBase.SetPending(options);
|
|
877
|
+
return new Promise< carriers.ChatbotTurn[] >(async (resolve, reject) => {
|
|
878
|
+
try {
|
|
879
|
+
config.baseURL = this._options.baseUrl;
|
|
880
|
+
const response = await this._axios.post("GetChatbotTurns", request , config);
|
|
881
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
882
|
+
const res : carriers.ChatbotTurn[] = converters.Create_ChatbotTurnArray_From( response.data );
|
|
883
|
+
resolve(res);
|
|
884
|
+
}
|
|
885
|
+
catch( err ) {
|
|
886
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
887
|
+
reject(err);
|
|
888
|
+
}
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* Returns stored history of chat messages for a given chat_id. Chat_id is usually derived from soproto + current id, but could also be arbitrary name.
|
|
896
|
+
* @param request - ChatId
|
|
897
|
+
* @returns Array containing zero or more turns. If you got zero turns, call GetChatbotPromptSuggestions to get an initial turn from the bot.
|
|
898
|
+
*/
|
|
899
|
+
public async getChatbotTurnsAsync(request: carriers.AI_GetChatbotTurnsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn[] >;
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* Returns stored history of chat messages for a given chat_id. Chat_id is usually derived from soproto + current id, but could also be arbitrary name.
|
|
903
|
+
* @param chatId - identifies this chat = arbitrary name (e.g. user-defined) or the soprotocol + id (e.g. ticket-123, contact-43, diary)
|
|
904
|
+
* @returns Array containing zero or more turns. If you got zero turns, call GetChatbotPromptSuggestions to get an initial turn from the bot.
|
|
905
|
+
*/
|
|
906
|
+
public async getChatbotTurnsAsync(chatId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn[] >;
|
|
907
|
+
|
|
908
|
+
public async getChatbotTurnsAsync(chatId:string|carriers.AI_GetChatbotTurnsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn[] > {
|
|
909
|
+
let _request : carriers.AI_GetChatbotTurnsRequest = null;
|
|
910
|
+
let _options : base.WebApiRequestOptions = null;
|
|
911
|
+
const first : any = chatId;
|
|
912
|
+
if( typeof( first ) === "object" && first && ( typeof(first.chatId)!='undefined' ) )
|
|
913
|
+
{
|
|
914
|
+
_request = chatId as carriers.AI_GetChatbotTurnsRequest;
|
|
915
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
916
|
+
}
|
|
917
|
+
else
|
|
918
|
+
{
|
|
919
|
+
_request = {
|
|
920
|
+
chatId: chatId as string,
|
|
921
|
+
};
|
|
922
|
+
_options = webapi_options;
|
|
923
|
+
}
|
|
924
|
+
return this._getChatbotTurnsAsync( _request, _options );
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
private async _clearChatbotTurnsAsync(request: carriers.AI_ClearChatbotTurnsRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
929
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
930
|
+
base.WebApiBase.SetPending(options);
|
|
931
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
932
|
+
try {
|
|
933
|
+
config.baseURL = this._options.baseUrl;
|
|
934
|
+
const response = await this._axios.post("ClearChatbotTurns", request , config);
|
|
935
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
936
|
+
const res = response.data;
|
|
937
|
+
resolve(res);
|
|
938
|
+
}
|
|
939
|
+
catch( err ) {
|
|
940
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
941
|
+
reject(err);
|
|
942
|
+
}
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Clears the stored history of chat messages for a given chat_id. Chat_id is usually derived from soproto + current id, but could also be arbitrary name
|
|
950
|
+
* @param request - ChatId
|
|
951
|
+
* @returns This method has no return value
|
|
952
|
+
*/
|
|
953
|
+
public async clearChatbotTurnsAsync(request: carriers.AI_ClearChatbotTurnsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Clears the stored history of chat messages for a given chat_id. Chat_id is usually derived from soproto + current id, but could also be arbitrary name
|
|
957
|
+
* @param chatId - identifies this chat = arbitrary name (e.g. user-defined) or the soprotocol + id (e.g. ticket-123, contact-43, diary)
|
|
958
|
+
* @returns This method has no return value
|
|
959
|
+
*/
|
|
960
|
+
public async clearChatbotTurnsAsync(chatId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
961
|
+
|
|
962
|
+
public async clearChatbotTurnsAsync(chatId:string|carriers.AI_ClearChatbotTurnsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
963
|
+
let _request : carriers.AI_ClearChatbotTurnsRequest = null;
|
|
964
|
+
let _options : base.WebApiRequestOptions = null;
|
|
965
|
+
const first : any = chatId;
|
|
966
|
+
if( typeof( first ) === "object" && first && ( typeof(first.chatId)!='undefined' ) )
|
|
967
|
+
{
|
|
968
|
+
_request = chatId as carriers.AI_ClearChatbotTurnsRequest;
|
|
969
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
970
|
+
}
|
|
971
|
+
else
|
|
972
|
+
{
|
|
973
|
+
_request = {
|
|
974
|
+
chatId: chatId as string,
|
|
975
|
+
};
|
|
976
|
+
_options = webapi_options;
|
|
977
|
+
}
|
|
978
|
+
return this._clearChatbotTurnsAsync( _request, _options );
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* Gets a CopilotDataSourceEntity object.
|
|
983
|
+
* @param copilotDataSourceEntityId - The primary key.
|
|
984
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
985
|
+
* @returns A single CopilotDataSourceEntity
|
|
986
|
+
*/
|
|
987
|
+
public async getCopilotDataSourceEntityAsync(copilotDataSourceEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.CopilotDataSourceEntity > {
|
|
988
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
989
|
+
base.WebApiBase.SetPending(options);
|
|
990
|
+
return new Promise< carriers.CopilotDataSourceEntity >(async (resolve, reject) => {
|
|
991
|
+
try {
|
|
992
|
+
const response = await this._axios.post("GetCopilotDataSourceEntity?copilotDataSourceEntityId=" + copilotDataSourceEntityId, null, config);
|
|
993
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
994
|
+
const res = converters.Create_CopilotDataSourceEntity_From( response.data );
|
|
995
|
+
resolve(res);
|
|
996
|
+
}
|
|
997
|
+
catch( err ) {
|
|
998
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
999
|
+
reject(err);
|
|
1000
|
+
}
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* Gets a CopilotEntity object.
|
|
1006
|
+
* @param copilotEntityId - The primary key.
|
|
1007
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
1008
|
+
* @returns A single CopilotEntity
|
|
1009
|
+
*/
|
|
1010
|
+
public async getCopilotEntityAsync(copilotEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.CopilotEntity > {
|
|
1011
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1012
|
+
base.WebApiBase.SetPending(options);
|
|
1013
|
+
return new Promise< carriers.CopilotEntity >(async (resolve, reject) => {
|
|
1014
|
+
try {
|
|
1015
|
+
const response = await this._axios.post("GetCopilotEntity?copilotEntityId=" + copilotEntityId, null, config);
|
|
1016
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1017
|
+
const res = converters.Create_CopilotEntity_From( response.data );
|
|
1018
|
+
resolve(res);
|
|
1019
|
+
}
|
|
1020
|
+
catch( err ) {
|
|
1021
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1022
|
+
reject(err);
|
|
1023
|
+
}
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
private async _getFormDesignFromImageAsync(request: carriers.AI_GetFormDesignFromImageRequest, options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary > {
|
|
1029
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1030
|
+
base.WebApiBase.SetPending(options);
|
|
1031
|
+
return new Promise< carriers.StringDictionary >(async (resolve, reject) => {
|
|
1032
|
+
try {
|
|
1033
|
+
config.baseURL = this._options.baseUrl;
|
|
1034
|
+
const response = await this._axios.post("GetFormDesignFromImage", request , config);
|
|
1035
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1036
|
+
const res : carriers.StringDictionary = converters.Create_StringDictionary_From( response.data );
|
|
1037
|
+
resolve(res);
|
|
1038
|
+
}
|
|
1039
|
+
catch( err ) {
|
|
1040
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1041
|
+
reject(err);
|
|
1042
|
+
}
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* Returns Form Designer properties based on the look of a picture
|
|
1050
|
+
* @param request - Image
|
|
1051
|
+
* @returns Returns a Form Designer properties.
|
|
1052
|
+
*/
|
|
1053
|
+
public async getFormDesignFromImageAsync(request: carriers.AI_GetFormDesignFromImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* Returns Form Designer properties based on the look of a picture
|
|
1057
|
+
* @param image - Image data to analyze for design
|
|
1058
|
+
* @returns Returns a Form Designer properties.
|
|
1059
|
+
*/
|
|
1060
|
+
public async getFormDesignFromImageAsync(image: ArrayBuffer|string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
1061
|
+
|
|
1062
|
+
public async getFormDesignFromImageAsync(image:ArrayBuffer|string|carriers.AI_GetFormDesignFromImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary > {
|
|
1063
|
+
let _request : carriers.AI_GetFormDesignFromImageRequest = null;
|
|
1064
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1065
|
+
const first : any = image;
|
|
1066
|
+
if( typeof( first ) === "object" && first && ( typeof(first.image)!='undefined' ) )
|
|
1067
|
+
{
|
|
1068
|
+
_request = image as carriers.AI_GetFormDesignFromImageRequest;
|
|
1069
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1070
|
+
}
|
|
1071
|
+
else
|
|
1072
|
+
{
|
|
1073
|
+
_request = {
|
|
1074
|
+
image: image as ArrayBuffer|string,
|
|
1075
|
+
};
|
|
1076
|
+
_options = webapi_options;
|
|
1077
|
+
}
|
|
1078
|
+
_request.image = ToBase64(_request.image);
|
|
1079
|
+
return this._getFormDesignFromImageAsync( _request, _options );
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
private async _getFormDesignFromUrlAsync(request: carriers.AI_GetFormDesignFromUrlRequest, options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary > {
|
|
1084
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1085
|
+
base.WebApiBase.SetPending(options);
|
|
1086
|
+
return new Promise< carriers.StringDictionary >(async (resolve, reject) => {
|
|
1087
|
+
try {
|
|
1088
|
+
config.baseURL = this._options.baseUrl;
|
|
1089
|
+
const response = await this._axios.post("GetFormDesignFromUrl", request , config);
|
|
1090
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1091
|
+
const res : carriers.StringDictionary = converters.Create_StringDictionary_From( response.data );
|
|
1092
|
+
resolve(res);
|
|
1093
|
+
}
|
|
1094
|
+
catch( err ) {
|
|
1095
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1096
|
+
reject(err);
|
|
1097
|
+
}
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
|
|
1103
|
+
/**
|
|
1104
|
+
* Returns Form Designer properties based on the look of a web page
|
|
1105
|
+
* @param request - Url
|
|
1106
|
+
* @returns Returns a Form Designer properties.
|
|
1107
|
+
*/
|
|
1108
|
+
public async getFormDesignFromUrlAsync(request: carriers.AI_GetFormDesignFromUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* Returns Form Designer properties based on the look of a web page
|
|
1112
|
+
* @param url - Url of the web page to extract style from.
|
|
1113
|
+
* @returns Returns a Form Designer properties.
|
|
1114
|
+
*/
|
|
1115
|
+
public async getFormDesignFromUrlAsync(url: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
1116
|
+
|
|
1117
|
+
public async getFormDesignFromUrlAsync(url:string|carriers.AI_GetFormDesignFromUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary > {
|
|
1118
|
+
let _request : carriers.AI_GetFormDesignFromUrlRequest = null;
|
|
1119
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1120
|
+
const first : any = url;
|
|
1121
|
+
if( typeof( first ) === "object" && first && ( typeof(first.url)!='undefined' ) )
|
|
1122
|
+
{
|
|
1123
|
+
_request = url as carriers.AI_GetFormDesignFromUrlRequest;
|
|
1124
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1125
|
+
}
|
|
1126
|
+
else
|
|
1127
|
+
{
|
|
1128
|
+
_request = {
|
|
1129
|
+
url: url as string,
|
|
1130
|
+
};
|
|
1131
|
+
_options = webapi_options;
|
|
1132
|
+
}
|
|
1133
|
+
return this._getFormDesignFromUrlAsync( _request, _options );
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
|
|
1137
|
+
private async _detectLanguageAsync(request: carriers.AI_DetectLanguageRequest, options?:base.WebApiRequestOptions) : Promise< string > {
|
|
1138
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1139
|
+
base.WebApiBase.SetPending(options);
|
|
1140
|
+
return new Promise< string >(async (resolve, reject) => {
|
|
1141
|
+
try {
|
|
1142
|
+
config.baseURL = this._options.baseUrl;
|
|
1143
|
+
const response = await this._axios.post("DetectLanguage", request , config);
|
|
1144
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1145
|
+
const res : string = response.data as string;
|
|
1146
|
+
resolve(res);
|
|
1147
|
+
}
|
|
1148
|
+
catch( err ) {
|
|
1149
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1150
|
+
reject(err);
|
|
1151
|
+
}
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
/**
|
|
1158
|
+
* Given a (reasonably short) text, detect the language it is written in
|
|
1159
|
+
* @param request - Text
|
|
1160
|
+
* @returns ISO Language code, such as NO, US, ES, FR
|
|
1161
|
+
*/
|
|
1162
|
+
public async detectLanguageAsync(request: carriers.AI_DetectLanguageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
1163
|
+
|
|
1164
|
+
/**
|
|
1165
|
+
* Given a (reasonably short) text, detect the language it is written in
|
|
1166
|
+
* @param text - Text to be analyzed; there may be a cost-per-character so do not send a book here
|
|
1167
|
+
* @returns ISO Language code, such as NO, US, ES, FR
|
|
1168
|
+
*/
|
|
1169
|
+
public async detectLanguageAsync(text: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
1170
|
+
|
|
1171
|
+
public async detectLanguageAsync(text:string|carriers.AI_DetectLanguageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
|
|
1172
|
+
let _request : carriers.AI_DetectLanguageRequest = null;
|
|
1173
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1174
|
+
const first : any = text;
|
|
1175
|
+
if( typeof( first ) === "object" && first && ( typeof(first.text)!='undefined' ) )
|
|
1176
|
+
{
|
|
1177
|
+
_request = text as carriers.AI_DetectLanguageRequest;
|
|
1178
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1179
|
+
}
|
|
1180
|
+
else
|
|
1181
|
+
{
|
|
1182
|
+
_request = {
|
|
1183
|
+
text: text as string,
|
|
1184
|
+
};
|
|
1185
|
+
_options = webapi_options;
|
|
1186
|
+
}
|
|
1187
|
+
return this._detectLanguageAsync( _request, _options );
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
|
|
1191
|
+
private async _detectSentimentAsync(request: carriers.AI_DetectSentimentRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Sentiment > {
|
|
1192
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1193
|
+
base.WebApiBase.SetPending(options);
|
|
1194
|
+
return new Promise< carriers.Sentiment >(async (resolve, reject) => {
|
|
1195
|
+
try {
|
|
1196
|
+
config.baseURL = this._options.baseUrl;
|
|
1197
|
+
const response = await this._axios.post("DetectSentiment", request , config);
|
|
1198
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1199
|
+
const res : carriers.Sentiment = converters.Create_Sentiment_From( response.data );
|
|
1200
|
+
resolve(res);
|
|
1201
|
+
}
|
|
1202
|
+
catch( err ) {
|
|
1203
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1204
|
+
reject(err);
|
|
1205
|
+
}
|
|
1206
|
+
});
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* Detect the sentiment of a (reasonably short) text. Sentiment analysis may cause a translation to be made, since sentiment analysis only supports a limited set of languages
|
|
1213
|
+
* @param request - Text
|
|
1214
|
+
* @returns The sentiment information: score (-100 to +100) and confidence
|
|
1215
|
+
*/
|
|
1216
|
+
public async detectSentimentAsync(request: carriers.AI_DetectSentimentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sentiment >;
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* Detect the sentiment of a (reasonably short) text. Sentiment analysis may cause a translation to be made, since sentiment analysis only supports a limited set of languages
|
|
1220
|
+
* @param text - Text to be analyzed
|
|
1221
|
+
* @returns The sentiment information: score (-100 to +100) and confidence
|
|
1222
|
+
*/
|
|
1223
|
+
public async detectSentimentAsync(text: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sentiment >;
|
|
1224
|
+
|
|
1225
|
+
public async detectSentimentAsync(text:string|carriers.AI_DetectSentimentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sentiment > {
|
|
1226
|
+
let _request : carriers.AI_DetectSentimentRequest = null;
|
|
1227
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1228
|
+
const first : any = text;
|
|
1229
|
+
if( typeof( first ) === "object" && first && ( typeof(first.text)!='undefined' ) )
|
|
1230
|
+
{
|
|
1231
|
+
_request = text as carriers.AI_DetectSentimentRequest;
|
|
1232
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1233
|
+
}
|
|
1234
|
+
else
|
|
1235
|
+
{
|
|
1236
|
+
_request = {
|
|
1237
|
+
text: text as string,
|
|
1238
|
+
};
|
|
1239
|
+
_options = webapi_options;
|
|
1240
|
+
}
|
|
1241
|
+
return this._detectSentimentAsync( _request, _options );
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
private async _translateAsync(request: carriers.AI_TranslateRequest, options?:base.WebApiRequestOptions) : Promise< string > {
|
|
1246
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1247
|
+
base.WebApiBase.SetPending(options);
|
|
1248
|
+
return new Promise< string >(async (resolve, reject) => {
|
|
1249
|
+
try {
|
|
1250
|
+
config.baseURL = this._options.baseUrl;
|
|
1251
|
+
const response = await this._axios.post("Translate", request , config);
|
|
1252
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1253
|
+
const res : string = response.data as string;
|
|
1254
|
+
resolve(res);
|
|
1255
|
+
}
|
|
1256
|
+
catch( err ) {
|
|
1257
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1258
|
+
reject(err);
|
|
1259
|
+
}
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
|
|
1265
|
+
/**
|
|
1266
|
+
* Translate a text from one language to another. Language of the text is automatically detected.
|
|
1267
|
+
* @param request - Text, TargetLanguage
|
|
1268
|
+
* @returns Translated text
|
|
1269
|
+
*/
|
|
1270
|
+
public async translateAsync(request: carriers.AI_TranslateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
1271
|
+
|
|
1272
|
+
/**
|
|
1273
|
+
* Translate a text from one language to another. Language of the text is automatically detected.
|
|
1274
|
+
* @param text - Text to be translated. Language of the text is automatically detected.
|
|
1275
|
+
* @param targetLanguage - ISO Language code (such as FR) to translate the text into
|
|
1276
|
+
* @returns Translated text
|
|
1277
|
+
*/
|
|
1278
|
+
public async translateAsync(text: string, targetLanguage: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
1279
|
+
|
|
1280
|
+
public async translateAsync(text:string|carriers.AI_TranslateRequest, targetLanguage?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
|
|
1281
|
+
let _request : carriers.AI_TranslateRequest = null;
|
|
1282
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1283
|
+
const first : any = text;
|
|
1284
|
+
if( typeof( first ) === "object" && first && ( typeof(first.text)!='undefined' || typeof(first.targetLanguage)!='undefined' ) )
|
|
1285
|
+
{
|
|
1286
|
+
_request = text as carriers.AI_TranslateRequest;
|
|
1287
|
+
_options = targetLanguage as base.WebApiRequestOptions;
|
|
1288
|
+
}
|
|
1289
|
+
else
|
|
1290
|
+
{
|
|
1291
|
+
_request = {
|
|
1292
|
+
text: text as string,
|
|
1293
|
+
targetLanguage: targetLanguage as string,
|
|
1294
|
+
};
|
|
1295
|
+
_options = webapi_options;
|
|
1296
|
+
}
|
|
1297
|
+
return this._translateAsync( _request, _options );
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
private async _translateEntityAsync(request: carriers.AI_TranslateEntityRequest, options?:base.WebApiRequestOptions) : Promise< string > {
|
|
1302
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1303
|
+
base.WebApiBase.SetPending(options);
|
|
1304
|
+
return new Promise< string >(async (resolve, reject) => {
|
|
1305
|
+
try {
|
|
1306
|
+
config.baseURL = this._options.baseUrl;
|
|
1307
|
+
const response = await this._axios.post("TranslateEntity", request , config);
|
|
1308
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1309
|
+
const res : string = response.data as string;
|
|
1310
|
+
resolve(res);
|
|
1311
|
+
}
|
|
1312
|
+
catch( err ) {
|
|
1313
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1314
|
+
reject(err);
|
|
1315
|
+
}
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* Retrieve, format and translate text for an entity to a specified language
|
|
1323
|
+
* @param request - EntityName, EntityId, TargetLanguage
|
|
1324
|
+
* @returns Translated text
|
|
1325
|
+
*/
|
|
1326
|
+
public async translateEntityAsync(request: carriers.AI_TranslateEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
1327
|
+
|
|
1328
|
+
/**
|
|
1329
|
+
* Retrieve, format and translate text for an entity to a specified language
|
|
1330
|
+
* @param entityName - Name of entity to get the text to be translated; eg., 'ticketMessage'
|
|
1331
|
+
* @param entityId - Identifier for the entity to get text to be translated
|
|
1332
|
+
* @param targetLanguage - ISO Language code (such as FR) to translate the text into
|
|
1333
|
+
* @returns Translated text
|
|
1334
|
+
*/
|
|
1335
|
+
public async translateEntityAsync(entityName: string, entityId: number, targetLanguage: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
1336
|
+
|
|
1337
|
+
public async translateEntityAsync(entityName:string|carriers.AI_TranslateEntityRequest, entityId?:number|base.WebApiRequestOptions, targetLanguage?:string, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
|
|
1338
|
+
let _request : carriers.AI_TranslateEntityRequest = null;
|
|
1339
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1340
|
+
const first : any = entityName;
|
|
1341
|
+
if( typeof( first ) === "object" && first && ( typeof(first.entityName)!='undefined' || typeof(first.entityId)!='undefined' || typeof(first.targetLanguage)!='undefined' ) )
|
|
1342
|
+
{
|
|
1343
|
+
_request = entityName as carriers.AI_TranslateEntityRequest;
|
|
1344
|
+
_options = entityId as base.WebApiRequestOptions;
|
|
1345
|
+
}
|
|
1346
|
+
else
|
|
1347
|
+
{
|
|
1348
|
+
_request = {
|
|
1349
|
+
entityName: entityName as string,
|
|
1350
|
+
entityId: entityId as number,
|
|
1351
|
+
targetLanguage: targetLanguage as string,
|
|
1352
|
+
};
|
|
1353
|
+
_options = webapi_options;
|
|
1354
|
+
}
|
|
1355
|
+
return this._translateEntityAsync( _request, _options );
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
private async _parseQueryIntoRestrictionsAsync(request: carriers.AI_ParseQueryIntoRestrictionsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.NaturalLanguageSearch > {
|
|
1360
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1361
|
+
base.WebApiBase.SetPending(options);
|
|
1362
|
+
return new Promise< carriers.NaturalLanguageSearch >(async (resolve, reject) => {
|
|
1363
|
+
try {
|
|
1364
|
+
config.baseURL = this._options.baseUrl;
|
|
1365
|
+
const response = await this._axios.post("ParseQueryIntoRestrictions", request , config);
|
|
1366
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1367
|
+
const res : carriers.NaturalLanguageSearch = converters.Create_NaturalLanguageSearch_From( response.data );
|
|
1368
|
+
resolve(res);
|
|
1369
|
+
}
|
|
1370
|
+
catch( err ) {
|
|
1371
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1372
|
+
reject(err);
|
|
1373
|
+
}
|
|
1374
|
+
});
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Return archive restrictions based on a natural language query.
|
|
1381
|
+
* @param request - Query, Currents, PreviousQuery
|
|
1382
|
+
* @returns Returns archive restrictions and columns for the query. Pass this result in as the previous query on the next call to continue the conversation.
|
|
1383
|
+
*/
|
|
1384
|
+
public async parseQueryIntoRestrictionsAsync(request: carriers.AI_ParseQueryIntoRestrictionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NaturalLanguageSearch >;
|
|
1385
|
+
|
|
1386
|
+
/**
|
|
1387
|
+
* Return archive restrictions based on a natural language query.
|
|
1388
|
+
* @param query - What the user asked for.
|
|
1389
|
+
* @param currents - Current context prompt. e.g. Current company name and id, what selection are we looking at?
|
|
1390
|
+
* @param previousQuery - Previous query, if applicable. NULL if no previous query.
|
|
1391
|
+
* @returns Returns archive restrictions and columns for the query. Pass this result in as the previous query on the next call to continue the conversation.
|
|
1392
|
+
*/
|
|
1393
|
+
public async parseQueryIntoRestrictionsAsync(query: string, currents: string, previousQuery: carriers.NaturalLanguageSearch, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NaturalLanguageSearch >;
|
|
1394
|
+
|
|
1395
|
+
public async parseQueryIntoRestrictionsAsync(query:string|carriers.AI_ParseQueryIntoRestrictionsRequest, currents?:string|base.WebApiRequestOptions, previousQuery?:carriers.NaturalLanguageSearch, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NaturalLanguageSearch > {
|
|
1396
|
+
let _request : carriers.AI_ParseQueryIntoRestrictionsRequest = null;
|
|
1397
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1398
|
+
const first : any = query;
|
|
1399
|
+
if( typeof( first ) === "object" && first && ( typeof(first.query)!='undefined' || typeof(first.currents)!='undefined' || typeof(first.previousQuery)!='undefined' ) )
|
|
1400
|
+
{
|
|
1401
|
+
_request = query as carriers.AI_ParseQueryIntoRestrictionsRequest;
|
|
1402
|
+
_options = currents as base.WebApiRequestOptions;
|
|
1403
|
+
}
|
|
1404
|
+
else
|
|
1405
|
+
{
|
|
1406
|
+
_request = {
|
|
1407
|
+
query: query as string,
|
|
1408
|
+
currents: currents as string,
|
|
1409
|
+
previousQuery: previousQuery as carriers.NaturalLanguageSearch,
|
|
1410
|
+
};
|
|
1411
|
+
_options = webapi_options;
|
|
1412
|
+
}
|
|
1413
|
+
return this._parseQueryIntoRestrictionsAsync( _request, _options );
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
private async _removePhotoBackgroundAsync(request: carriers.AI_RemovePhotoBackgroundRequest, options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string > {
|
|
1418
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options) || {};
|
|
1419
|
+
base.WebApiBase.SetPending(options);
|
|
1420
|
+
return new Promise< ArrayBuffer|string >(async (resolve, reject) => {
|
|
1421
|
+
try {
|
|
1422
|
+
if( ! options || options.returnBlobAs == base.ReturnBlobType.AsArrayBuffer ) {
|
|
1423
|
+
config.responseType = "arraybuffer";
|
|
1424
|
+
config.headers = config.headers || {};
|
|
1425
|
+
config.headers["Accept"] = "application/octet-stream";
|
|
1426
|
+
}
|
|
1427
|
+
config.baseURL = this._options.baseUrl;
|
|
1428
|
+
const response = await this._axios.post("RemovePhotoBackground", request , config);
|
|
1429
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1430
|
+
let res : ArrayBuffer | string = null;
|
|
1431
|
+
if( options && options.returnBlobAs != base.ReturnBlobType.AsArrayBuffer )
|
|
1432
|
+
{
|
|
1433
|
+
res = response.data as string;
|
|
1434
|
+
if( options.returnBlobAs == base.ReturnBlobType.AsString )
|
|
1435
|
+
{
|
|
1436
|
+
res = FromBase64ToString(res);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
else
|
|
1440
|
+
{
|
|
1441
|
+
res = response.data as ArrayBuffer;
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
resolve(res);
|
|
1445
|
+
}
|
|
1446
|
+
catch( err ) {
|
|
1447
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1448
|
+
reject(err);
|
|
1449
|
+
}
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* Returns an image with the background removed, leaving only the main subject
|
|
1457
|
+
* @param request - Image
|
|
1458
|
+
* @returns Image with background removed
|
|
1459
|
+
*/
|
|
1460
|
+
public async removePhotoBackgroundAsync(request: carriers.AI_RemovePhotoBackgroundRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
|
|
1461
|
+
|
|
1462
|
+
/**
|
|
1463
|
+
* Returns an image with the background removed, leaving only the main subject
|
|
1464
|
+
* @param image - Image to be cleaned. JPG or PNG.
|
|
1465
|
+
* @returns Image with background removed
|
|
1466
|
+
*/
|
|
1467
|
+
public async removePhotoBackgroundAsync(image: ArrayBuffer|string, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
|
|
1468
|
+
|
|
1469
|
+
public async removePhotoBackgroundAsync(image:ArrayBuffer|string|carriers.AI_RemovePhotoBackgroundRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string > {
|
|
1470
|
+
let _request : carriers.AI_RemovePhotoBackgroundRequest = null;
|
|
1471
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1472
|
+
const first : any = image;
|
|
1473
|
+
if( typeof( first ) === "object" && first && ( typeof(first.image)!='undefined' ) )
|
|
1474
|
+
{
|
|
1475
|
+
_request = image as carriers.AI_RemovePhotoBackgroundRequest;
|
|
1476
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1477
|
+
}
|
|
1478
|
+
else
|
|
1479
|
+
{
|
|
1480
|
+
_request = {
|
|
1481
|
+
image: image as ArrayBuffer|string,
|
|
1482
|
+
};
|
|
1483
|
+
_options = webapi_options;
|
|
1484
|
+
}
|
|
1485
|
+
_request.image = ToBase64(_request.image);
|
|
1486
|
+
return this._removePhotoBackgroundAsync( _request, _options );
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
private async _answerAsync(request: carriers.AI_AnswerRequest, options?:base.WebApiRequestOptions) : Promise< carriers.RagAnswer > {
|
|
1491
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1492
|
+
base.WebApiBase.SetPending(options);
|
|
1493
|
+
return new Promise< carriers.RagAnswer >(async (resolve, reject) => {
|
|
1494
|
+
try {
|
|
1495
|
+
config.baseURL = this._options.baseUrl;
|
|
1496
|
+
const response = await this._axios.post("Answer", request , config);
|
|
1497
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1498
|
+
const res : carriers.RagAnswer = converters.Create_RagAnswer_From( response.data );
|
|
1499
|
+
resolve(res);
|
|
1500
|
+
}
|
|
1501
|
+
catch( err ) {
|
|
1502
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1503
|
+
reject(err);
|
|
1504
|
+
}
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
|
|
1510
|
+
/**
|
|
1511
|
+
* Returns an answer.
|
|
1512
|
+
* @param request - NamespaceName, Query, Type, Top
|
|
1513
|
+
* @returns Generated answer based on query.
|
|
1514
|
+
*/
|
|
1515
|
+
public async answerAsync(request: carriers.AI_AnswerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagAnswer >;
|
|
1516
|
+
|
|
1517
|
+
/**
|
|
1518
|
+
* Returns an answer.
|
|
1519
|
+
* @param namespaceName - Defines the search domain used for generating answer. e.g. 'ServiceCopilot'
|
|
1520
|
+
* @param query - Question. The search query to answer.
|
|
1521
|
+
* @param type - Filter results based on content type. Default: None = no filtering
|
|
1522
|
+
* @param top - Max Number of results to use in generating answer.
|
|
1523
|
+
* @returns Generated answer based on query.
|
|
1524
|
+
*/
|
|
1525
|
+
public async answerAsync(namespaceName: string, query: string, type: enums.RagType, top: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagAnswer >;
|
|
1526
|
+
|
|
1527
|
+
public async answerAsync(namespaceName:string|carriers.AI_AnswerRequest, query?:string|base.WebApiRequestOptions, type?:enums.RagType, top?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagAnswer > {
|
|
1528
|
+
let _request : carriers.AI_AnswerRequest = null;
|
|
1529
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1530
|
+
const first : any = namespaceName;
|
|
1531
|
+
if( typeof( first ) === "object" && first && ( typeof(first.namespaceName)!='undefined' || typeof(first.query)!='undefined' || typeof(first.type)!='undefined' || typeof(first.top)!='undefined' ) )
|
|
1532
|
+
{
|
|
1533
|
+
_request = namespaceName as carriers.AI_AnswerRequest;
|
|
1534
|
+
_options = query as base.WebApiRequestOptions;
|
|
1535
|
+
}
|
|
1536
|
+
else
|
|
1537
|
+
{
|
|
1538
|
+
_request = {
|
|
1539
|
+
namespaceName: namespaceName as string,
|
|
1540
|
+
query: query as string,
|
|
1541
|
+
type: type as enums.RagType,
|
|
1542
|
+
top: top as number,
|
|
1543
|
+
};
|
|
1544
|
+
_options = webapi_options;
|
|
1545
|
+
}
|
|
1546
|
+
return this._answerAsync( _request, _options );
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
|
|
1550
|
+
private async _answerFeedbackAsync(request: carriers.AI_AnswerFeedbackRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1551
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1552
|
+
base.WebApiBase.SetPending(options);
|
|
1553
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
1554
|
+
try {
|
|
1555
|
+
config.baseURL = this._options.baseUrl;
|
|
1556
|
+
const response = await this._axios.post("AnswerFeedback", request , config);
|
|
1557
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1558
|
+
const res = response.data;
|
|
1559
|
+
resolve(res);
|
|
1560
|
+
}
|
|
1561
|
+
catch( err ) {
|
|
1562
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1563
|
+
reject(err);
|
|
1564
|
+
}
|
|
1565
|
+
});
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* Send feedback on answer - feedback is logged and used to improve the answer algorithm.
|
|
1572
|
+
* @param request - TrackingId, IsThumbsUp
|
|
1573
|
+
* @returns This method has no return value
|
|
1574
|
+
*/
|
|
1575
|
+
public async answerFeedbackAsync(request: carriers.AI_AnswerFeedbackRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1576
|
+
|
|
1577
|
+
/**
|
|
1578
|
+
* Send feedback on answer - feedback is logged and used to improve the answer algorithm.
|
|
1579
|
+
* @param trackingId - The id of the answer that you are giving feedback to.
|
|
1580
|
+
* @param isThumbsUp - True = Like, False = Dislike.
|
|
1581
|
+
* @returns This method has no return value
|
|
1582
|
+
*/
|
|
1583
|
+
public async answerFeedbackAsync(trackingId: string, isThumbsUp: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1584
|
+
|
|
1585
|
+
public async answerFeedbackAsync(trackingId:string|carriers.AI_AnswerFeedbackRequest, isThumbsUp?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1586
|
+
let _request : carriers.AI_AnswerFeedbackRequest = null;
|
|
1587
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1588
|
+
const first : any = trackingId;
|
|
1589
|
+
if( typeof( first ) === "object" && first && ( typeof(first.trackingId)!='undefined' || typeof(first.isThumbsUp)!='undefined' ) )
|
|
1590
|
+
{
|
|
1591
|
+
_request = trackingId as carriers.AI_AnswerFeedbackRequest;
|
|
1592
|
+
_options = isThumbsUp as base.WebApiRequestOptions;
|
|
1593
|
+
}
|
|
1594
|
+
else
|
|
1595
|
+
{
|
|
1596
|
+
_request = {
|
|
1597
|
+
trackingId: trackingId as string,
|
|
1598
|
+
isThumbsUp: isThumbsUp as boolean,
|
|
1599
|
+
};
|
|
1600
|
+
_options = webapi_options;
|
|
1601
|
+
}
|
|
1602
|
+
return this._answerFeedbackAsync( _request, _options );
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
|
|
1606
|
+
private async _answerAcceptedAsync(request: carriers.AI_AnswerAcceptedRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1607
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1608
|
+
base.WebApiBase.SetPending(options);
|
|
1609
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
1610
|
+
try {
|
|
1611
|
+
config.baseURL = this._options.baseUrl;
|
|
1612
|
+
const response = await this._axios.post("AnswerAccepted", request , config);
|
|
1613
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1614
|
+
const res = response.data;
|
|
1615
|
+
resolve(res);
|
|
1616
|
+
}
|
|
1617
|
+
catch( err ) {
|
|
1618
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1619
|
+
reject(err);
|
|
1620
|
+
}
|
|
1621
|
+
});
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
/**
|
|
1627
|
+
* Signal that answer was inserted into response- feedback is logged and used to improve the answer algorithm.
|
|
1628
|
+
* @param request - TrackingId
|
|
1629
|
+
* @returns This method has no return value
|
|
1630
|
+
*/
|
|
1631
|
+
public async answerAcceptedAsync(request: carriers.AI_AnswerAcceptedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1632
|
+
|
|
1633
|
+
/**
|
|
1634
|
+
* Signal that answer was inserted into response- feedback is logged and used to improve the answer algorithm.
|
|
1635
|
+
* @param trackingId - The id of the answer that you are giving feedback to.
|
|
1636
|
+
* @returns This method has no return value
|
|
1637
|
+
*/
|
|
1638
|
+
public async answerAcceptedAsync(trackingId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1639
|
+
|
|
1640
|
+
public async answerAcceptedAsync(trackingId:string|carriers.AI_AnswerAcceptedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1641
|
+
let _request : carriers.AI_AnswerAcceptedRequest = null;
|
|
1642
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1643
|
+
const first : any = trackingId;
|
|
1644
|
+
if( typeof( first ) === "object" && first && ( typeof(first.trackingId)!='undefined' ) )
|
|
1645
|
+
{
|
|
1646
|
+
_request = trackingId as carriers.AI_AnswerAcceptedRequest;
|
|
1647
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1648
|
+
}
|
|
1649
|
+
else
|
|
1650
|
+
{
|
|
1651
|
+
_request = {
|
|
1652
|
+
trackingId: trackingId as string,
|
|
1653
|
+
};
|
|
1654
|
+
_options = webapi_options;
|
|
1655
|
+
}
|
|
1656
|
+
return this._answerAcceptedAsync( _request, _options );
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
|
|
1660
|
+
private async _searchAsync(request: carriers.AI_SearchRequest, options?:base.WebApiRequestOptions) : Promise< carriers.RagResult[] > {
|
|
1661
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1662
|
+
base.WebApiBase.SetPending(options);
|
|
1663
|
+
return new Promise< carriers.RagResult[] >(async (resolve, reject) => {
|
|
1664
|
+
try {
|
|
1665
|
+
config.baseURL = this._options.baseUrl;
|
|
1666
|
+
const response = await this._axios.post("Search", request , config);
|
|
1667
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1668
|
+
const res : carriers.RagResult[] = converters.Create_RagResultArray_From( response.data );
|
|
1669
|
+
resolve(res);
|
|
1670
|
+
}
|
|
1671
|
+
catch( err ) {
|
|
1672
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1673
|
+
reject(err);
|
|
1674
|
+
}
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
|
|
1679
|
+
|
|
1680
|
+
/**
|
|
1681
|
+
* Returns semantic search results from vector database.
|
|
1682
|
+
* @param request - NamespaceName, Query, Type, Top
|
|
1683
|
+
* @returns Array containing vector search results
|
|
1684
|
+
*/
|
|
1685
|
+
public async searchAsync(request: carriers.AI_SearchRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagResult[] >;
|
|
1686
|
+
|
|
1687
|
+
/**
|
|
1688
|
+
* Returns semantic search results from vector database.
|
|
1689
|
+
* @param namespaceName - Defines the search domain. e.g. 'ServiceCopilot'.
|
|
1690
|
+
* @param query - Search query.
|
|
1691
|
+
* @param type - Filter results based on a specific content type. Default: None = no filtering
|
|
1692
|
+
* @param top - Max Number of results to return.
|
|
1693
|
+
* @returns Array containing vector search results
|
|
1694
|
+
*/
|
|
1695
|
+
public async searchAsync(namespaceName: string, query: string, type: enums.RagType, top: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagResult[] >;
|
|
1696
|
+
|
|
1697
|
+
public async searchAsync(namespaceName:string|carriers.AI_SearchRequest, query?:string|base.WebApiRequestOptions, type?:enums.RagType, top?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagResult[] > {
|
|
1698
|
+
let _request : carriers.AI_SearchRequest = null;
|
|
1699
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1700
|
+
const first : any = namespaceName;
|
|
1701
|
+
if( typeof( first ) === "object" && first && ( typeof(first.namespaceName)!='undefined' || typeof(first.query)!='undefined' || typeof(first.type)!='undefined' || typeof(first.top)!='undefined' ) )
|
|
1702
|
+
{
|
|
1703
|
+
_request = namespaceName as carriers.AI_SearchRequest;
|
|
1704
|
+
_options = query as base.WebApiRequestOptions;
|
|
1705
|
+
}
|
|
1706
|
+
else
|
|
1707
|
+
{
|
|
1708
|
+
_request = {
|
|
1709
|
+
namespaceName: namespaceName as string,
|
|
1710
|
+
query: query as string,
|
|
1711
|
+
type: type as enums.RagType,
|
|
1712
|
+
top: top as number,
|
|
1713
|
+
};
|
|
1714
|
+
_options = webapi_options;
|
|
1715
|
+
}
|
|
1716
|
+
return this._searchAsync( _request, _options );
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
|
|
1720
|
+
private async _startRagIndexingAsync(request: carriers.AI_StartRagIndexingRequest, options?:base.WebApiRequestOptions) : Promise< number > {
|
|
1721
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1722
|
+
base.WebApiBase.SetPending(options);
|
|
1723
|
+
return new Promise< number >(async (resolve, reject) => {
|
|
1724
|
+
try {
|
|
1725
|
+
config.baseURL = this._options.baseUrl;
|
|
1726
|
+
const response = await this._axios.post("StartRagIndexing", request , config);
|
|
1727
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1728
|
+
const res : number = response.data as number;
|
|
1729
|
+
resolve(res);
|
|
1730
|
+
}
|
|
1731
|
+
catch( err ) {
|
|
1732
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1733
|
+
reject(err);
|
|
1734
|
+
}
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
|
|
1740
|
+
/**
|
|
1741
|
+
* Kicks off a batch task to update the RAG index
|
|
1742
|
+
* @param request - NamespaceName, SourceId
|
|
1743
|
+
* @returns The batch task id
|
|
1744
|
+
*/
|
|
1745
|
+
public async startRagIndexingAsync(request: carriers.AI_StartRagIndexingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
1746
|
+
|
|
1747
|
+
/**
|
|
1748
|
+
* Kicks off a batch task to update the RAG index
|
|
1749
|
+
* @param namespaceName - Defines the search domain. e.g. 'ServiceCopilot'.
|
|
1750
|
+
* @param sourceId - (Optional) Identifies the data source to update. Blank = all sources
|
|
1751
|
+
* @returns The batch task id
|
|
1752
|
+
*/
|
|
1753
|
+
public async startRagIndexingAsync(namespaceName: string, sourceId: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
1754
|
+
|
|
1755
|
+
public async startRagIndexingAsync(namespaceName:string|carriers.AI_StartRagIndexingRequest, sourceId?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
|
|
1756
|
+
let _request : carriers.AI_StartRagIndexingRequest = null;
|
|
1757
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1758
|
+
const first : any = namespaceName;
|
|
1759
|
+
if( typeof( first ) === "object" && first && ( typeof(first.namespaceName)!='undefined' || typeof(first.sourceId)!='undefined' ) )
|
|
1760
|
+
{
|
|
1761
|
+
_request = namespaceName as carriers.AI_StartRagIndexingRequest;
|
|
1762
|
+
_options = sourceId as base.WebApiRequestOptions;
|
|
1763
|
+
}
|
|
1764
|
+
else
|
|
1765
|
+
{
|
|
1766
|
+
_request = {
|
|
1767
|
+
namespaceName: namespaceName as string,
|
|
1768
|
+
sourceId: sourceId as string,
|
|
1769
|
+
};
|
|
1770
|
+
_options = webapi_options;
|
|
1771
|
+
}
|
|
1772
|
+
return this._startRagIndexingAsync( _request, _options );
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
|
|
1776
|
+
private async _getIndexingStatusAsync(request: carriers.AI_GetIndexingStatusRequest, options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus > {
|
|
1777
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1778
|
+
base.WebApiBase.SetPending(options);
|
|
1779
|
+
return new Promise< carriers.RagStatus >(async (resolve, reject) => {
|
|
1780
|
+
try {
|
|
1781
|
+
config.baseURL = this._options.baseUrl;
|
|
1782
|
+
const response = await this._axios.post("GetIndexingStatus", request , config);
|
|
1783
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1784
|
+
const res : carriers.RagStatus = converters.Create_RagStatus_From( response.data );
|
|
1785
|
+
resolve(res);
|
|
1786
|
+
}
|
|
1787
|
+
catch( err ) {
|
|
1788
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1789
|
+
reject(err);
|
|
1790
|
+
}
|
|
1791
|
+
});
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
|
|
1795
|
+
|
|
1796
|
+
/**
|
|
1797
|
+
* Get the current status.
|
|
1798
|
+
* @param request - NamespaceName
|
|
1799
|
+
* @returns Status of the indexing run - may be cancelled if another run is in progress.
|
|
1800
|
+
*/
|
|
1801
|
+
public async getIndexingStatusAsync(request: carriers.AI_GetIndexingStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
|
|
1802
|
+
|
|
1803
|
+
/**
|
|
1804
|
+
* Get the current status.
|
|
1805
|
+
* @param namespaceName - Identifies the namespace to store content in.
|
|
1806
|
+
* @returns Status of the indexing run - may be cancelled if another run is in progress.
|
|
1807
|
+
*/
|
|
1808
|
+
public async getIndexingStatusAsync(namespaceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
|
|
1809
|
+
|
|
1810
|
+
public async getIndexingStatusAsync(namespaceName:string|carriers.AI_GetIndexingStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus > {
|
|
1811
|
+
let _request : carriers.AI_GetIndexingStatusRequest = null;
|
|
1812
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1813
|
+
const first : any = namespaceName;
|
|
1814
|
+
if( typeof( first ) === "object" && first && ( typeof(first.namespaceName)!='undefined' ) )
|
|
1815
|
+
{
|
|
1816
|
+
_request = namespaceName as carriers.AI_GetIndexingStatusRequest;
|
|
1817
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1818
|
+
}
|
|
1819
|
+
else
|
|
1820
|
+
{
|
|
1821
|
+
_request = {
|
|
1822
|
+
namespaceName: namespaceName as string,
|
|
1823
|
+
};
|
|
1824
|
+
_options = webapi_options;
|
|
1825
|
+
}
|
|
1826
|
+
return this._getIndexingStatusAsync( _request, _options );
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
|
|
1830
|
+
private async _cancelIndexingAsync(request: carriers.AI_CancelIndexingRequest, options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus > {
|
|
1831
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1832
|
+
base.WebApiBase.SetPending(options);
|
|
1833
|
+
return new Promise< carriers.RagStatus >(async (resolve, reject) => {
|
|
1834
|
+
try {
|
|
1835
|
+
config.baseURL = this._options.baseUrl;
|
|
1836
|
+
const response = await this._axios.post("CancelIndexing", request , config);
|
|
1837
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1838
|
+
const res : carriers.RagStatus = converters.Create_RagStatus_From( response.data );
|
|
1839
|
+
resolve(res);
|
|
1840
|
+
}
|
|
1841
|
+
catch( err ) {
|
|
1842
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1843
|
+
reject(err);
|
|
1844
|
+
}
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
|
|
1849
|
+
|
|
1850
|
+
/**
|
|
1851
|
+
* Cancel the current re-indexing job on a given namespace. Leaves data in inconsistent state, because removal of old data is skipped.
|
|
1852
|
+
* @param request - NamespaceName
|
|
1853
|
+
* @returns Status of the indexing run after cancellation.
|
|
1854
|
+
*/
|
|
1855
|
+
public async cancelIndexingAsync(request: carriers.AI_CancelIndexingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* Cancel the current re-indexing job on a given namespace. Leaves data in inconsistent state, because removal of old data is skipped.
|
|
1859
|
+
* @param namespaceName - Identifies the namespace to stop indexing in.
|
|
1860
|
+
* @returns Status of the indexing run after cancellation.
|
|
1861
|
+
*/
|
|
1862
|
+
public async cancelIndexingAsync(namespaceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
|
|
1863
|
+
|
|
1864
|
+
public async cancelIndexingAsync(namespaceName:string|carriers.AI_CancelIndexingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus > {
|
|
1865
|
+
let _request : carriers.AI_CancelIndexingRequest = null;
|
|
1866
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1867
|
+
const first : any = namespaceName;
|
|
1868
|
+
if( typeof( first ) === "object" && first && ( typeof(first.namespaceName)!='undefined' ) )
|
|
1869
|
+
{
|
|
1870
|
+
_request = namespaceName as carriers.AI_CancelIndexingRequest;
|
|
1871
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1872
|
+
}
|
|
1873
|
+
else
|
|
1874
|
+
{
|
|
1875
|
+
_request = {
|
|
1876
|
+
namespaceName: namespaceName as string,
|
|
1877
|
+
};
|
|
1878
|
+
_options = webapi_options;
|
|
1879
|
+
}
|
|
1880
|
+
return this._cancelIndexingAsync( _request, _options );
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
|
|
1884
|
+
private async _summarizeTicketAsync(request: carriers.AI_SummarizeTicketRequest, options?:base.WebApiRequestOptions) : Promise< string > {
|
|
1885
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1886
|
+
base.WebApiBase.SetPending(options);
|
|
1887
|
+
return new Promise< string >(async (resolve, reject) => {
|
|
1888
|
+
try {
|
|
1889
|
+
config.baseURL = this._options.baseUrl;
|
|
1890
|
+
const response = await this._axios.post("SummarizeTicket", request , config);
|
|
1891
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1892
|
+
const res : string = response.data as string;
|
|
1893
|
+
resolve(res);
|
|
1894
|
+
}
|
|
1895
|
+
catch( err ) {
|
|
1896
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1897
|
+
reject(err);
|
|
1898
|
+
}
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
|
|
1903
|
+
|
|
1904
|
+
/**
|
|
1905
|
+
* Generate a short summary of the messages on a ticket
|
|
1906
|
+
* @param request - TicketId, NumSentences, IsoLangCode
|
|
1907
|
+
* @returns Short summary of the messages on a ticket - in HTML.
|
|
1908
|
+
*/
|
|
1909
|
+
public async summarizeTicketAsync(request: carriers.AI_SummarizeTicketRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
1910
|
+
|
|
1911
|
+
/**
|
|
1912
|
+
* Generate a short summary of the messages on a ticket
|
|
1913
|
+
* @param ticketId - Ticket id to summarize
|
|
1914
|
+
* @param numSentences - Length of summary
|
|
1915
|
+
* @param isoLangCode - Language returned text should be in
|
|
1916
|
+
* @returns Short summary of the messages on a ticket - in HTML.
|
|
1917
|
+
*/
|
|
1918
|
+
public async summarizeTicketAsync(ticketId: number, numSentences: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
1919
|
+
|
|
1920
|
+
public async summarizeTicketAsync(ticketId:number|carriers.AI_SummarizeTicketRequest, numSentences?:number|base.WebApiRequestOptions, isoLangCode?:string, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
|
|
1921
|
+
let _request : carriers.AI_SummarizeTicketRequest = null;
|
|
1922
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1923
|
+
const first : any = ticketId;
|
|
1924
|
+
if( typeof( first ) === "object" && first && ( typeof(first.ticketId)!='undefined' || typeof(first.numSentences)!='undefined' || typeof(first.isoLangCode)!='undefined' ) )
|
|
1925
|
+
{
|
|
1926
|
+
_request = ticketId as carriers.AI_SummarizeTicketRequest;
|
|
1927
|
+
_options = numSentences as base.WebApiRequestOptions;
|
|
1928
|
+
}
|
|
1929
|
+
else
|
|
1930
|
+
{
|
|
1931
|
+
_request = {
|
|
1932
|
+
ticketId: ticketId as number,
|
|
1933
|
+
numSentences: numSentences as number,
|
|
1934
|
+
isoLangCode: isoLangCode as string,
|
|
1935
|
+
};
|
|
1936
|
+
_options = webapi_options;
|
|
1937
|
+
}
|
|
1938
|
+
return this._summarizeTicketAsync( _request, _options );
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
|
|
1942
|
+
private async _getSummarizeTicketPromptAsync(request: carriers.AI_GetSummarizeTicketPromptRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn > {
|
|
1943
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1944
|
+
base.WebApiBase.SetPending(options);
|
|
1945
|
+
return new Promise< carriers.ChatbotTurn >(async (resolve, reject) => {
|
|
1946
|
+
try {
|
|
1947
|
+
config.baseURL = this._options.baseUrl;
|
|
1948
|
+
const response = await this._axios.post("GetSummarizeTicketPrompt", request , config);
|
|
1949
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1950
|
+
const res : carriers.ChatbotTurn = converters.Create_ChatbotTurn_From( response.data );
|
|
1951
|
+
resolve(res);
|
|
1952
|
+
}
|
|
1953
|
+
catch( err ) {
|
|
1954
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1955
|
+
reject(err);
|
|
1956
|
+
}
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
|
|
1961
|
+
|
|
1962
|
+
/**
|
|
1963
|
+
* Return the prompt used to get a short summary of the messages on a ticket. Does not call the chatbot for a response. Used for transfering a summary to a chat session.
|
|
1964
|
+
* @param request - TicketId, NumSentences, Summary, IsoLangCode
|
|
1965
|
+
* @returns Display text and Prompt used to generate a short summary of the messages on a ticket.
|
|
1966
|
+
*/
|
|
1967
|
+
public async getSummarizeTicketPromptAsync(request: carriers.AI_GetSummarizeTicketPromptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
1968
|
+
|
|
1969
|
+
/**
|
|
1970
|
+
* Return the prompt used to get a short summary of the messages on a ticket. Does not call the chatbot for a response. Used for transfering a summary to a chat session.
|
|
1971
|
+
* @param ticketId - Ticket id to summarize
|
|
1972
|
+
* @param numSentences - Length of summary
|
|
1973
|
+
* @param summary - Chatbot's summary of the ticket
|
|
1974
|
+
* @param isoLangCode - Language returned text should be in
|
|
1975
|
+
* @returns Display text and Prompt used to generate a short summary of the messages on a ticket.
|
|
1976
|
+
*/
|
|
1977
|
+
public async getSummarizeTicketPromptAsync(ticketId: number, numSentences: number, summary: string, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
1978
|
+
|
|
1979
|
+
public async getSummarizeTicketPromptAsync(ticketId:number|carriers.AI_GetSummarizeTicketPromptRequest, numSentences?:number|base.WebApiRequestOptions, summary?:string, isoLangCode?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn > {
|
|
1980
|
+
let _request : carriers.AI_GetSummarizeTicketPromptRequest = null;
|
|
1981
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1982
|
+
const first : any = ticketId;
|
|
1983
|
+
if( typeof( first ) === "object" && first && ( typeof(first.ticketId)!='undefined' || typeof(first.numSentences)!='undefined' || typeof(first.summary)!='undefined' || typeof(first.isoLangCode)!='undefined' ) )
|
|
1984
|
+
{
|
|
1985
|
+
_request = ticketId as carriers.AI_GetSummarizeTicketPromptRequest;
|
|
1986
|
+
_options = numSentences as base.WebApiRequestOptions;
|
|
1987
|
+
}
|
|
1988
|
+
else
|
|
1989
|
+
{
|
|
1990
|
+
_request = {
|
|
1991
|
+
ticketId: ticketId as number,
|
|
1992
|
+
numSentences: numSentences as number,
|
|
1993
|
+
summary: summary as string,
|
|
1994
|
+
isoLangCode: isoLangCode as string,
|
|
1995
|
+
};
|
|
1996
|
+
_options = webapi_options;
|
|
1997
|
+
}
|
|
1998
|
+
return this._getSummarizeTicketPromptAsync( _request, _options );
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
|
|
2002
|
+
private async _summarizeContactAsync(request: carriers.AI_SummarizeContactRequest, options?:base.WebApiRequestOptions) : Promise< string > {
|
|
2003
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
2004
|
+
base.WebApiBase.SetPending(options);
|
|
2005
|
+
return new Promise< string >(async (resolve, reject) => {
|
|
2006
|
+
try {
|
|
2007
|
+
config.baseURL = this._options.baseUrl;
|
|
2008
|
+
const response = await this._axios.post("SummarizeContact", request , config);
|
|
2009
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
2010
|
+
const res : string = response.data as string;
|
|
2011
|
+
resolve(res);
|
|
2012
|
+
}
|
|
2013
|
+
catch( err ) {
|
|
2014
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
2015
|
+
reject(err);
|
|
2016
|
+
}
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
|
|
2021
|
+
|
|
2022
|
+
/**
|
|
2023
|
+
* Generate a short summary of the activities on a contact
|
|
2024
|
+
* @param request - ContactId, NumSentences, IsoLangCode
|
|
2025
|
+
* @returns Short summary of the activities on a contact - in HTML.
|
|
2026
|
+
*/
|
|
2027
|
+
public async summarizeContactAsync(request: carriers.AI_SummarizeContactRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
2028
|
+
|
|
2029
|
+
/**
|
|
2030
|
+
* Generate a short summary of the activities on a contact
|
|
2031
|
+
* @param contactId - Contact id to summarize
|
|
2032
|
+
* @param numSentences - Length of summary
|
|
2033
|
+
* @param isoLangCode - Language returned text should be in. Blank = do not specify language.
|
|
2034
|
+
* @returns Short summary of the activities on a contact - in HTML.
|
|
2035
|
+
*/
|
|
2036
|
+
public async summarizeContactAsync(contactId: number, numSentences: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
2037
|
+
|
|
2038
|
+
public async summarizeContactAsync(contactId:number|carriers.AI_SummarizeContactRequest, numSentences?:number|base.WebApiRequestOptions, isoLangCode?:string, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
|
|
2039
|
+
let _request : carriers.AI_SummarizeContactRequest = null;
|
|
2040
|
+
let _options : base.WebApiRequestOptions = null;
|
|
2041
|
+
const first : any = contactId;
|
|
2042
|
+
if( typeof( first ) === "object" && first && ( typeof(first.contactId)!='undefined' || typeof(first.numSentences)!='undefined' || typeof(first.isoLangCode)!='undefined' ) )
|
|
2043
|
+
{
|
|
2044
|
+
_request = contactId as carriers.AI_SummarizeContactRequest;
|
|
2045
|
+
_options = numSentences as base.WebApiRequestOptions;
|
|
2046
|
+
}
|
|
2047
|
+
else
|
|
2048
|
+
{
|
|
2049
|
+
_request = {
|
|
2050
|
+
contactId: contactId as number,
|
|
2051
|
+
numSentences: numSentences as number,
|
|
2052
|
+
isoLangCode: isoLangCode as string,
|
|
2053
|
+
};
|
|
2054
|
+
_options = webapi_options;
|
|
2055
|
+
}
|
|
2056
|
+
return this._summarizeContactAsync( _request, _options );
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
|
|
2060
|
+
private async _getSummarizeContactPromptAsync(request: carriers.AI_GetSummarizeContactPromptRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn > {
|
|
2061
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
2062
|
+
base.WebApiBase.SetPending(options);
|
|
2063
|
+
return new Promise< carriers.ChatbotTurn >(async (resolve, reject) => {
|
|
2064
|
+
try {
|
|
2065
|
+
config.baseURL = this._options.baseUrl;
|
|
2066
|
+
const response = await this._axios.post("GetSummarizeContactPrompt", request , config);
|
|
2067
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
2068
|
+
const res : carriers.ChatbotTurn = converters.Create_ChatbotTurn_From( response.data );
|
|
2069
|
+
resolve(res);
|
|
2070
|
+
}
|
|
2071
|
+
catch( err ) {
|
|
2072
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
2073
|
+
reject(err);
|
|
2074
|
+
}
|
|
2075
|
+
});
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
|
|
2079
|
+
|
|
2080
|
+
/**
|
|
2081
|
+
* Return the prompt used to get a short summary of the activities on a contact. Does not call the chatbot for a response. Used for transfering a summary to a chat session.
|
|
2082
|
+
* @param request - ContactId, NumSentences, Summary, IsoLangCode
|
|
2083
|
+
* @returns Display text and Prompt used to generate a short summary of the activities on a contact.
|
|
2084
|
+
*/
|
|
2085
|
+
public async getSummarizeContactPromptAsync(request: carriers.AI_GetSummarizeContactPromptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
2086
|
+
|
|
2087
|
+
/**
|
|
2088
|
+
* Return the prompt used to get a short summary of the activities on a contact. Does not call the chatbot for a response. Used for transfering a summary to a chat session.
|
|
2089
|
+
* @param contactId - Contact id to summarize
|
|
2090
|
+
* @param numSentences - Length of summary
|
|
2091
|
+
* @param summary - Chatbot's summary of the contact activities
|
|
2092
|
+
* @param isoLangCode - Language returned text should be in. Blank = do not specify language.
|
|
2093
|
+
* @returns Display text and Prompt used to generate a short summary of the activities on a contact.
|
|
2094
|
+
*/
|
|
2095
|
+
public async getSummarizeContactPromptAsync(contactId: number, numSentences: number, summary: string, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
2096
|
+
|
|
2097
|
+
public async getSummarizeContactPromptAsync(contactId:number|carriers.AI_GetSummarizeContactPromptRequest, numSentences?:number|base.WebApiRequestOptions, summary?:string, isoLangCode?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn > {
|
|
2098
|
+
let _request : carriers.AI_GetSummarizeContactPromptRequest = null;
|
|
2099
|
+
let _options : base.WebApiRequestOptions = null;
|
|
2100
|
+
const first : any = contactId;
|
|
2101
|
+
if( typeof( first ) === "object" && first && ( typeof(first.contactId)!='undefined' || typeof(first.numSentences)!='undefined' || typeof(first.summary)!='undefined' || typeof(first.isoLangCode)!='undefined' ) )
|
|
2102
|
+
{
|
|
2103
|
+
_request = contactId as carriers.AI_GetSummarizeContactPromptRequest;
|
|
2104
|
+
_options = numSentences as base.WebApiRequestOptions;
|
|
2105
|
+
}
|
|
2106
|
+
else
|
|
2107
|
+
{
|
|
2108
|
+
_request = {
|
|
2109
|
+
contactId: contactId as number,
|
|
2110
|
+
numSentences: numSentences as number,
|
|
2111
|
+
summary: summary as string,
|
|
2112
|
+
isoLangCode: isoLangCode as string,
|
|
2113
|
+
};
|
|
2114
|
+
_options = webapi_options;
|
|
2115
|
+
}
|
|
2116
|
+
return this._getSummarizeContactPromptAsync( _request, _options );
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
|
|
2120
|
+
private async _summarizeSaleAsync(request: carriers.AI_SummarizeSaleRequest, options?:base.WebApiRequestOptions) : Promise< string > {
|
|
2121
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
2122
|
+
base.WebApiBase.SetPending(options);
|
|
2123
|
+
return new Promise< string >(async (resolve, reject) => {
|
|
2124
|
+
try {
|
|
2125
|
+
config.baseURL = this._options.baseUrl;
|
|
2126
|
+
const response = await this._axios.post("SummarizeSale", request , config);
|
|
2127
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
2128
|
+
const res : string = response.data as string;
|
|
2129
|
+
resolve(res);
|
|
2130
|
+
}
|
|
2131
|
+
catch( err ) {
|
|
2132
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
2133
|
+
reject(err);
|
|
2134
|
+
}
|
|
2135
|
+
});
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
|
|
2139
|
+
|
|
2140
|
+
/**
|
|
2141
|
+
* Generate a short summary of the activities on a sale
|
|
2142
|
+
* @param request - SaleId, NumSentences, IsoLangCode
|
|
2143
|
+
* @returns Short summary of the activities on a sale - in HTML.
|
|
2144
|
+
*/
|
|
2145
|
+
public async summarizeSaleAsync(request: carriers.AI_SummarizeSaleRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
2146
|
+
|
|
2147
|
+
/**
|
|
2148
|
+
* Generate a short summary of the activities on a sale
|
|
2149
|
+
* @param saleId - Sale id to summarize
|
|
2150
|
+
* @param numSentences - Length of summary
|
|
2151
|
+
* @param isoLangCode - Language returned text should be in. Blank = do not specify language.
|
|
2152
|
+
* @returns Short summary of the activities on a sale - in HTML.
|
|
2153
|
+
*/
|
|
2154
|
+
public async summarizeSaleAsync(saleId: number, numSentences: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
2155
|
+
|
|
2156
|
+
public async summarizeSaleAsync(saleId:number|carriers.AI_SummarizeSaleRequest, numSentences?:number|base.WebApiRequestOptions, isoLangCode?:string, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
|
|
2157
|
+
let _request : carriers.AI_SummarizeSaleRequest = null;
|
|
2158
|
+
let _options : base.WebApiRequestOptions = null;
|
|
2159
|
+
const first : any = saleId;
|
|
2160
|
+
if( typeof( first ) === "object" && first && ( typeof(first.saleId)!='undefined' || typeof(first.numSentences)!='undefined' || typeof(first.isoLangCode)!='undefined' ) )
|
|
2161
|
+
{
|
|
2162
|
+
_request = saleId as carriers.AI_SummarizeSaleRequest;
|
|
2163
|
+
_options = numSentences as base.WebApiRequestOptions;
|
|
2164
|
+
}
|
|
2165
|
+
else
|
|
2166
|
+
{
|
|
2167
|
+
_request = {
|
|
2168
|
+
saleId: saleId as number,
|
|
2169
|
+
numSentences: numSentences as number,
|
|
2170
|
+
isoLangCode: isoLangCode as string,
|
|
2171
|
+
};
|
|
2172
|
+
_options = webapi_options;
|
|
2173
|
+
}
|
|
2174
|
+
return this._summarizeSaleAsync( _request, _options );
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
|
|
2178
|
+
private async _getSummarizeSalePromptAsync(request: carriers.AI_GetSummarizeSalePromptRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn > {
|
|
2179
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
2180
|
+
base.WebApiBase.SetPending(options);
|
|
2181
|
+
return new Promise< carriers.ChatbotTurn >(async (resolve, reject) => {
|
|
2182
|
+
try {
|
|
2183
|
+
config.baseURL = this._options.baseUrl;
|
|
2184
|
+
const response = await this._axios.post("GetSummarizeSalePrompt", request , config);
|
|
2185
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
2186
|
+
const res : carriers.ChatbotTurn = converters.Create_ChatbotTurn_From( response.data );
|
|
2187
|
+
resolve(res);
|
|
2188
|
+
}
|
|
2189
|
+
catch( err ) {
|
|
2190
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
2191
|
+
reject(err);
|
|
2192
|
+
}
|
|
2193
|
+
});
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
|
|
2197
|
+
|
|
2198
|
+
/**
|
|
2199
|
+
* Return the prompt used to get a short summary of the activities on a sale. Does not call the chatbot for a response. Used for transfering a summary to a chat session.
|
|
2200
|
+
* @param request - SaleId, NumSentences, Summary, IsoLangCode
|
|
2201
|
+
* @returns Display text and Prompt used to generate a short summary of the activities on a sale.
|
|
2202
|
+
*/
|
|
2203
|
+
public async getSummarizeSalePromptAsync(request: carriers.AI_GetSummarizeSalePromptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
2204
|
+
|
|
2205
|
+
/**
|
|
2206
|
+
* Return the prompt used to get a short summary of the activities on a sale. Does not call the chatbot for a response. Used for transfering a summary to a chat session.
|
|
2207
|
+
* @param saleId - Sale id to summarize
|
|
2208
|
+
* @param numSentences - Length of summary
|
|
2209
|
+
* @param summary - Chatbot's summary of the sale activities
|
|
2210
|
+
* @param isoLangCode - Language returned text should be in
|
|
2211
|
+
* @returns Display text and Prompt used to generate a short summary of the activities on a sale.
|
|
2212
|
+
*/
|
|
2213
|
+
public async getSummarizeSalePromptAsync(saleId: number, numSentences: number, summary: string, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
|
|
2214
|
+
|
|
2215
|
+
public async getSummarizeSalePromptAsync(saleId:number|carriers.AI_GetSummarizeSalePromptRequest, numSentences?:number|base.WebApiRequestOptions, summary?:string, isoLangCode?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn > {
|
|
2216
|
+
let _request : carriers.AI_GetSummarizeSalePromptRequest = null;
|
|
2217
|
+
let _options : base.WebApiRequestOptions = null;
|
|
2218
|
+
const first : any = saleId;
|
|
2219
|
+
if( typeof( first ) === "object" && first && ( typeof(first.saleId)!='undefined' || typeof(first.numSentences)!='undefined' || typeof(first.summary)!='undefined' || typeof(first.isoLangCode)!='undefined' ) )
|
|
2220
|
+
{
|
|
2221
|
+
_request = saleId as carriers.AI_GetSummarizeSalePromptRequest;
|
|
2222
|
+
_options = numSentences as base.WebApiRequestOptions;
|
|
2223
|
+
}
|
|
2224
|
+
else
|
|
2225
|
+
{
|
|
2226
|
+
_request = {
|
|
2227
|
+
saleId: saleId as number,
|
|
2228
|
+
numSentences: numSentences as number,
|
|
2229
|
+
summary: summary as string,
|
|
2230
|
+
isoLangCode: isoLangCode as string,
|
|
2231
|
+
};
|
|
2232
|
+
_options = webapi_options;
|
|
2233
|
+
}
|
|
2234
|
+
return this._getSummarizeSalePromptAsync( _request, _options );
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
} // class v1AIAgentController
|
|
2238
|
+
|
|
2239
|
+
|