@fluid-topics/public-api 1.0.99 → 1.0.100
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/.yarnrc +1 -0
- package/dist/cjs/types/ft-common/public.js +97 -71
- package/dist/cjs/types/ft-server/public.js +111 -4
- package/dist/fluidtopics.min.js +1 -1
- package/dist/mjs/types/ft-common/public.d.ts +78 -57
- package/dist/mjs/types/ft-common/public.js +84 -61
- package/dist/mjs/types/ft-server/public.d.ts +90 -3
- package/dist/mjs/types/ft-server/public.js +94 -2
- package/package.json +1 -1
- package/dist/cjs/helpers/GenAIChunkReader.js +0 -66
- package/dist/mjs/helpers/GenAIChunkReader.d.ts +0 -19
- package/dist/mjs/helpers/GenAIChunkReader.js +0 -37
|
@@ -37,49 +37,53 @@ export var FtAnalyticsDocumentType;
|
|
|
37
37
|
FtAnalyticsDocumentType["UNSTRUCTURED_DOCUMENT"] = "UNSTRUCTURED_DOCUMENT";
|
|
38
38
|
FtAnalyticsDocumentType["SHARED_PERSONAL_BOOK"] = "SHARED_PERSONAL_BOOK";
|
|
39
39
|
FtAnalyticsDocumentType["PERSONAL_BOOK"] = "PERSONAL_BOOK";
|
|
40
|
-
FtAnalyticsDocumentType["
|
|
40
|
+
FtAnalyticsDocumentType["ATTACHMENT"] = "ATTACHMENT";
|
|
41
41
|
FtAnalyticsDocumentType["RESOURCE"] = "RESOURCE";
|
|
42
42
|
})(FtAnalyticsDocumentType || (FtAnalyticsDocumentType = {}));
|
|
43
43
|
export const isFtAnalyticsDocumentType = (o) => Object.keys(FtAnalyticsDocumentType).includes(o);
|
|
44
|
-
export const
|
|
45
|
-
return isObject(o)
|
|
46
|
-
&& (isNumber(o.width))
|
|
47
|
-
&& (isNumber(o.height));
|
|
48
|
-
};
|
|
49
|
-
export const isFtAnalyticsEventDocument = (o) => {
|
|
44
|
+
export const isFtAnalyticsEventAIProfile = (o) => {
|
|
50
45
|
return isObject(o)
|
|
51
|
-
&& (o.
|
|
52
|
-
|
|
53
|
-
&& (
|
|
54
|
-
&& (o.mimeType == null || isString(o.mimeType))
|
|
55
|
-
&& (o.title == null || isString(o.title))
|
|
56
|
-
&& (o.type == null || isFtAnalyticsDocumentType(o.type))
|
|
57
|
-
&& (o.parentId == null || isString(o.parentId));
|
|
58
|
-
};
|
|
59
|
-
export const isFtAnalyticsEventGenAIProfile = (o) => {
|
|
60
|
-
return isObject(o)
|
|
61
|
-
&& (o.chatbotDetails == null || isFtAnalyticsEventGenAIProfileChatbotDetails(o.chatbotDetails))
|
|
62
|
-
&& (o.translationDetails == null || isFtAnalyticsEventGenAIProfileTranslationDetails(o.translationDetails))
|
|
63
|
-
&& (o.completionDetails == null || isFtAnalyticsEventGenAIProfileCompletionDetails(o.completionDetails))
|
|
46
|
+
&& (o.chatbotDetails == null || isFtAnalyticsEventAIProfileChatbotDetails(o.chatbotDetails))
|
|
47
|
+
&& (o.translationDetails == null || isFtAnalyticsEventAIProfileTranslationDetails(o.translationDetails))
|
|
48
|
+
&& (o.completionDetails == null || isFtAnalyticsEventAIProfileCompletionDetails(o.completionDetails))
|
|
64
49
|
&& (isString(o.name))
|
|
65
50
|
&& (isString(o.id))
|
|
66
51
|
&& (isString(o.type));
|
|
67
52
|
};
|
|
68
|
-
export const
|
|
53
|
+
export const isFtAnalyticsEventAIProfileChatbotDetails = (o) => {
|
|
69
54
|
return isObject(o)
|
|
70
55
|
&& (isString(o.provider))
|
|
71
56
|
&& (o.model == null || isString(o.model));
|
|
72
57
|
};
|
|
73
|
-
export const
|
|
58
|
+
export const isFtAnalyticsEventAIProfileCompletionDetails = (o) => {
|
|
74
59
|
return isObject(o)
|
|
75
60
|
&& (isString(o.provider))
|
|
76
61
|
&& (o.model == null || isString(o.model));
|
|
77
62
|
};
|
|
78
|
-
export const
|
|
63
|
+
export const isFtAnalyticsEventAIProfileTranslationDetails = (o) => {
|
|
79
64
|
return isObject(o)
|
|
80
65
|
&& (isString(o.provider))
|
|
81
66
|
&& (o.engine == null || isString(o.engine));
|
|
82
67
|
};
|
|
68
|
+
export const isFtAnalyticsEventDisplay = (o) => {
|
|
69
|
+
return isObject(o)
|
|
70
|
+
&& (isNumber(o.width))
|
|
71
|
+
&& (isNumber(o.height));
|
|
72
|
+
};
|
|
73
|
+
export const isFtAnalyticsEventDocument = (o) => {
|
|
74
|
+
return isObject(o)
|
|
75
|
+
&& (o.metadata == null || (Array.isArray(o.metadata)
|
|
76
|
+
&& o.metadata.every((v) => isFtMetadata(v))))
|
|
77
|
+
&& (isString(o.id))
|
|
78
|
+
&& (o.mimeType == null || isString(o.mimeType))
|
|
79
|
+
&& (o.title == null || isString(o.title))
|
|
80
|
+
&& (o.type == null || isFtAnalyticsDocumentType(o.type))
|
|
81
|
+
&& (o.parentId == null || isString(o.parentId));
|
|
82
|
+
};
|
|
83
|
+
export const isFtAnalyticsEventDocumentSearchQuery = (o) => {
|
|
84
|
+
return isObject(o)
|
|
85
|
+
&& (isString(o.terms));
|
|
86
|
+
};
|
|
83
87
|
export const isFtAnalyticsEventLocation = (o) => {
|
|
84
88
|
return isObject(o)
|
|
85
89
|
&& (isString(o.type))
|
|
@@ -124,7 +128,7 @@ export const isFtAnalyticsEventSearchQuery = (o) => {
|
|
|
124
128
|
};
|
|
125
129
|
export const isFtAnalyticsEventSearchResponse = (o) => {
|
|
126
130
|
return isObject(o)
|
|
127
|
-
&& (
|
|
131
|
+
&& (isBoolean(o.autocorrect))
|
|
128
132
|
&& (isNumber(o.nbResults));
|
|
129
133
|
};
|
|
130
134
|
export const isFtAnalyticsEventSearchResult = (o) => {
|
|
@@ -150,7 +154,7 @@ export var FtAnalyticsPublicationType;
|
|
|
150
154
|
FtAnalyticsPublicationType["UNSTRUCTURED_DOCUMENT"] = "UNSTRUCTURED_DOCUMENT";
|
|
151
155
|
FtAnalyticsPublicationType["SHARED_PERSONAL_BOOK"] = "SHARED_PERSONAL_BOOK";
|
|
152
156
|
FtAnalyticsPublicationType["PERSONAL_BOOK"] = "PERSONAL_BOOK";
|
|
153
|
-
FtAnalyticsPublicationType["
|
|
157
|
+
FtAnalyticsPublicationType["ATTACHMENT"] = "ATTACHMENT";
|
|
154
158
|
FtAnalyticsPublicationType["RESOURCE"] = "RESOURCE";
|
|
155
159
|
})(FtAnalyticsPublicationType || (FtAnalyticsPublicationType = {}));
|
|
156
160
|
export const isFtAnalyticsPublicationType = (o) => Object.keys(FtAnalyticsPublicationType).includes(o);
|
|
@@ -181,10 +185,33 @@ export var FtAnalyticsSearchFacetType;
|
|
|
181
185
|
FtAnalyticsSearchFacetType["RANGE"] = "RANGE";
|
|
182
186
|
})(FtAnalyticsSearchFacetType || (FtAnalyticsSearchFacetType = {}));
|
|
183
187
|
export const isFtAnalyticsSearchFacetType = (o) => Object.keys(FtAnalyticsSearchFacetType).includes(o);
|
|
188
|
+
export const isFtAiCaseDeflectionEvent = (o) => {
|
|
189
|
+
return isObject(o)
|
|
190
|
+
&& (o.generationId == null || isString(o.generationId))
|
|
191
|
+
&& (o.searchQuery == null || isFtAnalyticsEventSearchQuery(o.searchQuery))
|
|
192
|
+
&& (isString(o.context));
|
|
193
|
+
};
|
|
194
|
+
export const isFtAiCompletedQueryEvent = (o) => {
|
|
195
|
+
return isObject(o)
|
|
196
|
+
&& (isString(o.result))
|
|
197
|
+
&& (isFtAnalyticsEventAIProfile(o.profile))
|
|
198
|
+
&& (isNumber(o.durationMs))
|
|
199
|
+
&& (o.parameters == null || (isObject(o.parameters)
|
|
200
|
+
&& Object.keys(o.parameters).every((k) => isString(k))
|
|
201
|
+
&& Object.values(o.parameters).every((v) => isString(v))))
|
|
202
|
+
&& (isString(o.queryId));
|
|
203
|
+
};
|
|
204
|
+
export const isFtAiRateEvent = (o) => {
|
|
205
|
+
return isObject(o)
|
|
206
|
+
&& (isFtAnalyticsEventRating(o.rating))
|
|
207
|
+
&& (isString(o.comment))
|
|
208
|
+
&& (isString(o.queryId));
|
|
209
|
+
};
|
|
184
210
|
export const isFtAnalyticsEvent = (o) => {
|
|
185
211
|
return isObject(o)
|
|
186
212
|
&& (isBoolean(o.offline))
|
|
187
213
|
&& (isString(o.appVersion))
|
|
214
|
+
&& (o.internal == null || isBoolean(o.internal))
|
|
188
215
|
&& (isString(o.appName))
|
|
189
216
|
&& (isFtAnalyticsEventName(o.name));
|
|
190
217
|
};
|
|
@@ -199,6 +226,7 @@ export var FtAnalyticsEventName;
|
|
|
199
226
|
FtAnalyticsEventName["COLLECTION__CREATE"] = "COLLECTION__CREATE";
|
|
200
227
|
FtAnalyticsEventName["COLLECTION__UPDATE"] = "COLLECTION__UPDATE";
|
|
201
228
|
FtAnalyticsEventName["COLLECTION__DELETE"] = "COLLECTION__DELETE";
|
|
229
|
+
FtAnalyticsEventName["CUSTOM_EVENT__TRIGGER"] = "CUSTOM_EVENT__TRIGGER";
|
|
202
230
|
FtAnalyticsEventName["DOCUMENT__DISPLAY"] = "DOCUMENT__DISPLAY";
|
|
203
231
|
FtAnalyticsEventName["DOCUMENT__DOWNLOAD"] = "DOCUMENT__DOWNLOAD";
|
|
204
232
|
FtAnalyticsEventName["DOCUMENT__PRINT"] = "DOCUMENT__PRINT";
|
|
@@ -208,10 +236,10 @@ export var FtAnalyticsEventName;
|
|
|
208
236
|
FtAnalyticsEventName["DOCUMENT__START_DISPLAY"] = "DOCUMENT__START_DISPLAY";
|
|
209
237
|
FtAnalyticsEventName["DOCUMENT__UNRATE"] = "DOCUMENT__UNRATE";
|
|
210
238
|
FtAnalyticsEventName["FEEDBACK__SEND"] = "FEEDBACK__SEND";
|
|
211
|
-
FtAnalyticsEventName["
|
|
212
|
-
FtAnalyticsEventName["
|
|
213
|
-
FtAnalyticsEventName["
|
|
214
|
-
FtAnalyticsEventName["
|
|
239
|
+
FtAnalyticsEventName["AI__COMPLETED_QUERY"] = "AI__COMPLETED_QUERY";
|
|
240
|
+
FtAnalyticsEventName["AI__RATE"] = "AI__RATE";
|
|
241
|
+
FtAnalyticsEventName["AI_CASE_DEFLECTION__START"] = "AI_CASE_DEFLECTION__START";
|
|
242
|
+
FtAnalyticsEventName["AI_CASE_DEFLECTION__OPEN_TICKET"] = "AI_CASE_DEFLECTION__OPEN_TICKET";
|
|
215
243
|
FtAnalyticsEventName["KHUB__PROCESS"] = "KHUB__PROCESS";
|
|
216
244
|
FtAnalyticsEventName["KHUB__SEARCH"] = "KHUB__SEARCH";
|
|
217
245
|
FtAnalyticsEventName["LABELS__DOWNLOAD"] = "LABELS__DOWNLOAD";
|
|
@@ -244,6 +272,12 @@ export const isFtCaseDeflectionEvent = (o) => {
|
|
|
244
272
|
&& (o.rating == null || isFtAnalyticsEventRating(o.rating))
|
|
245
273
|
&& (o.topic == null || isFtAnalyticsEventTopic(o.topic));
|
|
246
274
|
};
|
|
275
|
+
export const isFtCustomTriggerEvent = (o) => {
|
|
276
|
+
return isObject(o)
|
|
277
|
+
&& (o.componentId == null || isString(o.componentId))
|
|
278
|
+
&& (isString(o.eventName))
|
|
279
|
+
&& (isFtAnalyticsEventPage(o.page));
|
|
280
|
+
};
|
|
247
281
|
export const isFtDocumentDisplayEvent = (o) => {
|
|
248
282
|
return isObject(o)
|
|
249
283
|
&& (o.publication == null || isFtAnalyticsEventPublication(o.publication))
|
|
@@ -266,7 +300,7 @@ export const isFtDocumentSearchEvent = (o) => {
|
|
|
266
300
|
&& (isFtAnalyticsEventSearchResponse(o.searchResponse))
|
|
267
301
|
&& (o.publication == null || isFtAnalyticsEventPublication(o.publication))
|
|
268
302
|
&& (o.document == null || isFtAnalyticsEventDocument(o.document))
|
|
269
|
-
&& (
|
|
303
|
+
&& (isFtAnalyticsEventDocumentSearchQuery(o.searchQuery));
|
|
270
304
|
};
|
|
271
305
|
export const isFtDocumentStartDisplayEvent = (o) => {
|
|
272
306
|
return isObject(o)
|
|
@@ -282,18 +316,6 @@ export const isFtFeedbackSendEvent = (o) => {
|
|
|
282
316
|
&& (o.document == null || isFtAnalyticsEventDocument(o.document))
|
|
283
317
|
&& (isBoolean(o.loggedIn));
|
|
284
318
|
};
|
|
285
|
-
export const isFtGenAiCaseDeflectionEvent = (o) => {
|
|
286
|
-
return isObject(o)
|
|
287
|
-
&& (o.generationId == null || isString(o.generationId))
|
|
288
|
-
&& (o.searchQuery == null || isFtAnalyticsEventSearchQuery(o.searchQuery))
|
|
289
|
-
&& (isString(o.context));
|
|
290
|
-
};
|
|
291
|
-
export const isFtGenAiRateEvent = (o) => {
|
|
292
|
-
return isObject(o)
|
|
293
|
-
&& (isFtAnalyticsEventRating(o.rating))
|
|
294
|
-
&& (isString(o.comment))
|
|
295
|
-
&& (isString(o.queryId));
|
|
296
|
-
};
|
|
297
319
|
export const isFtKhubSearchEvent = (o) => {
|
|
298
320
|
return isObject(o)
|
|
299
321
|
&& (isFtAnalyticsEventSearchResponse(o.searchResponse))
|
|
@@ -411,28 +433,29 @@ export const isFtMap = (o) => {
|
|
|
411
433
|
&& (o.prettyUrl == null || isString(o.prettyUrl))
|
|
412
434
|
&& ((Array.isArray(o.metadata)
|
|
413
435
|
&& o.metadata.every((v) => isFtMetadata(v))))
|
|
414
|
-
&& (o.watermark == null || isFtWatermark(o.watermark))
|
|
415
|
-
&& (isFtOpenMode(o.openMode))
|
|
416
436
|
&& (o.topicsApiEndpoint == null || isString(o.topicsApiEndpoint))
|
|
417
437
|
&& (o.description == null || isString(o.description))
|
|
418
|
-
&& (o.attachmentsApiEndpoint == null || isString(o.attachmentsApiEndpoint))
|
|
419
438
|
&& (isFtEditorialType(o.editorialType))
|
|
420
439
|
&& (isString(o.baseId))
|
|
421
440
|
&& (isString(o.clusterId))
|
|
422
441
|
&& (isString(o.title))
|
|
423
|
-
&& (isString(o.lastPublication))
|
|
424
|
-
&& (isBoolean(o.pbkConfidential))
|
|
425
442
|
&& (isString(o.lastEdition))
|
|
426
443
|
&& (isString(o.originId))
|
|
427
444
|
&& (o.rightsApiEndpoint == null || isString(o.rightsApiEndpoint))
|
|
428
|
-
&& (isFtMapStyles(o.contentStyles))
|
|
429
|
-
&& (o.originUrl == null || isString(o.originUrl))
|
|
430
445
|
&& (isString(o.fingerprint))
|
|
431
446
|
&& (isString(o.readerUrl))
|
|
432
|
-
&& (o.untranslatedTitle == null ||
|
|
447
|
+
&& (o.untranslatedTitle == null || isString(o.untranslatedTitle))
|
|
433
448
|
&& (o.khubVersion == null || isString(o.khubVersion))
|
|
434
449
|
&& (isString(o.id))
|
|
435
|
-
&& (o.lang == null || isString(o.lang))
|
|
450
|
+
&& (o.lang == null || isString(o.lang))
|
|
451
|
+
&& (o.watermark == null || isFtWatermark(o.watermark))
|
|
452
|
+
&& (isFtOpenMode(o.openMode))
|
|
453
|
+
&& (o.attachmentsApiEndpoint == null || isString(o.attachmentsApiEndpoint))
|
|
454
|
+
&& (isString(o.lastPublication))
|
|
455
|
+
&& (isBoolean(o.pbkConfidential))
|
|
456
|
+
&& (isFtMapStyles(o.contentStyles))
|
|
457
|
+
&& (o.originUrl == null || isString(o.originUrl))
|
|
458
|
+
&& (isBoolean(o.translationError));
|
|
436
459
|
};
|
|
437
460
|
export const isFtMapStyles = (o) => {
|
|
438
461
|
return isObject(o)
|
|
@@ -450,7 +473,7 @@ export const isFtTocNode = (o) => {
|
|
|
450
473
|
&& o.children.every((v) => isFtTocNode(v))))
|
|
451
474
|
&& (o.origin == null || isFtTopicOrigin(o.origin))
|
|
452
475
|
&& (isString(o.contentId))
|
|
453
|
-
&& (o.untranslatedTitle == null ||
|
|
476
|
+
&& (o.untranslatedTitle == null || isString(o.untranslatedTitle))
|
|
454
477
|
&& (isString(o.title));
|
|
455
478
|
};
|
|
456
479
|
export const isFtTopic = (o) => {
|
|
@@ -479,18 +502,18 @@ export const isFtUnstructuredDocument = (o) => {
|
|
|
479
502
|
&& (isString(o.openMode))
|
|
480
503
|
&& (o.description == null || isString(o.description))
|
|
481
504
|
&& (isString(o.mimeType))
|
|
482
|
-
&& (
|
|
505
|
+
&& (isString(o.baseId))
|
|
483
506
|
&& (o.clusterId == null || isString(o.clusterId))
|
|
484
507
|
&& (isString(o.contentApiEndpoint))
|
|
485
508
|
&& (isString(o.title))
|
|
486
|
-
&& (
|
|
509
|
+
&& (isString(o.lastPublication))
|
|
487
510
|
&& (isString(o.viewerUrl))
|
|
488
511
|
&& (isString(o.lastEdition))
|
|
489
512
|
&& (isString(o.filename))
|
|
490
513
|
&& (o.originId == null || isString(o.originId))
|
|
491
514
|
&& (isString(o.rightsApiEndpoint))
|
|
492
515
|
&& (o.originUrl == null || isString(o.originUrl))
|
|
493
|
-
&& (
|
|
516
|
+
&& (isString(o.khubVersion))
|
|
494
517
|
&& (isString(o.id))
|
|
495
518
|
&& (o.lang == null || isString(o.lang));
|
|
496
519
|
};
|
|
@@ -638,7 +661,7 @@ export const isFtMySearchCreation = (o) => {
|
|
|
638
661
|
};
|
|
639
662
|
export const isFtMySearchRequest = (o) => {
|
|
640
663
|
return isObject(o)
|
|
641
|
-
&& (o.periodFilter == null ||
|
|
664
|
+
&& (o.periodFilter == null || isFtPeriodFilter(o.periodFilter))
|
|
642
665
|
&& (isString(o.query))
|
|
643
666
|
&& (o.scope == null || isFtSearchScope(o.scope))
|
|
644
667
|
&& (o.filters == null || (Array.isArray(o.filters)
|
|
@@ -884,7 +907,7 @@ export const isFtSearchPrior = (o) => {
|
|
|
884
907
|
};
|
|
885
908
|
export const isFtSearchRequest = (o) => {
|
|
886
909
|
return isObject(o)
|
|
887
|
-
&& (o.periodFilter == null ||
|
|
910
|
+
&& (o.periodFilter == null || isFtPeriodFilter(o.periodFilter))
|
|
888
911
|
&& (isString(o.query))
|
|
889
912
|
&& (isFtPageRequest(o.paging))
|
|
890
913
|
&& (o.filters == null || (Array.isArray(o.filters)
|
|
@@ -923,11 +946,11 @@ export const isFtSearchResultUnstructuredDocument = (o) => {
|
|
|
923
946
|
return isObject(o)
|
|
924
947
|
&& ((Array.isArray(o.metadata)
|
|
925
948
|
&& o.metadata.every((v) => isFtMetadata(v))))
|
|
926
|
-
&& (isFtOpenMode(o.openMode))
|
|
949
|
+
&& (o.openMode == null || isFtOpenMode(o.openMode))
|
|
927
950
|
&& (isString(o.documentUrl))
|
|
928
951
|
&& (isString(o.mimeType))
|
|
929
952
|
&& (isString(o.title))
|
|
930
|
-
&& (
|
|
953
|
+
&& (isString(o.lastPublicationDate))
|
|
931
954
|
&& (isString(o.viewerUrl))
|
|
932
955
|
&& (isString(o.contentUrl))
|
|
933
956
|
&& (isString(o.filename))
|
|
@@ -944,7 +967,7 @@ export const isFtSearchResultMap = (o) => {
|
|
|
944
967
|
&& (o.openMode == null || isFtOpenMode(o.openMode))
|
|
945
968
|
&& (isFtEditorialType(o.editorialType))
|
|
946
969
|
&& (isString(o.title))
|
|
947
|
-
&& (
|
|
970
|
+
&& (isString(o.lastPublicationDate))
|
|
948
971
|
&& (isString(o.htmlTitle))
|
|
949
972
|
&& (o.originUrl == null || isString(o.originUrl))
|
|
950
973
|
&& (isString(o.mapUrl))
|
|
@@ -957,7 +980,7 @@ export const isFtSearchResultTopic = (o) => {
|
|
|
957
980
|
return isObject(o)
|
|
958
981
|
&& ((Array.isArray(o.metadata)
|
|
959
982
|
&& o.metadata.every((v) => isFtMetadata(v))))
|
|
960
|
-
&& (isFtOpenMode(o.openMode))
|
|
983
|
+
&& (o.openMode == null || isFtOpenMode(o.openMode))
|
|
961
984
|
&& (isString(o.contentId))
|
|
962
985
|
&& ((Array.isArray(o.resources)
|
|
963
986
|
&& o.resources.every((v) => isFtTopicResource(v))))
|
|
@@ -51,6 +51,78 @@ export interface FtRagInput {
|
|
|
51
51
|
filters?: Array<FtSemanticSearchFilter>;
|
|
52
52
|
}
|
|
53
53
|
export declare const isFtRagInput: (o: any) => o is FtRagInput;
|
|
54
|
+
export interface FtGenAIGenerationFetchTracesRequest {
|
|
55
|
+
endDate?: string;
|
|
56
|
+
nbResults?: number;
|
|
57
|
+
userId?: string;
|
|
58
|
+
startDate?: string;
|
|
59
|
+
}
|
|
60
|
+
export declare const isFtGenAIGenerationFetchTracesRequest: (o: any) => o is FtGenAIGenerationFetchTracesRequest;
|
|
61
|
+
export interface FtGenAIFetchGenerationTracesResult {
|
|
62
|
+
endDate?: string;
|
|
63
|
+
nbResults: number;
|
|
64
|
+
results: Array<FtGenAIGenerationTrace>;
|
|
65
|
+
startDate?: string;
|
|
66
|
+
}
|
|
67
|
+
export declare const isFtGenAIFetchGenerationTracesResult: (o: any) => o is FtGenAIFetchGenerationTracesResult;
|
|
68
|
+
export interface FtGenAIGenerationTrace {
|
|
69
|
+
output: FtGenAIGenerationTraceOutput;
|
|
70
|
+
input: FtGenAIGenerationTraceInput;
|
|
71
|
+
profileId?: string;
|
|
72
|
+
id: string;
|
|
73
|
+
sessionId?: string;
|
|
74
|
+
userId?: string;
|
|
75
|
+
timestamp: string;
|
|
76
|
+
}
|
|
77
|
+
export declare const isFtGenAIGenerationTrace: (o: any) => o is FtGenAIGenerationTrace;
|
|
78
|
+
export interface FtGenAIGenerationTraceInput {
|
|
79
|
+
query: string;
|
|
80
|
+
}
|
|
81
|
+
export declare const isFtGenAIGenerationTraceInput: (o: any) => o is FtGenAIGenerationTraceInput;
|
|
82
|
+
export interface FtGenAIGenerationTraceOutput {
|
|
83
|
+
response: string;
|
|
84
|
+
}
|
|
85
|
+
export declare const isFtGenAIGenerationTraceOutput: (o: any) => o is FtGenAIGenerationTraceOutput;
|
|
86
|
+
export interface FtGenAIRagFetchTracesRequest {
|
|
87
|
+
endDate?: string;
|
|
88
|
+
nbResults?: number;
|
|
89
|
+
userId?: string;
|
|
90
|
+
startDate?: string;
|
|
91
|
+
}
|
|
92
|
+
export declare const isFtGenAIRagFetchTracesRequest: (o: any) => o is FtGenAIRagFetchTracesRequest;
|
|
93
|
+
export interface FtGenAIFetchRagTracesResult {
|
|
94
|
+
endDate?: string;
|
|
95
|
+
nbResults: number;
|
|
96
|
+
results: Array<FtGenAIRagTrace>;
|
|
97
|
+
startDate?: string;
|
|
98
|
+
}
|
|
99
|
+
export declare const isFtGenAIFetchRagTracesResult: (o: any) => o is FtGenAIFetchRagTracesResult;
|
|
100
|
+
export interface FtGenAIRagTrace {
|
|
101
|
+
output: FtGenAIRagTraceOutput;
|
|
102
|
+
input: FtGenAIRagTraceInput;
|
|
103
|
+
conversationId?: string;
|
|
104
|
+
profileId?: string;
|
|
105
|
+
id: string;
|
|
106
|
+
sessionId?: string;
|
|
107
|
+
userId?: string;
|
|
108
|
+
timestamp: string;
|
|
109
|
+
}
|
|
110
|
+
export declare const isFtGenAIRagTrace: (o: any) => o is FtGenAIRagTrace;
|
|
111
|
+
export interface FtGenAIRagTraceHistoryItem {
|
|
112
|
+
role: string;
|
|
113
|
+
content: string;
|
|
114
|
+
}
|
|
115
|
+
export declare const isFtGenAIRagTraceHistoryItem: (o: any) => o is FtGenAIRagTraceHistoryItem;
|
|
116
|
+
export interface FtGenAIRagTraceInput {
|
|
117
|
+
userInstructions: string;
|
|
118
|
+
query: string;
|
|
119
|
+
history: Array<FtGenAIRagTraceHistoryItem>;
|
|
120
|
+
}
|
|
121
|
+
export declare const isFtGenAIRagTraceInput: (o: any) => o is FtGenAIRagTraceInput;
|
|
122
|
+
export interface FtGenAIRagTraceOutput {
|
|
123
|
+
response: string;
|
|
124
|
+
}
|
|
125
|
+
export declare const isFtGenAIRagTraceOutput: (o: any) => o is FtGenAIRagTraceOutput;
|
|
54
126
|
export declare enum TranslationFormat {
|
|
55
127
|
TEXT = "TEXT",
|
|
56
128
|
HTML = "HTML"
|
|
@@ -133,12 +205,27 @@ export interface FtSemanticSearchResponseItem {
|
|
|
133
205
|
relevance: number;
|
|
134
206
|
}
|
|
135
207
|
export declare const isFtSemanticSearchResponseItem: (o: any) => o is FtSemanticSearchResponseItem;
|
|
208
|
+
export interface FtSemanticSearchAndFilter extends FtSemanticSearchFilter {
|
|
209
|
+
and: Array<FtSemanticSearchFilter>;
|
|
210
|
+
}
|
|
211
|
+
export declare const isFtSemanticSearchAndFilter: (o: any) => o is FtSemanticSearchAndFilter;
|
|
136
212
|
export interface FtSemanticSearchFilter {
|
|
137
|
-
values?: Array<string>;
|
|
138
|
-
hierarchicalValues?: Array<Array<string>>;
|
|
139
|
-
key: string;
|
|
140
213
|
}
|
|
141
214
|
export declare const isFtSemanticSearchFilter: (o: any) => o is FtSemanticSearchFilter;
|
|
215
|
+
export interface FtSemanticSearchKeyValueFilter extends FtSemanticSearchFilter {
|
|
216
|
+
values: Array<string>;
|
|
217
|
+
hierarchicalValues: Array<Array<string>>;
|
|
218
|
+
key: string;
|
|
219
|
+
}
|
|
220
|
+
export declare const isFtSemanticSearchKeyValueFilter: (o: any) => o is FtSemanticSearchKeyValueFilter;
|
|
221
|
+
export interface FtSemanticSearchNotFilter extends FtSemanticSearchFilter {
|
|
222
|
+
not: FtSemanticSearchFilter;
|
|
223
|
+
}
|
|
224
|
+
export declare const isFtSemanticSearchNotFilter: (o: any) => o is FtSemanticSearchNotFilter;
|
|
225
|
+
export interface FtSemanticSearchOrFilter extends FtSemanticSearchFilter {
|
|
226
|
+
or: Array<FtSemanticSearchFilter>;
|
|
227
|
+
}
|
|
228
|
+
export declare const isFtSemanticSearchOrFilter: (o: any) => o is FtSemanticSearchOrFilter;
|
|
142
229
|
export interface FtSemanticSearchRequest {
|
|
143
230
|
query: string;
|
|
144
231
|
filters?: Array<FtSemanticSearchFilter>;
|
|
@@ -64,6 +64,81 @@ export const isFtRagInput = (o) => {
|
|
|
64
64
|
&& (o.filters == null || (Array.isArray(o.filters)
|
|
65
65
|
&& o.filters.every((v) => isFtSemanticSearchFilter(v))));
|
|
66
66
|
};
|
|
67
|
+
export const isFtGenAIGenerationFetchTracesRequest = (o) => {
|
|
68
|
+
return isObject(o)
|
|
69
|
+
&& (o.endDate == null || isString(o.endDate))
|
|
70
|
+
&& (o.nbResults == null || isNumber(o.nbResults))
|
|
71
|
+
&& (o.userId == null || isString(o.userId))
|
|
72
|
+
&& (o.startDate == null || isString(o.startDate));
|
|
73
|
+
};
|
|
74
|
+
export const isFtGenAIFetchGenerationTracesResult = (o) => {
|
|
75
|
+
return isObject(o)
|
|
76
|
+
&& (o.endDate == null || isString(o.endDate))
|
|
77
|
+
&& (isNumber(o.nbResults))
|
|
78
|
+
&& ((Array.isArray(o.results)
|
|
79
|
+
&& o.results.every((v) => isFtGenAIGenerationTrace(v))))
|
|
80
|
+
&& (o.startDate == null || isString(o.startDate));
|
|
81
|
+
};
|
|
82
|
+
export const isFtGenAIGenerationTrace = (o) => {
|
|
83
|
+
return isObject(o)
|
|
84
|
+
&& (isFtGenAIGenerationTraceOutput(o.output))
|
|
85
|
+
&& (isFtGenAIGenerationTraceInput(o.input))
|
|
86
|
+
&& (o.profileId == null || isString(o.profileId))
|
|
87
|
+
&& (isString(o.id))
|
|
88
|
+
&& (o.sessionId == null || isString(o.sessionId))
|
|
89
|
+
&& (o.userId == null || isString(o.userId))
|
|
90
|
+
&& (isString(o.timestamp));
|
|
91
|
+
};
|
|
92
|
+
export const isFtGenAIGenerationTraceInput = (o) => {
|
|
93
|
+
return isObject(o)
|
|
94
|
+
&& (isString(o.query));
|
|
95
|
+
};
|
|
96
|
+
export const isFtGenAIGenerationTraceOutput = (o) => {
|
|
97
|
+
return isObject(o)
|
|
98
|
+
&& (isString(o.response));
|
|
99
|
+
};
|
|
100
|
+
export const isFtGenAIRagFetchTracesRequest = (o) => {
|
|
101
|
+
return isObject(o)
|
|
102
|
+
&& (o.endDate == null || isString(o.endDate))
|
|
103
|
+
&& (o.nbResults == null || isNumber(o.nbResults))
|
|
104
|
+
&& (o.userId == null || isString(o.userId))
|
|
105
|
+
&& (o.startDate == null || isString(o.startDate));
|
|
106
|
+
};
|
|
107
|
+
export const isFtGenAIFetchRagTracesResult = (o) => {
|
|
108
|
+
return isObject(o)
|
|
109
|
+
&& (o.endDate == null || isString(o.endDate))
|
|
110
|
+
&& (isNumber(o.nbResults))
|
|
111
|
+
&& ((Array.isArray(o.results)
|
|
112
|
+
&& o.results.every((v) => isFtGenAIRagTrace(v))))
|
|
113
|
+
&& (o.startDate == null || isString(o.startDate));
|
|
114
|
+
};
|
|
115
|
+
export const isFtGenAIRagTrace = (o) => {
|
|
116
|
+
return isObject(o)
|
|
117
|
+
&& (isFtGenAIRagTraceOutput(o.output))
|
|
118
|
+
&& (isFtGenAIRagTraceInput(o.input))
|
|
119
|
+
&& (o.conversationId == null || isString(o.conversationId))
|
|
120
|
+
&& (o.profileId == null || isString(o.profileId))
|
|
121
|
+
&& (isString(o.id))
|
|
122
|
+
&& (o.sessionId == null || isString(o.sessionId))
|
|
123
|
+
&& (o.userId == null || isString(o.userId))
|
|
124
|
+
&& (isString(o.timestamp));
|
|
125
|
+
};
|
|
126
|
+
export const isFtGenAIRagTraceHistoryItem = (o) => {
|
|
127
|
+
return isObject(o)
|
|
128
|
+
&& (isString(o.role))
|
|
129
|
+
&& (isString(o.content));
|
|
130
|
+
};
|
|
131
|
+
export const isFtGenAIRagTraceInput = (o) => {
|
|
132
|
+
return isObject(o)
|
|
133
|
+
&& (isString(o.userInstructions))
|
|
134
|
+
&& (isString(o.query))
|
|
135
|
+
&& ((Array.isArray(o.history)
|
|
136
|
+
&& o.history.every((v) => isFtGenAIRagTraceHistoryItem(v))));
|
|
137
|
+
};
|
|
138
|
+
export const isFtGenAIRagTraceOutput = (o) => {
|
|
139
|
+
return isObject(o)
|
|
140
|
+
&& (isString(o.response));
|
|
141
|
+
};
|
|
67
142
|
export var TranslationFormat;
|
|
68
143
|
(function (TranslationFormat) {
|
|
69
144
|
TranslationFormat["TEXT"] = "TEXT";
|
|
@@ -155,15 +230,32 @@ export const isFtSemanticSearchResponseItem = (o) => {
|
|
|
155
230
|
&& (isString(o.excerpt))
|
|
156
231
|
&& (isNumber(o.relevance));
|
|
157
232
|
};
|
|
233
|
+
export const isFtSemanticSearchAndFilter = (o) => {
|
|
234
|
+
return isObject(o)
|
|
235
|
+
&& ((Array.isArray(o.and)
|
|
236
|
+
&& o.and.every((v) => isFtSemanticSearchFilter(v))));
|
|
237
|
+
};
|
|
158
238
|
export const isFtSemanticSearchFilter = (o) => {
|
|
239
|
+
return isObject(o);
|
|
240
|
+
};
|
|
241
|
+
export const isFtSemanticSearchKeyValueFilter = (o) => {
|
|
159
242
|
return isObject(o)
|
|
160
|
-
&& (
|
|
243
|
+
&& ((Array.isArray(o.values)
|
|
161
244
|
&& o.values.every((v) => isString(v))))
|
|
162
|
-
&& (
|
|
245
|
+
&& ((Array.isArray(o.hierarchicalValues)
|
|
163
246
|
&& o.hierarchicalValues.every((v) => (Array.isArray(v)
|
|
164
247
|
&& v.every((v) => isString(v))))))
|
|
165
248
|
&& (isString(o.key));
|
|
166
249
|
};
|
|
250
|
+
export const isFtSemanticSearchNotFilter = (o) => {
|
|
251
|
+
return isObject(o)
|
|
252
|
+
&& (isFtSemanticSearchFilter(o.not));
|
|
253
|
+
};
|
|
254
|
+
export const isFtSemanticSearchOrFilter = (o) => {
|
|
255
|
+
return isObject(o)
|
|
256
|
+
&& ((Array.isArray(o.or)
|
|
257
|
+
&& o.or.every((v) => isFtSemanticSearchFilter(v))));
|
|
258
|
+
};
|
|
167
259
|
export const isFtSemanticSearchRequest = (o) => {
|
|
168
260
|
return isObject(o)
|
|
169
261
|
&& (isString(o.query))
|
package/package.json
CHANGED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
3
|
-
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
4
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
5
|
-
var m = o[Symbol.asyncIterator], i;
|
|
6
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
7
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
8
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
9
|
-
};
|
|
10
|
-
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
|
11
|
-
var i, p;
|
|
12
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
13
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
14
|
-
};
|
|
15
|
-
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
16
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
17
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
18
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
19
|
-
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
20
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
21
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
22
|
-
function fulfill(value) { resume("next", value); }
|
|
23
|
-
function reject(value) { resume("throw", value); }
|
|
24
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.GenAIChunkReader = void 0;
|
|
28
|
-
class GenAIChunkReader {
|
|
29
|
-
constructor(reader) {
|
|
30
|
-
this.reader = reader;
|
|
31
|
-
this.decoder = new TextDecoder();
|
|
32
|
-
this.partialChunk = "";
|
|
33
|
-
}
|
|
34
|
-
read() {
|
|
35
|
-
return __asyncGenerator(this, arguments, function* read_1() {
|
|
36
|
-
while (true) {
|
|
37
|
-
const { done, value } = yield __await(this.reader.read());
|
|
38
|
-
if (done) {
|
|
39
|
-
yield __await(yield* __asyncDelegator(__asyncValues(this.readRemainingChunks())));
|
|
40
|
-
return yield __await(void 0);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
yield __await(yield* __asyncDelegator(__asyncValues(this.readChunksFromValue(value))));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
*readRemainingChunks() {
|
|
49
|
-
yield* this.parseLine(this.partialChunk);
|
|
50
|
-
}
|
|
51
|
-
*readChunksFromValue(value) {
|
|
52
|
-
const text = this.partialChunk + this.decoder.decode(value);
|
|
53
|
-
const lines = text.split("\n");
|
|
54
|
-
this.partialChunk = lines.pop();
|
|
55
|
-
for (let line of lines) {
|
|
56
|
-
yield* this.parseLine(line);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
*parseLine(line) {
|
|
60
|
-
const [type, content] = line.split(/:(.*)/);
|
|
61
|
-
if (type == "data" && content.length > 0) {
|
|
62
|
-
yield JSON.parse(content);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.GenAIChunkReader = GenAIChunkReader;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface GenAIChunk {
|
|
2
|
-
id?: string;
|
|
3
|
-
message?: string;
|
|
4
|
-
error?: {
|
|
5
|
-
code: number;
|
|
6
|
-
name: string;
|
|
7
|
-
message: string;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare class GenAIChunkReader {
|
|
11
|
-
private readonly reader;
|
|
12
|
-
private decoder;
|
|
13
|
-
private partialChunk;
|
|
14
|
-
constructor(reader: ReadableStreamDefaultReader<Uint8Array>);
|
|
15
|
-
read(): AsyncGenerator<GenAIChunk>;
|
|
16
|
-
private readRemainingChunks;
|
|
17
|
-
private readChunksFromValue;
|
|
18
|
-
private parseLine;
|
|
19
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export class GenAIChunkReader {
|
|
2
|
-
reader;
|
|
3
|
-
decoder = new TextDecoder();
|
|
4
|
-
partialChunk = "";
|
|
5
|
-
constructor(reader) {
|
|
6
|
-
this.reader = reader;
|
|
7
|
-
}
|
|
8
|
-
async *read() {
|
|
9
|
-
while (true) {
|
|
10
|
-
const { done, value } = await this.reader.read();
|
|
11
|
-
if (done) {
|
|
12
|
-
yield* this.readRemainingChunks();
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
yield* this.readChunksFromValue(value);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
*readRemainingChunks() {
|
|
21
|
-
yield* this.parseLine(this.partialChunk);
|
|
22
|
-
}
|
|
23
|
-
*readChunksFromValue(value) {
|
|
24
|
-
const text = this.partialChunk + this.decoder.decode(value);
|
|
25
|
-
const lines = text.split("\n");
|
|
26
|
-
this.partialChunk = lines.pop();
|
|
27
|
-
for (let line of lines) {
|
|
28
|
-
yield* this.parseLine(line);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
*parseLine(line) {
|
|
32
|
-
const [type, content] = line.split(/:(.*)/);
|
|
33
|
-
if (type == "data" && content.length > 0) {
|
|
34
|
-
yield JSON.parse(content);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|