@crewdle/web-sdk-types 1.0.23 → 1.0.25
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/dist/core/cluster/Cluster.d.ts +16 -1
- package/dist/core/sdk/SDKOptions.d.ts +6 -1
- package/dist/core/stream/ContentType.d.ts +5 -1
- package/dist/core/stream/ContentType.js +4 -0
- package/dist/external-storage/ExternalStorageConnection.d.ts +54 -0
- package/dist/external-storage/ExternalStorageConnection.js +10 -0
- package/dist/external-storage/ExternalStorageConnectionConnector.d.ts +25 -0
- package/dist/external-storage/ExternalStorageConnectionConnectorConstructor.d.ts +6 -0
- package/dist/external-storage/ExternalStorageListOptions.d.ts +10 -0
- package/dist/external-storage/index.d.ts +4 -0
- package/dist/external-storage/index.js +4 -0
- package/dist/generative-ai/GenerativeAIContext.d.ts +42 -0
- package/dist/generative-ai/GenerativeAIJobType.d.ts +18 -0
- package/dist/{ai → generative-ai}/GenerativeAIWorkerConnector.d.ts +3 -1
- package/dist/generative-ai/IIndex.d.ts +18 -0
- package/dist/generative-ai/IIndex.js +1 -0
- package/dist/generative-ai/NLPLibraryConnector.js +1 -0
- package/dist/generative-ai/NLPLibraryConnectorConstructor.js +1 -0
- package/dist/{ai → generative-ai}/index.d.ts +6 -3
- package/dist/{ai → generative-ai}/index.js +6 -3
- package/dist/generative-ai/job/JobParametersGenerativeAI.d.ts +15 -0
- package/dist/generative-ai/job/JobParametersGenerativeAI.js +1 -0
- package/dist/generative-ai/job/JobResultGenerativeAI.d.ts +17 -0
- package/dist/generative-ai/job/JobResultGenerativeAI.js +1 -0
- package/dist/generative-ai/job/index.d.ts +2 -0
- package/dist/generative-ai/job/index.js +2 -0
- package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentCreateJobParameters.d.ts +20 -0
- package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentCreateJobParameters.js +1 -0
- package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentJob.d.ts +25 -0
- package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentJob.js +1 -0
- package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentResult.d.ts +24 -0
- package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentResult.js +1 -0
- package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentWorkerParameters.d.ts +20 -0
- package/dist/generative-ai/jobs/download-document/GenerativeAIDownloadDocumentWorkerParameters.js +1 -0
- package/dist/generative-ai/jobs/download-document/index.d.ts +4 -0
- package/dist/generative-ai/jobs/download-document/index.js +4 -0
- package/dist/generative-ai/jobs/generic/GenerativeAICreateJobParameters.d.ts +11 -0
- package/dist/generative-ai/jobs/generic/GenerativeAICreateJobParameters.js +1 -0
- package/dist/generative-ai/jobs/generic/GenerativeAIJob.d.ts +10 -0
- package/dist/generative-ai/jobs/generic/GenerativeAIJob.js +1 -0
- package/dist/generative-ai/jobs/generic/GenerativeAIOptions.d.ts +7 -0
- package/dist/generative-ai/jobs/generic/GenerativeAIOptions.js +6 -0
- package/dist/generative-ai/jobs/generic/GenerativeAIWorkerConnectorParameters.d.ts +11 -0
- package/dist/generative-ai/jobs/generic/GenerativeAIWorkerConnectorParameters.js +1 -0
- package/dist/generative-ai/jobs/generic/GenerativeAIWorkerParameters.d.ts +12 -0
- package/dist/generative-ai/jobs/generic/GenerativeAIWorkerParameters.js +1 -0
- package/dist/generative-ai/jobs/generic/index.d.ts +5 -0
- package/dist/generative-ai/jobs/generic/index.js +5 -0
- package/dist/generative-ai/jobs/index.d.ts +4 -0
- package/dist/generative-ai/jobs/index.js +4 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIPromptCreateJobParameters.d.ts +21 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIPromptCreateJobParameters.js +1 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIPromptJob.d.ts +26 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIPromptJob.js +1 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIPromptOptions.d.ts +43 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIPromptOptions.js +1 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIPromptResult.d.ts +37 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIPromptResult.js +1 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIPromptWorkerConnectorParameters.d.ts +17 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIPromptWorkerConnectorParameters.js +1 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIPromptWorkerParameters.d.ts +20 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIPromptWorkerParameters.js +1 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIWorkerConnectorPromptResult.d.ts +7 -0
- package/dist/generative-ai/jobs/prompt/GenerativeAIWorkerConnectorPromptResult.js +1 -0
- package/dist/generative-ai/jobs/prompt/index.d.ts +9 -0
- package/dist/generative-ai/jobs/prompt/index.js +9 -0
- package/dist/generative-ai/jobs/prompt/options/PromptFunction.d.ts +22 -0
- package/dist/generative-ai/jobs/prompt/options/PromptFunction.js +1 -0
- package/dist/generative-ai/jobs/prompt/options/PromptFunctionParams.d.ts +11 -0
- package/dist/generative-ai/jobs/prompt/options/PromptFunctionParams.js +1 -0
- package/dist/generative-ai/jobs/prompt/options/PromptFunctionParamsType.d.ts +17 -0
- package/dist/generative-ai/jobs/prompt/options/PromptFunctionParamsType.js +18 -0
- package/dist/generative-ai/jobs/prompt/options/PromptHistory.d.ts +16 -0
- package/dist/generative-ai/jobs/prompt/options/PromptHistory.js +2 -0
- package/dist/generative-ai/jobs/prompt/options/PromptSource.d.ts +14 -0
- package/dist/generative-ai/jobs/prompt/options/PromptSource.js +16 -0
- package/dist/generative-ai/jobs/prompt/options/index.d.ts +5 -0
- package/dist/generative-ai/jobs/prompt/options/index.js +5 -0
- package/dist/generative-ai/jobs/prompt/result/PromptTypeText.d.ts +4 -0
- package/dist/generative-ai/jobs/prompt/result/PromptTypeText.js +1 -0
- package/dist/generative-ai/jobs/prompt/result/PromptTypeVector.d.ts +4 -0
- package/dist/generative-ai/jobs/prompt/result/PromptTypeVector.js +1 -0
- package/dist/generative-ai/jobs/prompt/result/index.d.ts +2 -0
- package/dist/generative-ai/jobs/prompt/result/index.js +2 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRating.d.ts +8 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRating.js +9 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRatingCreateJobParameters.d.ts +26 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRatingCreateJobParameters.js +1 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRatingJob.d.ts +25 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRatingJob.js +1 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRatingOptions.d.ts +16 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRatingOptions.js +1 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRatingResult.d.ts +18 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRatingResult.js +1 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRatingStatus.d.ts +8 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRatingStatus.js +9 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRatingWorkerParameters.d.ts +29 -0
- package/dist/generative-ai/jobs/rating/GenerativeAIRatingWorkerParameters.js +1 -0
- package/dist/generative-ai/jobs/rating/index.d.ts +7 -0
- package/dist/generative-ai/jobs/rating/index.js +7 -0
- package/dist/generative-ai/search/SearchConnector.js +1 -0
- package/dist/generative-ai/search/SearchConnectorConstructor.js +1 -0
- package/dist/generative-ai/search/SearchResult.d.ts +19 -0
- package/dist/generative-ai/search/SearchResult.js +5 -0
- package/dist/generative-ai/search/index.d.ts +3 -0
- package/dist/generative-ai/search/index.js +3 -0
- package/dist/generative-ai/union-types/CreateAIJobParameters.d.ts +8 -0
- package/dist/generative-ai/union-types/CreateAIJobParameters.js +1 -0
- package/dist/generative-ai/union-types/GenerativeAIJob.d.ts +8 -0
- package/dist/generative-ai/union-types/GenerativeAIJob.js +1 -0
- package/dist/generative-ai/union-types/GenerativeAIJobOptions.d.ts +7 -0
- package/dist/generative-ai/union-types/GenerativeAIJobOptions.js +1 -0
- package/dist/generative-ai/union-types/GenerativeAIJobResult.d.ts +9 -0
- package/dist/generative-ai/union-types/GenerativeAIJobResult.js +1 -0
- package/dist/generative-ai/union-types/GenerativeAIWorkerConnectorParameters.d.ts +6 -0
- package/dist/generative-ai/union-types/GenerativeAIWorkerConnectorParameters.js +1 -0
- package/dist/generative-ai/union-types/GenerativeAIWorkerConnectorResult.d.ts +12 -0
- package/dist/generative-ai/union-types/GenerativeAIWorkerConnectorResult.js +1 -0
- package/dist/generative-ai/union-types/GenerativeAIWorkerParameters.d.ts +8 -0
- package/dist/generative-ai/union-types/GenerativeAIWorkerParameters.js +1 -0
- package/dist/generative-ai/union-types/index.d.ts +7 -0
- package/dist/generative-ai/union-types/index.js +7 -0
- package/dist/graph-database/GraphDatabase.d.ts +11 -1
- package/dist/graph-database/GraphDatabaseConnector.d.ts +11 -1
- package/dist/graph-database/GraphDatabaseConnectorConstructor.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/object-storage/ObjectStoreBucket.d.ts +1 -1
- package/dist/object-storage/event/SyncCompleteEvent.d.ts +2 -2
- package/dist/object-storage/event/SyncCompleteEventPayload.d.ts +10 -0
- package/dist/object-storage/event/SyncCompleteEventPayload.js +1 -0
- package/dist/object-storage/event/index.d.ts +1 -0
- package/dist/vector-database/VectorDatabase.d.ts +11 -1
- package/dist/vector-database/VectorDatabaseConnector.d.ts +11 -1
- package/dist/vector-database/VectorDatabaseConnectorConstructor.d.ts +1 -1
- package/package.json +1 -1
- package/dist/ai/GenerativeAI.d.ts +0 -328
- package/dist/ai/GenerativeAI.js +0 -53
- package/dist/ai/GenerativeAIContext.d.ts +0 -132
- /package/dist/{ai/GenerativeAIContext.js → external-storage/ExternalStorageConnectionConnector.js} +0 -0
- /package/dist/{ai/GenerativeAIWorker.js → external-storage/ExternalStorageConnectionConnectorConstructor.js} +0 -0
- /package/dist/{ai/GenerativeAIWorkerConnectorConstructor.js → external-storage/ExternalStorageListOptions.js} +0 -0
- /package/dist/{ai/NLPLibraryConnector.js → generative-ai/GenerativeAIContext.js} +0 -0
- /package/dist/{ai/NLPLibraryConnectorConstructor.js → generative-ai/GenerativeAIJobType.js} +0 -0
- /package/dist/{ai → generative-ai}/GenerativeAIWorker.d.ts +0 -0
- /package/dist/{ai/SearchConnector.js → generative-ai/GenerativeAIWorker.js} +0 -0
- /package/dist/{ai → generative-ai}/GenerativeAIWorkerConnector.js +0 -0
- /package/dist/{ai → generative-ai}/GenerativeAIWorkerConnectorConstructor.d.ts +0 -0
- /package/dist/{ai/SearchConnectorConstructor.js → generative-ai/GenerativeAIWorkerConnectorConstructor.js} +0 -0
- /package/dist/{ai → generative-ai}/NLPLibraryConnector.d.ts +0 -0
- /package/dist/{ai → generative-ai}/NLPLibraryConnectorConstructor.d.ts +0 -0
- /package/dist/{ai → generative-ai/search}/SearchConnector.d.ts +0 -0
- /package/dist/{ai → generative-ai/search}/SearchConnectorConstructor.d.ts +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IGenerativeAIDownloadDocumentCreateJobParameters } from '../jobs/download-document';
|
|
2
|
+
import { IGenerativeAIPromptCreateJobParameters } from '../jobs/prompt';
|
|
3
|
+
import { IGenerativeAIRatingCreateJobParameters } from '../jobs/rating';
|
|
4
|
+
/**
|
|
5
|
+
* Represents the parameters of an AI job.
|
|
6
|
+
* @category AI
|
|
7
|
+
*/
|
|
8
|
+
export type CreateAIJobParameters = IGenerativeAIPromptCreateJobParameters | IGenerativeAIRatingCreateJobParameters | IGenerativeAIDownloadDocumentCreateJobParameters;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IGenerativeAIDownloadDocumentJob } from '../jobs/download-document';
|
|
2
|
+
import { IGenerativeAIPromptJob } from '../jobs/prompt';
|
|
3
|
+
import { IGenerativeAIRatingJob } from '../jobs/rating';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a Generative AI job.
|
|
6
|
+
* @category AI
|
|
7
|
+
*/
|
|
8
|
+
export type GenerativeAIJob = IGenerativeAIPromptJob | IGenerativeAIRatingJob | IGenerativeAIDownloadDocumentJob;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IGenerativeAIPromptOptions } from '../jobs/prompt';
|
|
2
|
+
import { IGenerativeAIRatingOptions } from '../jobs/rating';
|
|
3
|
+
/**
|
|
4
|
+
* The AI options to parameterize the AI job.
|
|
5
|
+
* @category AI
|
|
6
|
+
*/
|
|
7
|
+
export type GenerativeAIJobOptions = IGenerativeAIPromptOptions | IGenerativeAIRatingOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IGenerativeAIDownloadDocumentResult } from '../jobs/download-document';
|
|
2
|
+
import { IGenerativeAIPromptResult } from '../jobs/prompt';
|
|
3
|
+
import { IGenerativeAIRatingResult } from '../jobs/rating';
|
|
4
|
+
/**
|
|
5
|
+
* Union type for an AI job result.
|
|
6
|
+
* Represents the result of an AI job.
|
|
7
|
+
* @category AI
|
|
8
|
+
*/
|
|
9
|
+
export type GenerativeAIJobResult = IGenerativeAIPromptResult | IGenerativeAIRatingResult | IGenerativeAIDownloadDocumentResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IGenerativeAIPromptWorkerConnectorParameters } from '../jobs/prompt/GenerativeAIPromptWorkerConnectorParameters';
|
|
2
|
+
/**
|
|
3
|
+
* Union type for AI worker connector parameters.
|
|
4
|
+
* @category AI
|
|
5
|
+
*/
|
|
6
|
+
export type GenerativeAIWorkerConnectorParameters = IGenerativeAIPromptWorkerConnectorParameters;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IGenerativeAIWorkerConnectorPromptResult } from '../jobs/prompt';
|
|
2
|
+
/**
|
|
3
|
+
* Union type for AI worker connector result.
|
|
4
|
+
* @category AI
|
|
5
|
+
*/
|
|
6
|
+
export type GenerativeAIWorkerConnectorResult = IGenerativeAIWorkerConnectorPromptResult;
|
|
7
|
+
/**
|
|
8
|
+
* Helper type for AI worker connector result enum type.
|
|
9
|
+
* This is required in connectors that cannot import the AIJobType enum.
|
|
10
|
+
* @category AI
|
|
11
|
+
*/
|
|
12
|
+
export type GenerativeAIWorkerConnectorTypes = GenerativeAIWorkerConnectorResult['type'];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IGenerativeAIDownloadDocumentWorkerParameters } from '../jobs/download-document';
|
|
2
|
+
import { IGenerativeAIPromptWorkerParameters } from '../jobs/prompt';
|
|
3
|
+
import { IGenerativeAIRatingWorkerParameters } from '../jobs/rating';
|
|
4
|
+
/**
|
|
5
|
+
* Union type for AI job worker parameters.
|
|
6
|
+
* @category AI
|
|
7
|
+
*/
|
|
8
|
+
export type GenerativeAIWorkerParameters = IGenerativeAIPromptWorkerParameters | IGenerativeAIRatingWorkerParameters | IGenerativeAIDownloadDocumentWorkerParameters;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './CreateAIJobParameters';
|
|
2
|
+
export * from './GenerativeAIJob';
|
|
3
|
+
export * from './GenerativeAIJobOptions';
|
|
4
|
+
export * from './GenerativeAIJobResult';
|
|
5
|
+
export * from './GenerativeAIWorkerConnectorResult';
|
|
6
|
+
export * from './GenerativeAIWorkerConnectorParameters';
|
|
7
|
+
export * from './GenerativeAIWorkerParameters';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './CreateAIJobParameters';
|
|
2
|
+
export * from './GenerativeAIJob';
|
|
3
|
+
export * from './GenerativeAIJobOptions';
|
|
4
|
+
export * from './GenerativeAIJobResult';
|
|
5
|
+
export * from './GenerativeAIWorkerConnectorResult';
|
|
6
|
+
export * from './GenerativeAIWorkerConnectorParameters';
|
|
7
|
+
export * from './GenerativeAIWorkerParameters';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IIndex } from '../ai';
|
|
1
|
+
import { IIndex } from '../generative-ai';
|
|
2
2
|
import { IDataStream } from '../core';
|
|
3
3
|
/**
|
|
4
4
|
* The interface for the graph database.
|
|
@@ -46,4 +46,14 @@ export interface IGraphDatabase extends IDataStream {
|
|
|
46
46
|
getContent(nodes: string[], maxDepth?: number, contentSize?: number): {
|
|
47
47
|
[key: string]: string[];
|
|
48
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Save the database to disk.
|
|
51
|
+
* @param version The version of the data collection.
|
|
52
|
+
*/
|
|
53
|
+
saveToDisk(version: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Load the database from disk.
|
|
56
|
+
* @param version The version of the data collection.
|
|
57
|
+
*/
|
|
58
|
+
loadFromDisk(version: string): void;
|
|
49
59
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IIndex } from '../ai';
|
|
1
|
+
import { IIndex } from '../generative-ai';
|
|
2
2
|
/**
|
|
3
3
|
* The graph database connector interface.
|
|
4
4
|
* @category Connector
|
|
@@ -38,4 +38,14 @@ export interface IGraphDatabaseConnector {
|
|
|
38
38
|
* @returns The size of the database.
|
|
39
39
|
*/
|
|
40
40
|
getSize(): number;
|
|
41
|
+
/**
|
|
42
|
+
* Save the database to disk.
|
|
43
|
+
* @param version The version of the data collection.
|
|
44
|
+
*/
|
|
45
|
+
saveToDisk(version: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* Load the database from disk.
|
|
48
|
+
* @param version The version of the data collection.
|
|
49
|
+
*/
|
|
50
|
+
loadFromDisk(version: string): void;
|
|
41
51
|
}
|
|
@@ -3,4 +3,4 @@ import { IGraphDatabaseConnector } from './GraphDatabaseConnector';
|
|
|
3
3
|
* The graph database connector constructor type.
|
|
4
4
|
* @category Graph Database
|
|
5
5
|
*/
|
|
6
|
-
export type GraphDatabaseConnectorConstructor = new () => IGraphDatabaseConnector;
|
|
6
|
+
export type GraphDatabaseConnectorConstructor = new (dbKey: string) => IGraphDatabaseConnector;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './media-stream';
|
|
|
4
4
|
export * from './object-storage';
|
|
5
5
|
export * from './pubsub';
|
|
6
6
|
export * from './job';
|
|
7
|
-
export * from './ai';
|
|
7
|
+
export * from './generative-ai';
|
|
8
8
|
export * from './vector-database';
|
|
9
9
|
export * from './graph-database';
|
|
10
|
+
export * from './external-storage';
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from './media-stream';
|
|
|
4
4
|
export * from './object-storage';
|
|
5
5
|
export * from './pubsub';
|
|
6
6
|
export * from './job';
|
|
7
|
-
export * from './ai';
|
|
7
|
+
export * from './generative-ai';
|
|
8
8
|
export * from './vector-database';
|
|
9
9
|
export * from './graph-database';
|
|
10
|
+
export * from './external-storage';
|
|
@@ -52,7 +52,7 @@ export interface IObjectStoreBucket extends IDataStream {
|
|
|
52
52
|
/**
|
|
53
53
|
* List the objects and folders of the bucket.
|
|
54
54
|
* @param path The path of the folder.
|
|
55
|
-
* @param
|
|
55
|
+
* @param options The optional options for listing the objects and folders.
|
|
56
56
|
* @returns The list of objects and folders.
|
|
57
57
|
*/
|
|
58
58
|
list(path: string, options?: IObjectStoreListOptions): Promise<ObjectDescriptor[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StorageEventType } from '.';
|
|
1
|
+
import { StorageEventType, ISyncCompleteEventPayload } from '.';
|
|
2
2
|
/**
|
|
3
3
|
* The sync complete event.
|
|
4
4
|
* @category Object Storage
|
|
@@ -11,5 +11,5 @@ export interface ISyncCompleteEvent {
|
|
|
11
11
|
/**
|
|
12
12
|
* The sync complete event payload.
|
|
13
13
|
*/
|
|
14
|
-
payload:
|
|
14
|
+
payload: ISyncCompleteEventPayload;
|
|
15
15
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,5 +9,6 @@ export { IFolderMoveEvent } from './FolderMoveEvent';
|
|
|
9
9
|
export { IObjectDeleteEventPayload } from './ObjectDeleteEventPayload';
|
|
10
10
|
export { IObjectMoveEventPayload } from './ObjectMoveEventPayload';
|
|
11
11
|
export { ISyncCompleteEvent } from './SyncCompleteEvent';
|
|
12
|
+
export { ISyncCompleteEventPayload } from './SyncCompleteEventPayload';
|
|
12
13
|
export { StorageEvent } from './StorageEvent';
|
|
13
14
|
export { StorageEventType } from './StorageEventType';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IIndex, ISearchResult } from '../ai';
|
|
1
|
+
import { IIndex, ISearchResult } from '../generative-ai';
|
|
2
2
|
import { IDataStream } from '../core';
|
|
3
3
|
/**
|
|
4
4
|
* The interface for the vector database.
|
|
@@ -39,4 +39,14 @@ export interface IVectorDatabase extends IDataStream {
|
|
|
39
39
|
* @param name The name of the content.
|
|
40
40
|
*/
|
|
41
41
|
remove(name: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Save the database to disk.
|
|
44
|
+
* @param version The version of the data collection.
|
|
45
|
+
*/
|
|
46
|
+
saveToDisk(version: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Load the database from disk.
|
|
49
|
+
* @param version The version of the data collection.
|
|
50
|
+
*/
|
|
51
|
+
loadFromDisk(version: string): void;
|
|
42
52
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IIndex, ISearchResult } from '../ai';
|
|
1
|
+
import { IIndex, ISearchResult } from '../generative-ai';
|
|
2
2
|
/**
|
|
3
3
|
* The vector database connector interface.
|
|
4
4
|
* @category Connector
|
|
@@ -31,4 +31,14 @@ export interface IVectorDatabaseConnector {
|
|
|
31
31
|
* @returns The content of the database.
|
|
32
32
|
*/
|
|
33
33
|
getBuffer(): ArrayBuffer;
|
|
34
|
+
/**
|
|
35
|
+
* Save the database to disk.
|
|
36
|
+
* @param version The version of the data collection.
|
|
37
|
+
*/
|
|
38
|
+
saveToDisk(version: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Load the database from disk.
|
|
41
|
+
* @param version The version of the data collection.
|
|
42
|
+
*/
|
|
43
|
+
loadFromDisk(version: string): void;
|
|
34
44
|
}
|
|
@@ -3,4 +3,4 @@ import { IVectorDatabaseConnector } from '.';
|
|
|
3
3
|
* The vector database connector constructor type.
|
|
4
4
|
* @category Vector Database
|
|
5
5
|
*/
|
|
6
|
-
export type VectorDatabaseConnectorConstructor = new () => IVectorDatabaseConnector;
|
|
6
|
+
export type VectorDatabaseConnectorConstructor = new (dbKey: string) => IVectorDatabaseConnector;
|
package/package.json
CHANGED
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import { IJobParameters, IJobResult } from '../job';
|
|
2
|
-
/**
|
|
3
|
-
* The AI prompt rating Enum
|
|
4
|
-
* @category AI
|
|
5
|
-
*/
|
|
6
|
-
export declare enum PromptRating {
|
|
7
|
-
Up = "up",
|
|
8
|
-
Down = "down"
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* The AI prompt source Enum
|
|
12
|
-
* @category AI
|
|
13
|
-
*/
|
|
14
|
-
export declare enum PromptSource {
|
|
15
|
-
/**
|
|
16
|
-
* The prompt was generated by the AI.
|
|
17
|
-
*/
|
|
18
|
-
AI = "ai",
|
|
19
|
-
/**
|
|
20
|
-
* The prompt was generated by a human.
|
|
21
|
-
*/
|
|
22
|
-
Human = "human"
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The AI prompt history Interface
|
|
26
|
-
* Represents the history of a prompt.
|
|
27
|
-
* @category AI
|
|
28
|
-
*/
|
|
29
|
-
export interface IPromptHistory {
|
|
30
|
-
/**
|
|
31
|
-
* The source of the prompt.
|
|
32
|
-
*/
|
|
33
|
-
source: PromptSource;
|
|
34
|
-
/**
|
|
35
|
-
* The prompt.
|
|
36
|
-
*/
|
|
37
|
-
message: string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* The type of parameters supported for agentic functions
|
|
41
|
-
*/
|
|
42
|
-
export declare enum PromptFunctionParamsType {
|
|
43
|
-
/**
|
|
44
|
-
* The parameter is a string.
|
|
45
|
-
*/
|
|
46
|
-
String = "string",
|
|
47
|
-
/**
|
|
48
|
-
* The parameter is a number.
|
|
49
|
-
*/
|
|
50
|
-
Number = "number",
|
|
51
|
-
/**
|
|
52
|
-
* The parameter is a boolean.
|
|
53
|
-
*/
|
|
54
|
-
Boolean = "boolean"
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* The AI prompt function parameters Interface
|
|
58
|
-
* Represents the parameters for a prompt function.
|
|
59
|
-
* @category AI
|
|
60
|
-
*/
|
|
61
|
-
export interface IPromptFunctionParams {
|
|
62
|
-
[key: string]: {
|
|
63
|
-
type: PromptFunctionParamsType;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* The AI prompt function Interface
|
|
68
|
-
* Represents a function that can be called by the LLM.
|
|
69
|
-
* @category AI
|
|
70
|
-
*/
|
|
71
|
-
export interface IPromptFunction {
|
|
72
|
-
/**
|
|
73
|
-
* The function description.
|
|
74
|
-
*/
|
|
75
|
-
description: string;
|
|
76
|
-
/**
|
|
77
|
-
* The function parameters.
|
|
78
|
-
*/
|
|
79
|
-
params?: IPromptFunctionParams;
|
|
80
|
-
/**
|
|
81
|
-
* The function callback.
|
|
82
|
-
*/
|
|
83
|
-
callback: (params?: {
|
|
84
|
-
[key: string]: string | number | boolean;
|
|
85
|
-
}) => string | Promise<string>;
|
|
86
|
-
}
|
|
87
|
-
export type AIJobOptions = IPromptOptions | IRatingOptions;
|
|
88
|
-
/**
|
|
89
|
-
* The AI options Interface
|
|
90
|
-
* Represents the options for an AI job.
|
|
91
|
-
* @category AI
|
|
92
|
-
*/
|
|
93
|
-
export interface IAIOptions {
|
|
94
|
-
/**
|
|
95
|
-
* The thread id
|
|
96
|
-
*/
|
|
97
|
-
threadId?: string;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* The AI prompt options Interface
|
|
101
|
-
* Represents the options for an AI prompt.
|
|
102
|
-
* @category AI
|
|
103
|
-
*/
|
|
104
|
-
export interface IPromptOptions extends IAIOptions {
|
|
105
|
-
/**
|
|
106
|
-
* The instructions for the AI job.
|
|
107
|
-
*/
|
|
108
|
-
instructions?: string;
|
|
109
|
-
/**
|
|
110
|
-
* The context for the AI job.
|
|
111
|
-
*/
|
|
112
|
-
history?: IPromptHistory[];
|
|
113
|
-
/**
|
|
114
|
-
* The maximum number of tokens to generate.
|
|
115
|
-
*/
|
|
116
|
-
maxTokens?: number;
|
|
117
|
-
/**
|
|
118
|
-
* The temperature for the LLM.
|
|
119
|
-
*/
|
|
120
|
-
temperature?: number;
|
|
121
|
-
/**
|
|
122
|
-
* The functions that can be called by the LLM.
|
|
123
|
-
*/
|
|
124
|
-
functions?: Map<string, IPromptFunction>;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* The AI rating options Interface
|
|
128
|
-
* Represents the options for an AI rating.
|
|
129
|
-
* @category AI
|
|
130
|
-
*/
|
|
131
|
-
export interface IRatingOptions extends IAIOptions {
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* The AI prompt type text
|
|
135
|
-
*/
|
|
136
|
-
export type PromptTypeText = string | string[];
|
|
137
|
-
/**
|
|
138
|
-
* The AI prompt type vector
|
|
139
|
-
*/
|
|
140
|
-
export type PromptTypeVector = number[];
|
|
141
|
-
/**
|
|
142
|
-
* The AI prompt result Interface
|
|
143
|
-
* Represents the result of an AI prompt.
|
|
144
|
-
* @category AI
|
|
145
|
-
*/
|
|
146
|
-
export interface IGenerativeAIPromptResult extends IJobResultAI {
|
|
147
|
-
/**
|
|
148
|
-
* The prompt AI job type.
|
|
149
|
-
*/
|
|
150
|
-
type: AIJobType.Prompt;
|
|
151
|
-
/**
|
|
152
|
-
* The output of the AI job.
|
|
153
|
-
*/
|
|
154
|
-
output?: PromptTypeText | PromptTypeVector;
|
|
155
|
-
/**
|
|
156
|
-
* The relevant context used by the AI job.
|
|
157
|
-
*/
|
|
158
|
-
context?: ISearchResult[];
|
|
159
|
-
/**
|
|
160
|
-
* The tokens used by the AI job.
|
|
161
|
-
*/
|
|
162
|
-
inputTokens?: number;
|
|
163
|
-
/**
|
|
164
|
-
* The tokens generated by the AI job.
|
|
165
|
-
*/
|
|
166
|
-
outputTokens?: number;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* The AI rating status Enum
|
|
170
|
-
* @category AI
|
|
171
|
-
*/
|
|
172
|
-
export declare enum AIRatingStatus {
|
|
173
|
-
Success = "success",
|
|
174
|
-
Error = "error"
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* The AI rating result Interface
|
|
178
|
-
* Represents the result of an AI rating.
|
|
179
|
-
* @category AI
|
|
180
|
-
*/
|
|
181
|
-
export interface IGenerativeAIRatingResult extends IJobResultAI {
|
|
182
|
-
/**
|
|
183
|
-
* The rating AI job type.
|
|
184
|
-
*/
|
|
185
|
-
type: AIJobType.Rating;
|
|
186
|
-
/**
|
|
187
|
-
* The status of the rating.
|
|
188
|
-
*/
|
|
189
|
-
status: AIRatingStatus;
|
|
190
|
-
}
|
|
191
|
-
export type GenerativeAIJobResult = IGenerativeAIPromptResult | IGenerativeAIRatingResult;
|
|
192
|
-
/**
|
|
193
|
-
* The AI job result Interface
|
|
194
|
-
* Represents the result of an AI job.
|
|
195
|
-
* @category AI
|
|
196
|
-
*/
|
|
197
|
-
export interface IJobResultAI extends IJobResult {
|
|
198
|
-
/**
|
|
199
|
-
* The AI job type.
|
|
200
|
-
*/
|
|
201
|
-
type: AIJobType;
|
|
202
|
-
/**
|
|
203
|
-
* The index of the output, in case of partial results.
|
|
204
|
-
*/
|
|
205
|
-
index?: number;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* The AI job type Enum
|
|
209
|
-
* @category AI
|
|
210
|
-
*/
|
|
211
|
-
export declare const enum AIJobType {
|
|
212
|
-
/**
|
|
213
|
-
* The AI job generates a prompt.
|
|
214
|
-
*/
|
|
215
|
-
Prompt = "prompt",
|
|
216
|
-
/**
|
|
217
|
-
* The AI job rates a prompt.
|
|
218
|
-
*/
|
|
219
|
-
Rating = "rate"
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* The AI job parameters Interface
|
|
223
|
-
* Parameters for AI job type.
|
|
224
|
-
* @category AI
|
|
225
|
-
*/
|
|
226
|
-
export interface IJobParametersGenerativeAI extends IJobParameters, IPromptOptions, IRatingOptions {
|
|
227
|
-
/**
|
|
228
|
-
* The AI job type.
|
|
229
|
-
*/
|
|
230
|
-
type: AIJobType;
|
|
231
|
-
/**
|
|
232
|
-
* The thread id, if within a conversation.
|
|
233
|
-
*/
|
|
234
|
-
threadId: string;
|
|
235
|
-
}
|
|
236
|
-
export type GenerativeAIWorkerParameters = IGenerativeAIPromptWorkerParameters | IGenerativeAIRatingWorkerParameters;
|
|
237
|
-
export interface IGenerativeAIWorkerParameters extends IJobParametersGenerativeAI {
|
|
238
|
-
/**
|
|
239
|
-
* The AI job type.
|
|
240
|
-
*/
|
|
241
|
-
type: AIJobType;
|
|
242
|
-
}
|
|
243
|
-
export interface IGenerativeAIPromptWorkerParameters extends IGenerativeAIWorkerParameters {
|
|
244
|
-
/**
|
|
245
|
-
* The AI job type.
|
|
246
|
-
*/
|
|
247
|
-
type: AIJobType.Prompt;
|
|
248
|
-
/**
|
|
249
|
-
* The prompt for the AI job.
|
|
250
|
-
*/
|
|
251
|
-
prompt: string;
|
|
252
|
-
}
|
|
253
|
-
export interface IGenerativeAIRatingWorkerParameters extends IGenerativeAIWorkerParameters {
|
|
254
|
-
/**
|
|
255
|
-
* The AI job type.
|
|
256
|
-
*/
|
|
257
|
-
type: AIJobType.Rating;
|
|
258
|
-
/**
|
|
259
|
-
* The job ID.
|
|
260
|
-
*/
|
|
261
|
-
jobId: string;
|
|
262
|
-
/**
|
|
263
|
-
* The rating for the AI prompt.
|
|
264
|
-
*/
|
|
265
|
-
rating: PromptRating;
|
|
266
|
-
/**
|
|
267
|
-
* The feedback for the AI prompt
|
|
268
|
-
*/
|
|
269
|
-
feedback?: string;
|
|
270
|
-
}
|
|
271
|
-
export type GenerativeAIWorkerConnectorParameters = IGenerativeAIPromptWorkerConnectorParameters;
|
|
272
|
-
export type GenerativeAIWorkerConnectorResult = IGenerativeAIWorkerConnectorPromptResult;
|
|
273
|
-
export type GenerativeAIWorkerConnectorTypes = GenerativeAIWorkerConnectorResult['type'];
|
|
274
|
-
export interface IGenerativeAIWorkerConnectorPromptResult extends IGenerativeAIPromptResult {
|
|
275
|
-
}
|
|
276
|
-
export interface IGenerativeAIWorkerConnectorParameters {
|
|
277
|
-
/**
|
|
278
|
-
* The AI job type.
|
|
279
|
-
*/
|
|
280
|
-
type: AIJobType;
|
|
281
|
-
}
|
|
282
|
-
export interface IGenerativeAIPromptWorkerConnectorParameters extends IGenerativeAIWorkerConnectorParameters, IPromptOptions {
|
|
283
|
-
/**
|
|
284
|
-
* The AI job type.
|
|
285
|
-
*/
|
|
286
|
-
type: AIJobType.Prompt;
|
|
287
|
-
/**
|
|
288
|
-
* The prompt for the AI job.
|
|
289
|
-
*/
|
|
290
|
-
prompt: string;
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Represents a search result.
|
|
294
|
-
* @category AI
|
|
295
|
-
*/
|
|
296
|
-
export interface ISearchResult {
|
|
297
|
-
/**
|
|
298
|
-
* The content of the search result.
|
|
299
|
-
*/
|
|
300
|
-
content: string;
|
|
301
|
-
/**
|
|
302
|
-
* The relevance of the search result.
|
|
303
|
-
* The relevance is a number between 0 and 1, where 1 is the most relevant.
|
|
304
|
-
*/
|
|
305
|
-
relevance: number;
|
|
306
|
-
/**
|
|
307
|
-
* The path name of the document containing the search result.
|
|
308
|
-
*/
|
|
309
|
-
pathName: string;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Represents a content index.
|
|
313
|
-
* @category AI
|
|
314
|
-
*/
|
|
315
|
-
export interface IIndex {
|
|
316
|
-
/**
|
|
317
|
-
* The content of the index.
|
|
318
|
-
*/
|
|
319
|
-
content: string;
|
|
320
|
-
/**
|
|
321
|
-
* The start index of the content.
|
|
322
|
-
*/
|
|
323
|
-
start: number;
|
|
324
|
-
/**
|
|
325
|
-
* The length of the content.
|
|
326
|
-
*/
|
|
327
|
-
length: number;
|
|
328
|
-
}
|
package/dist/ai/GenerativeAI.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The AI prompt rating Enum
|
|
3
|
-
* @category AI
|
|
4
|
-
*/
|
|
5
|
-
export var PromptRating;
|
|
6
|
-
(function (PromptRating) {
|
|
7
|
-
PromptRating["Up"] = "up";
|
|
8
|
-
PromptRating["Down"] = "down";
|
|
9
|
-
})(PromptRating || (PromptRating = {}));
|
|
10
|
-
/**
|
|
11
|
-
* The AI prompt source Enum
|
|
12
|
-
* @category AI
|
|
13
|
-
*/
|
|
14
|
-
export var PromptSource;
|
|
15
|
-
(function (PromptSource) {
|
|
16
|
-
/**
|
|
17
|
-
* The prompt was generated by the AI.
|
|
18
|
-
*/
|
|
19
|
-
PromptSource["AI"] = "ai";
|
|
20
|
-
/**
|
|
21
|
-
* The prompt was generated by a human.
|
|
22
|
-
*/
|
|
23
|
-
PromptSource["Human"] = "human";
|
|
24
|
-
})(PromptSource || (PromptSource = {}));
|
|
25
|
-
;
|
|
26
|
-
;
|
|
27
|
-
/**
|
|
28
|
-
* The type of parameters supported for agentic functions
|
|
29
|
-
*/
|
|
30
|
-
export var PromptFunctionParamsType;
|
|
31
|
-
(function (PromptFunctionParamsType) {
|
|
32
|
-
/**
|
|
33
|
-
* The parameter is a string.
|
|
34
|
-
*/
|
|
35
|
-
PromptFunctionParamsType["String"] = "string";
|
|
36
|
-
/**
|
|
37
|
-
* The parameter is a number.
|
|
38
|
-
*/
|
|
39
|
-
PromptFunctionParamsType["Number"] = "number";
|
|
40
|
-
/**
|
|
41
|
-
* The parameter is a boolean.
|
|
42
|
-
*/
|
|
43
|
-
PromptFunctionParamsType["Boolean"] = "boolean";
|
|
44
|
-
})(PromptFunctionParamsType || (PromptFunctionParamsType = {}));
|
|
45
|
-
/**
|
|
46
|
-
* The AI rating status Enum
|
|
47
|
-
* @category AI
|
|
48
|
-
*/
|
|
49
|
-
export var AIRatingStatus;
|
|
50
|
-
(function (AIRatingStatus) {
|
|
51
|
-
AIRatingStatus["Success"] = "success";
|
|
52
|
-
AIRatingStatus["Error"] = "error";
|
|
53
|
-
})(AIRatingStatus || (AIRatingStatus = {}));
|