@or-sdk/lookup 1.9.2 → 1.10.0-beta.2478.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -4
- package/dist/cjs/types.js +7 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/types.js +6 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/types/types.d.ts +17 -6
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +2 -3
- package/src/types.ts +47 -17
package/README.md
CHANGED
|
@@ -189,6 +189,7 @@ Creates a new collection with optional properties. A collection is a group of re
|
|
|
189
189
|
- `presencePenalty`: `number` (optional) - Value to penalize new tokens based on their presence in existing text. If present, it must be a number between -2 and 2.
|
|
190
190
|
- `maxDistance`: `number` (optional) - Value to filter out passages that are further than this value from the question or context. If present, it must be a number between 0 and 1.
|
|
191
191
|
- `modelName`: `string` (optional) - Name of the large language model to be used. It can't be more than 64 characters long.
|
|
192
|
+
- `type`: `CollectionType` (optional) - it allow for post process passages content(QnA), or create specific properties(IDW skills).
|
|
192
193
|
|
|
193
194
|
#### Example
|
|
194
195
|
Creating a collection with a name, description, and additional instructions
|
|
@@ -210,7 +211,8 @@ const collection = await lookup.createCollection({
|
|
|
210
211
|
frequencyPenalty: 0.8,
|
|
211
212
|
presencePenalty: 1,
|
|
212
213
|
maxDistance: 0.5,
|
|
213
|
-
modelName: 'text-davinci-002'
|
|
214
|
+
modelName: 'text-davinci-002',
|
|
215
|
+
type: 'DEFAULT'
|
|
214
216
|
});
|
|
215
217
|
|
|
216
218
|
console.log(collection);
|
|
@@ -374,7 +376,8 @@ const searchResults = await lookup.search(collectionId, {
|
|
|
374
376
|
document: {
|
|
375
377
|
id: 'i9j0k1l2-uuid',
|
|
376
378
|
name: 'Document Name'
|
|
377
|
-
}
|
|
379
|
+
},
|
|
380
|
+
select: ['author', 'publishDate']
|
|
378
381
|
}
|
|
379
382
|
]
|
|
380
383
|
```
|
|
@@ -457,6 +460,7 @@ const askResults = await lookup.ask(collectionId, {
|
|
|
457
460
|
// Example response
|
|
458
461
|
{
|
|
459
462
|
result: { role: 'assistant', content: 'The meaning of life is 42.' },
|
|
463
|
+
select: ['title', 'author', 'publishDate'],
|
|
460
464
|
searchResult: [
|
|
461
465
|
{
|
|
462
466
|
id: 'e5f6g7h8-uuid',
|
|
@@ -468,6 +472,7 @@ const askResults = await lookup.ask(collectionId, {
|
|
|
468
472
|
id: 'i9j0k1l2-uuid',
|
|
469
473
|
name: 'On the Meaning of Life',
|
|
470
474
|
},
|
|
475
|
+
select: ['title', 'author', 'publishDate']
|
|
471
476
|
title: 'On the Meaning of Life',
|
|
472
477
|
author: 'John Doe',
|
|
473
478
|
publishDate: '2020-12-31',
|
|
@@ -743,7 +748,9 @@ Create a passage and add it to a specific document within a collection. A passag
|
|
|
743
748
|
#### Params
|
|
744
749
|
- collectionId: `string` - The ID of the collection the document belongs to
|
|
745
750
|
- params: `CreatePassage` - An object containing parameters required to create a passage
|
|
746
|
-
- `content` (
|
|
751
|
+
- `content` (optional): The content of the passage for DEFAULT collection type
|
|
752
|
+
- `question` (optional): The question of the passage for QNA_V1 collection type
|
|
753
|
+
- `answer` (optional): The answer of the passage for QNA_V1 collection type
|
|
747
754
|
- `documentId` (string): The ID of the document the passage will be associated with
|
|
748
755
|
- `property: value` (optional): Custom properties of the passage. Note that these properties should be listed in the collection properties
|
|
749
756
|
|
|
@@ -774,7 +781,9 @@ Create a batch of passages and add it to a specific document within a collection
|
|
|
774
781
|
#### Params
|
|
775
782
|
- collectionId: `string` - The ID of the collection the document belongs to
|
|
776
783
|
- passages: `CreatePassage[]` - An array of objects containing parameters required to create each passage
|
|
777
|
-
- `content` (
|
|
784
|
+
- `content` (optional): The content of the passage for DEFAULT collection type
|
|
785
|
+
- `question` (optional): The question of the passage for QNA_V1 collection type
|
|
786
|
+
- `answer` (optional): The answer of the passage for QNA_V1 collection type
|
|
778
787
|
- `documentId` (string): The ID of the document the passage will be associated with
|
|
779
788
|
- `property: value` (optional): Custom properties of the passage. Note that these properties should be listed in the collection properties
|
|
780
789
|
|
package/dist/cjs/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BackupStatus = exports.DocumentStatus = void 0;
|
|
3
|
+
exports.CollectionType = exports.BackupStatus = exports.DocumentStatus = void 0;
|
|
4
4
|
var DocumentStatus;
|
|
5
5
|
(function (DocumentStatus) {
|
|
6
6
|
DocumentStatus["NEW"] = "NEW";
|
|
@@ -14,4 +14,10 @@ var BackupStatus;
|
|
|
14
14
|
BackupStatus["RESTORE"] = "RESTORE";
|
|
15
15
|
BackupStatus["READY"] = "READY";
|
|
16
16
|
})(BackupStatus = exports.BackupStatus || (exports.BackupStatus = {}));
|
|
17
|
+
var CollectionType;
|
|
18
|
+
(function (CollectionType) {
|
|
19
|
+
CollectionType["DEFAULT"] = "DEFAULT";
|
|
20
|
+
CollectionType["QNA_V1"] = "QNA_V1";
|
|
21
|
+
CollectionType["IDW_V1"] = "IDW_V1";
|
|
22
|
+
})(CollectionType = exports.CollectionType || (exports.CollectionType = {}));
|
|
17
23
|
//# sourceMappingURL=types.js.map
|
package/dist/cjs/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAuRA,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,iCAAe,CAAA;AACjB,CAAC,EALW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAKzB;AAKD,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;AACjB,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAKD,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB"}
|
package/dist/esm/types.js
CHANGED
|
@@ -11,4 +11,10 @@ export var BackupStatus;
|
|
|
11
11
|
BackupStatus["RESTORE"] = "RESTORE";
|
|
12
12
|
BackupStatus["READY"] = "READY";
|
|
13
13
|
})(BackupStatus || (BackupStatus = {}));
|
|
14
|
+
export var CollectionType;
|
|
15
|
+
(function (CollectionType) {
|
|
16
|
+
CollectionType["DEFAULT"] = "DEFAULT";
|
|
17
|
+
CollectionType["QNA_V1"] = "QNA_V1";
|
|
18
|
+
CollectionType["IDW_V1"] = "IDW_V1";
|
|
19
|
+
})(CollectionType || (CollectionType = {}));
|
|
14
20
|
//# sourceMappingURL=types.js.map
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAuRA,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,iCAAe,CAAA;AACjB,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB;AAKD,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;AACjB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAKD,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export type Property = {
|
|
|
33
33
|
export type CreateCollection = UpdateCollection & {
|
|
34
34
|
name: string;
|
|
35
35
|
properties?: Property[];
|
|
36
|
+
type?: CollectionType;
|
|
36
37
|
};
|
|
37
38
|
export type Search = {
|
|
38
39
|
query: string;
|
|
@@ -73,6 +74,11 @@ export declare enum BackupStatus {
|
|
|
73
74
|
RESTORE = "RESTORE",
|
|
74
75
|
READY = "READY"
|
|
75
76
|
}
|
|
77
|
+
export declare enum CollectionType {
|
|
78
|
+
DEFAULT = "DEFAULT",
|
|
79
|
+
QNA_V1 = "QNA_V1",
|
|
80
|
+
IDW_V1 = "IDW_V1"
|
|
81
|
+
}
|
|
76
82
|
export type DocumentProperty = {
|
|
77
83
|
name: string;
|
|
78
84
|
value?: any;
|
|
@@ -109,6 +115,7 @@ export type Collection = {
|
|
|
109
115
|
maxDistance?: number;
|
|
110
116
|
modelName?: string;
|
|
111
117
|
countPassages?: number;
|
|
118
|
+
type?: CollectionType;
|
|
112
119
|
};
|
|
113
120
|
export type SearchResult = {
|
|
114
121
|
id: string;
|
|
@@ -120,10 +127,12 @@ export type SearchResult = {
|
|
|
120
127
|
id: string;
|
|
121
128
|
name: string;
|
|
122
129
|
};
|
|
130
|
+
select: string[];
|
|
123
131
|
};
|
|
124
132
|
export type AskResults = {
|
|
125
133
|
result: CompletionRequestMessage;
|
|
126
134
|
searchResult: SearchResult;
|
|
135
|
+
select: string[];
|
|
127
136
|
};
|
|
128
137
|
export type UpdateDocument = {
|
|
129
138
|
description?: string;
|
|
@@ -150,20 +159,22 @@ export type Find = Partial<PaginationOptions> & Partial<OrderOptions> & {
|
|
|
150
159
|
export type FindPassages = Find & {
|
|
151
160
|
where?: Record<string, unknown>;
|
|
152
161
|
};
|
|
153
|
-
|
|
162
|
+
type TypedPassageProperties = {
|
|
154
163
|
content: string;
|
|
164
|
+
} | {
|
|
165
|
+
question: string;
|
|
166
|
+
answer: string;
|
|
167
|
+
};
|
|
168
|
+
export type CreatePassage<T extends Record<string, unknown> = Record<string, unknown>> = TypedPassageProperties & {
|
|
155
169
|
documentId: string;
|
|
156
170
|
loaderMetadata?: Record<string, unknown>;
|
|
157
171
|
} & T;
|
|
158
|
-
export type Passage<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
172
|
+
export type Passage<T extends Record<string, unknown> = Record<string, unknown>> = TypedPassageProperties & {
|
|
159
173
|
id: string;
|
|
160
|
-
content: string;
|
|
161
174
|
createdAt: string;
|
|
162
175
|
updatedAt: string;
|
|
163
176
|
} & T;
|
|
164
|
-
export type UpdatePassage<T extends Record<string, unknown> = Record<string, unknown>> =
|
|
165
|
-
content: string;
|
|
166
|
-
} & T;
|
|
177
|
+
export type UpdatePassage<T extends Record<string, unknown> = Record<string, unknown>> = TypedPassageProperties & T;
|
|
167
178
|
export type DeletedPassage = {
|
|
168
179
|
id: string;
|
|
169
180
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACtE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAIzB,KAAK,EAAE,KAAK,CAAC;IAKb,YAAY,CAAC,EAAE,MAAM,CAAC;IAKtB,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAKpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAKF,MAAM,MAAM,Y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AI9B,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/lookup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0-beta.2478.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -33,6 +33,5 @@
|
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
|
-
}
|
|
37
|
-
"gitHead": "bfb1545cd6728b8da3a8c2c47d630a1482db77df"
|
|
36
|
+
}
|
|
38
37
|
}
|
package/src/types.ts
CHANGED
|
@@ -126,6 +126,11 @@ export type CreateCollection = UpdateCollection & {
|
|
|
126
126
|
* Type: Array<Property>
|
|
127
127
|
*/
|
|
128
128
|
properties?: Property[];
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Collection type, it will be used for specific document loading post-processing. (Optional)
|
|
132
|
+
*/
|
|
133
|
+
type?: CollectionType;
|
|
129
134
|
};
|
|
130
135
|
|
|
131
136
|
/**
|
|
@@ -288,6 +293,15 @@ export enum BackupStatus {
|
|
|
288
293
|
READY = 'READY',
|
|
289
294
|
}
|
|
290
295
|
|
|
296
|
+
/**
|
|
297
|
+
* CollectionType represents the type of a collection.
|
|
298
|
+
*/
|
|
299
|
+
export enum CollectionType {
|
|
300
|
+
DEFAULT = 'DEFAULT',
|
|
301
|
+
QNA_V1 = 'QNA_V1',
|
|
302
|
+
IDW_V1 = 'IDW_V1',
|
|
303
|
+
}
|
|
304
|
+
|
|
291
305
|
export type DocumentProperty = {
|
|
292
306
|
/**
|
|
293
307
|
* Property name. e.g. `nameOfTheAuthor`
|
|
@@ -466,6 +480,11 @@ export type Collection = {
|
|
|
466
480
|
* Number of passages in the collection.
|
|
467
481
|
*/
|
|
468
482
|
countPassages?: number;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Collection type, it will be used for specific document loading post-processing. (Optional)
|
|
486
|
+
*/
|
|
487
|
+
type?: CollectionType;
|
|
469
488
|
};
|
|
470
489
|
|
|
471
490
|
/**
|
|
@@ -504,6 +523,11 @@ export type SearchResult = {
|
|
|
504
523
|
id: string;
|
|
505
524
|
name: string;
|
|
506
525
|
};
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Used properties in search.
|
|
529
|
+
*/
|
|
530
|
+
select: string[];
|
|
507
531
|
};
|
|
508
532
|
|
|
509
533
|
/**
|
|
@@ -519,6 +543,11 @@ export type AskResults = {
|
|
|
519
543
|
* Search result for the input question.
|
|
520
544
|
*/
|
|
521
545
|
searchResult: SearchResult;
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Used properties in search.
|
|
549
|
+
*/
|
|
550
|
+
select: string[];
|
|
522
551
|
};
|
|
523
552
|
|
|
524
553
|
|
|
@@ -640,15 +669,26 @@ export type FindPassages = Find & {
|
|
|
640
669
|
where?: Record<string, unknown>;
|
|
641
670
|
};
|
|
642
671
|
|
|
643
|
-
|
|
644
|
-
* Passage creation parameters. The properties other than listed are considered custom properties.
|
|
645
|
-
*/
|
|
646
|
-
export type CreatePassage<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
672
|
+
type TypedPassageProperties = {
|
|
647
673
|
/**
|
|
648
|
-
* Content of the passage
|
|
674
|
+
* Content of the default collection passage
|
|
649
675
|
*/
|
|
650
676
|
content: string;
|
|
677
|
+
} | {
|
|
678
|
+
/**
|
|
679
|
+
* question of the QnA collection passage
|
|
680
|
+
*/
|
|
681
|
+
question: string;
|
|
682
|
+
/**
|
|
683
|
+
* answer of the QnA collection passage
|
|
684
|
+
*/
|
|
685
|
+
answer: string;
|
|
686
|
+
};
|
|
651
687
|
|
|
688
|
+
/**
|
|
689
|
+
* Passage creation parameters. The properties other than listed are considered custom properties.
|
|
690
|
+
*/
|
|
691
|
+
export type CreatePassage<T extends Record<string, unknown> = Record<string, unknown>> = TypedPassageProperties & {
|
|
652
692
|
/**
|
|
653
693
|
* Document ID
|
|
654
694
|
*/
|
|
@@ -663,17 +703,12 @@ export type CreatePassage<T extends Record<string, unknown> = Record<string, unk
|
|
|
663
703
|
/**
|
|
664
704
|
* Passage represents a passage object.
|
|
665
705
|
*/
|
|
666
|
-
export type Passage<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
706
|
+
export type Passage<T extends Record<string, unknown> = Record<string, unknown>> = TypedPassageProperties & {
|
|
667
707
|
/**
|
|
668
708
|
* Passage ID
|
|
669
709
|
*/
|
|
670
710
|
id: string;
|
|
671
711
|
|
|
672
|
-
/**
|
|
673
|
-
* Passage Content
|
|
674
|
-
*/
|
|
675
|
-
content: string;
|
|
676
|
-
|
|
677
712
|
/**
|
|
678
713
|
* Creation Date
|
|
679
714
|
*/
|
|
@@ -689,12 +724,7 @@ export type Passage<T extends Record<string, unknown> = Record<string, unknown>>
|
|
|
689
724
|
/**
|
|
690
725
|
* Update passage parameters
|
|
691
726
|
*/
|
|
692
|
-
export type UpdatePassage<T extends Record<string, unknown> = Record<string, unknown>> =
|
|
693
|
-
/**
|
|
694
|
-
* Updated content of the passage
|
|
695
|
-
*/
|
|
696
|
-
content: string;
|
|
697
|
-
} & T;
|
|
727
|
+
export type UpdatePassage<T extends Record<string, unknown> = Record<string, unknown>> = TypedPassageProperties & T;
|
|
698
728
|
|
|
699
729
|
/**
|
|
700
730
|
* Represents a deleted passage.
|