@crewdle/web-sdk-types 1.0.36 → 1.0.37
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/sdk/SDKOptions.d.ts +2 -2
- package/dist/generative-ai/IIndex.d.ts +1 -1
- package/dist/generative-ai/rag/GenerativeAIRagConnector.d.ts +19 -6
- package/dist/generative-ai/rag/GenerativeAIRagConnector.js +5 -1
- package/dist/generative-ai/search/AISearchConnector.d.ts +2 -1
- package/dist/generative-ai/search/SearchResult.d.ts +8 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { KeyValueDatabaseConnectorConstructor } from '../../key-value-database';
|
|
|
2
2
|
import { ILoggingConnector } from '.';
|
|
3
3
|
import { DocumentParserConnectorConstructor, ObjectStoreConnectorConstructor } from '../../object-storage';
|
|
4
4
|
import { PeerConnectionConnectorConstructor } from '../connection';
|
|
5
|
-
import { AISearchConnectorConstructor, GenerativeAIEngineType, GenerativeAIFileConnectorConstructor, GenerativeAIRagConnectorConstructor, GenerativeAIWorkerConnectorConstructor, NLPLibraryConnectorConstructor, QueryFileConnectorConstructor, SearchConnectorConstructor } from '../../generative-ai';
|
|
5
|
+
import { AISearchConnectorConstructor, GenerativeAIEngineType, GenerativeAIFileConnectorConstructor, GenerativeAIRagConnectorConstructor, GenerativeAIRagType, GenerativeAIWorkerConnectorConstructor, NLPLibraryConnectorConstructor, QueryFileConnectorConstructor, SearchConnectorConstructor } from '../../generative-ai';
|
|
6
6
|
import { VectorDatabaseConnectorConstructor } from '../../vector-database';
|
|
7
7
|
import { GraphDatabaseConnectorConstructor } from '../../graph-database';
|
|
8
8
|
import { ExternalStorageConnectionConnectorConstructor, ExternalStorageType } from '../../external-storage';
|
|
@@ -81,7 +81,7 @@ export interface ISDKOptions {
|
|
|
81
81
|
/**
|
|
82
82
|
* The custom RAG connector to use for RAG tasks.
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
ragConnectors?: Map<GenerativeAIRagType, GenerativeAIRagConnectorConstructor>;
|
|
85
85
|
/**
|
|
86
86
|
* The maximum number of outgoing subscriptions.
|
|
87
87
|
*/
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { IIndex } from '../IIndex';
|
|
1
2
|
import { IGenerativeAIFile } from '../jobs';
|
|
2
3
|
import { ISearchResult } from '../search';
|
|
4
|
+
export declare enum GenerativeAIRagType {
|
|
5
|
+
Pinecone = "pinecone",
|
|
6
|
+
Crewdle = "crewdle"
|
|
7
|
+
}
|
|
3
8
|
/**
|
|
4
9
|
* Generative AI Rag Connector Interface
|
|
5
10
|
* @category AI
|
|
@@ -7,42 +12,50 @@ import { ISearchResult } from '../search';
|
|
|
7
12
|
export interface IGenerativeAIRagConnector {
|
|
8
13
|
/**
|
|
9
14
|
* Create a collection.
|
|
15
|
+
* @param instanceId The instance id to create the collection.
|
|
10
16
|
* @param collectionId The collection id to create.
|
|
11
17
|
* @returns A promise that resolves when the collection is created.
|
|
12
18
|
*/
|
|
13
|
-
createCollection(collectionId: string): Promise<void>;
|
|
19
|
+
createCollection(instanceId: string, collectionId: string): Promise<void>;
|
|
14
20
|
/**
|
|
15
21
|
* Delete a collection.
|
|
22
|
+
* @param instanceId The instance id to delete the collection.
|
|
16
23
|
* @param collectionId The collection id to delete.
|
|
24
|
+
* @param deleteInstance Whether to delete the instance as well.
|
|
17
25
|
* @returns A promise that resolves when the collection is deleted.
|
|
18
26
|
*/
|
|
19
|
-
deleteCollection(collectionId: string): Promise<void>;
|
|
27
|
+
deleteCollection(instanceId: string, collectionId: string, deleteInstance: boolean): Promise<void>;
|
|
20
28
|
/**
|
|
21
29
|
* Query a collection.
|
|
30
|
+
* @param instanceId The instance id to query.
|
|
22
31
|
* @param collectionId The collection id to query.
|
|
23
32
|
* @param query The query to run.
|
|
33
|
+
* @param topK The number of results to return.
|
|
24
34
|
* @returns The search results.
|
|
25
35
|
*/
|
|
26
|
-
queryCollection(collectionId: string, query: string): Promise<ISearchResult[]>;
|
|
36
|
+
queryCollection(instanceId: string, collectionId: string, query: string | number[], topK: number): Promise<ISearchResult[]>;
|
|
27
37
|
/**
|
|
28
38
|
* Delete a file.
|
|
39
|
+
* @param instanceId The instance id of the file to delete.
|
|
29
40
|
* @param collectionId The collection id of the file to delete.
|
|
30
41
|
* @param fileId The file id to delete.
|
|
31
42
|
* @returns A promise that resolves when the file is deleted.
|
|
32
43
|
*/
|
|
33
|
-
deleteFile(collectionId: string, fileId: string): Promise<void>;
|
|
44
|
+
deleteFile(instanceId: string, collectionId: string, fileId: string): Promise<void>;
|
|
34
45
|
/**
|
|
35
46
|
* Ingest a file.
|
|
47
|
+
* @param instanceId The instance id to ingest the file.
|
|
36
48
|
* @param collectionId The collection id to ingest the file.
|
|
37
49
|
* @param fileName The name of the file to ingest.
|
|
38
50
|
* @param content The content of the file to ingest.
|
|
39
51
|
* @returns A promise that resolves when the file is ingested.
|
|
40
52
|
*/
|
|
41
|
-
ingestFile(collectionId: string, fileName: string, content: string): Promise<void>;
|
|
53
|
+
ingestFile(instanceId: string, collectionId: string, fileName: string, content: string | IIndex[]): Promise<void>;
|
|
42
54
|
/**
|
|
43
55
|
* List files in a collection.
|
|
56
|
+
* @param instanceId The instance id to list files.
|
|
44
57
|
* @param collectionId The collection id to list files.
|
|
45
58
|
* @returns The list of files.
|
|
46
59
|
*/
|
|
47
|
-
listFiles(collectionId: string): Promise<IGenerativeAIFile[]>;
|
|
60
|
+
listFiles(instanceId: string, collectionId: string): Promise<IGenerativeAIFile[]>;
|
|
48
61
|
}
|
|
@@ -6,8 +6,9 @@ export interface IAISearchConnector {
|
|
|
6
6
|
/**
|
|
7
7
|
* Searches for the query.
|
|
8
8
|
* @param query The query to search for.
|
|
9
|
+
* @param modelId The model id to use for the search.
|
|
9
10
|
* @param apiKey The API key to use for the search.
|
|
10
11
|
* @returns A promise that resolves with the search result.
|
|
11
12
|
*/
|
|
12
|
-
search(query: string): Promise<string>;
|
|
13
|
+
search(query: string, modelId: string): Promise<string>;
|
|
13
14
|
}
|
|
@@ -7,6 +7,14 @@ export interface ISearchResult {
|
|
|
7
7
|
* The content of the search result.
|
|
8
8
|
*/
|
|
9
9
|
content: string;
|
|
10
|
+
/**
|
|
11
|
+
* The start index of the search
|
|
12
|
+
*/
|
|
13
|
+
start?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The length of the search result.
|
|
16
|
+
*/
|
|
17
|
+
length?: number;
|
|
10
18
|
/**
|
|
11
19
|
* The relevance of the search result.
|
|
12
20
|
* The relevance is a number between 0 and 1, where 1 is the most relevant.
|