@sweetoburrito/backstage-plugin-ai-assistant-node 0.5.0 → 0.5.1
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/index.d.ts +10 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,11 +5,17 @@ import { ZodType, z } from 'zod';
|
|
|
5
5
|
import { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
6
6
|
|
|
7
7
|
type EmbeddingsSource = string;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Metadata that is required for each document to be embedded.
|
|
10
|
+
* - `source`: The source of the document, e.g. 'github', 'azure-devops', etc.
|
|
11
|
+
* - `id`: A unique identifier for the document within the source. Does not necessarily need to be globally unique or a UUID.
|
|
12
|
+
* Additional metadata can be added as needed.
|
|
13
|
+
*/
|
|
14
|
+
type EmbeddingDocumentMetadata = {
|
|
9
15
|
source: EmbeddingsSource;
|
|
10
16
|
id: string;
|
|
11
17
|
[key: string]: string;
|
|
12
|
-
}
|
|
18
|
+
};
|
|
13
19
|
type Embedding = {
|
|
14
20
|
metadata: EmbeddingDocumentMetadata;
|
|
15
21
|
content: string;
|
|
@@ -22,13 +28,13 @@ type EmbeddingDocument = {
|
|
|
22
28
|
};
|
|
23
29
|
type DeletionParams = {
|
|
24
30
|
ids?: string[];
|
|
25
|
-
filter?: EmbeddingDocumentMetadata
|
|
31
|
+
filter?: Partial<EmbeddingDocumentMetadata>;
|
|
26
32
|
};
|
|
27
33
|
interface VectorStore {
|
|
28
34
|
connectEmbeddings(embeddings: Embeddings): void;
|
|
29
35
|
addDocuments(docs: EmbeddingDocument[]): Promise<void>;
|
|
30
36
|
deleteDocuments(deletionParams: DeletionParams): Promise<void>;
|
|
31
|
-
similaritySearch(query: string, filter?: EmbeddingDocumentMetadata
|
|
37
|
+
similaritySearch(query: string, filter?: Partial<EmbeddingDocumentMetadata>, amount?: number): Promise<EmbeddingDocument[]>;
|
|
32
38
|
}
|
|
33
39
|
type EntityFilterShape = Record<string, string | symbol | (string | symbol)[]>[] | Record<string, string | symbol | (string | symbol)[]> | undefined;
|
|
34
40
|
interface AugmentationIndexer {
|