langchain 0.0.155 → 0.0.157

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.
Files changed (72) hide show
  1. package/chains/graph_qa/cypher.cjs +1 -0
  2. package/chains/graph_qa/cypher.d.ts +1 -0
  3. package/chains/graph_qa/cypher.js +1 -0
  4. package/chat_models/bedrock.cjs +1 -0
  5. package/chat_models/bedrock.d.ts +1 -0
  6. package/chat_models/bedrock.js +1 -0
  7. package/dist/agents/index.d.ts +12 -12
  8. package/dist/agents/toolkits/index.d.ts +2 -2
  9. package/dist/cache/upstash_redis.cjs +1 -1
  10. package/dist/cache/upstash_redis.js +1 -1
  11. package/dist/callbacks/index.d.ts +3 -3
  12. package/dist/chains/graph_qa/cypher.cjs +151 -0
  13. package/dist/chains/graph_qa/cypher.d.ts +45 -0
  14. package/dist/chains/graph_qa/cypher.js +147 -0
  15. package/dist/chains/graph_qa/prompts.cjs +34 -0
  16. package/dist/chains/graph_qa/prompts.d.ts +9 -0
  17. package/dist/chains/graph_qa/prompts.js +31 -0
  18. package/dist/chains/index.d.ts +19 -19
  19. package/dist/chains/index.js +2 -2
  20. package/dist/chains/openai_functions/index.d.ts +3 -3
  21. package/dist/chains/query_constructor/index.d.ts +1 -1
  22. package/dist/chat_models/bedrock.cjs +260 -0
  23. package/dist/chat_models/bedrock.d.ts +58 -0
  24. package/dist/chat_models/bedrock.js +254 -0
  25. package/dist/chat_models/googlevertexai/index.cjs +1 -3
  26. package/dist/chat_models/googlevertexai/index.d.ts +1 -1
  27. package/dist/chat_models/googlevertexai/index.js +0 -1
  28. package/dist/chat_models/googlevertexai/web.cjs +1 -3
  29. package/dist/chat_models/googlevertexai/web.d.ts +1 -1
  30. package/dist/chat_models/googlevertexai/web.js +0 -1
  31. package/dist/chat_models/openai.d.ts +1 -1
  32. package/dist/embeddings/cloudflare_workersai.cjs +69 -0
  33. package/dist/embeddings/cloudflare_workersai.d.ts +28 -0
  34. package/dist/embeddings/cloudflare_workersai.js +65 -0
  35. package/dist/experimental/autogpt/index.d.ts +3 -3
  36. package/dist/experimental/babyagi/index.d.ts +1 -1
  37. package/dist/experimental/plan_and_execute/index.d.ts +1 -1
  38. package/dist/graphs/neo4j_graph.cjs +112 -0
  39. package/dist/graphs/neo4j_graph.d.ts +18 -0
  40. package/dist/graphs/neo4j_graph.js +105 -0
  41. package/dist/llms/bedrock.cjs +57 -67
  42. package/dist/llms/bedrock.d.ts +8 -35
  43. package/dist/llms/bedrock.js +57 -67
  44. package/dist/llms/openai-chat.d.ts +1 -1
  45. package/dist/llms/openai.d.ts +1 -1
  46. package/dist/load/import_constants.cjs +5 -0
  47. package/dist/load/import_constants.js +5 -0
  48. package/dist/memory/index.d.ts +8 -8
  49. package/dist/memory/index.js +1 -1
  50. package/dist/output_parsers/index.d.ts +3 -3
  51. package/dist/prompts/index.d.ts +8 -8
  52. package/dist/retrievers/remote/index.d.ts +3 -3
  53. package/dist/schema/runnable/index.d.ts +3 -3
  54. package/dist/sql_db.d.ts +1 -1
  55. package/dist/tools/index.d.ts +12 -12
  56. package/dist/util/bedrock.cjs +54 -0
  57. package/dist/util/bedrock.d.ts +59 -0
  58. package/dist/util/bedrock.js +50 -0
  59. package/dist/vectorstores/cloudflare_vectorize.cjs +200 -0
  60. package/dist/vectorstores/cloudflare_vectorize.d.ts +90 -0
  61. package/dist/vectorstores/cloudflare_vectorize.js +173 -0
  62. package/dist/vectorstores/supabase.d.ts +1 -1
  63. package/embeddings/cloudflare_workersai.cjs +1 -0
  64. package/embeddings/cloudflare_workersai.d.ts +1 -0
  65. package/embeddings/cloudflare_workersai.js +1 -0
  66. package/graphs/neo4j_graph.cjs +1 -0
  67. package/graphs/neo4j_graph.d.ts +1 -0
  68. package/graphs/neo4j_graph.js +1 -0
  69. package/package.json +62 -14
  70. package/vectorstores/cloudflare_vectorize.cjs +1 -0
  71. package/vectorstores/cloudflare_vectorize.d.ts +1 -0
  72. package/vectorstores/cloudflare_vectorize.js +1 -0
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.CloudflareVectorizeStore = void 0;
27
+ const uuid = __importStar(require("uuid"));
28
+ const base_js_1 = require("./base.cjs");
29
+ const document_js_1 = require("../document.cjs");
30
+ const chunk_js_1 = require("../util/chunk.cjs");
31
+ const async_caller_js_1 = require("../util/async_caller.cjs");
32
+ /**
33
+ * Class that extends the VectorStore class and provides methods to
34
+ * interact with the Cloudflare Vectorize vector database.
35
+ */
36
+ class CloudflareVectorizeStore extends base_js_1.VectorStore {
37
+ _vectorstoreType() {
38
+ return "cloudflare_vectorize";
39
+ }
40
+ constructor(embeddings, args) {
41
+ super(embeddings, args);
42
+ Object.defineProperty(this, "textKey", {
43
+ enumerable: true,
44
+ configurable: true,
45
+ writable: true,
46
+ value: void 0
47
+ });
48
+ Object.defineProperty(this, "namespace", {
49
+ enumerable: true,
50
+ configurable: true,
51
+ writable: true,
52
+ value: void 0
53
+ });
54
+ Object.defineProperty(this, "index", {
55
+ enumerable: true,
56
+ configurable: true,
57
+ writable: true,
58
+ value: void 0
59
+ });
60
+ Object.defineProperty(this, "caller", {
61
+ enumerable: true,
62
+ configurable: true,
63
+ writable: true,
64
+ value: void 0
65
+ });
66
+ this.embeddings = embeddings;
67
+ const { index, textKey, ...asyncCallerArgs } = args;
68
+ if (!index) {
69
+ throw new Error("Must supply a Vectorize index binding, eg { index: env.VECTORIZE }");
70
+ }
71
+ this.index = index;
72
+ this.textKey = textKey ?? "text";
73
+ this.caller = new async_caller_js_1.AsyncCaller({
74
+ maxConcurrency: 6,
75
+ maxRetries: 0,
76
+ ...asyncCallerArgs,
77
+ });
78
+ }
79
+ /**
80
+ * Method that adds documents to the Vectorize database.
81
+ * @param documents Array of documents to add.
82
+ * @param options Optional ids for the documents.
83
+ * @returns Promise that resolves with the ids of the added documents.
84
+ */
85
+ async addDocuments(documents, options) {
86
+ const texts = documents.map(({ pageContent }) => pageContent);
87
+ return this.addVectors(await this.embeddings.embedDocuments(texts), documents, options);
88
+ }
89
+ /**
90
+ * Method that adds vectors to the Vectorize database.
91
+ * @param vectors Array of vectors to add.
92
+ * @param documents Array of documents associated with the vectors.
93
+ * @param options Optional ids for the vectors.
94
+ * @returns Promise that resolves with the ids of the added vectors.
95
+ */
96
+ async addVectors(vectors, documents, options) {
97
+ const ids = Array.isArray(options) ? options : options?.ids;
98
+ const documentIds = ids == null ? documents.map(() => uuid.v4()) : ids;
99
+ const vectorizeVectors = vectors.map((values, idx) => {
100
+ const metadata = {
101
+ ...documents[idx].metadata,
102
+ [this.textKey]: documents[idx].pageContent,
103
+ };
104
+ return {
105
+ id: documentIds[idx],
106
+ metadata,
107
+ values,
108
+ };
109
+ });
110
+ // Stick to a limit of 500 vectors per upsert request
111
+ const chunkSize = 500;
112
+ const chunkedVectors = (0, chunk_js_1.chunkArray)(vectorizeVectors, chunkSize);
113
+ const batchRequests = chunkedVectors.map((chunk) => this.caller.call(async () => this.index.upsert(chunk)));
114
+ await Promise.all(batchRequests);
115
+ return documentIds;
116
+ }
117
+ /**
118
+ * Method that deletes vectors from the Vectorize database.
119
+ * @param params Parameters for the delete operation.
120
+ * @returns Promise that resolves when the delete operation is complete.
121
+ */
122
+ async delete(params) {
123
+ const batchSize = 1000;
124
+ const batchedIds = (0, chunk_js_1.chunkArray)(params.ids, batchSize);
125
+ const batchRequests = batchedIds.map((batchIds) => this.caller.call(async () => this.index.deleteByIds(batchIds)));
126
+ await Promise.all(batchRequests);
127
+ }
128
+ /**
129
+ * Method that performs a similarity search in the Vectorize database and
130
+ * returns the results along with their scores.
131
+ * @param query Query vector for the similarity search.
132
+ * @param k Number of top results to return.
133
+ * @returns Promise that resolves with an array of documents and their scores.
134
+ */
135
+ async similaritySearchVectorWithScore(query, k) {
136
+ const results = await this.index.query(query, {
137
+ returnVectors: true,
138
+ topK: k,
139
+ });
140
+ const result = [];
141
+ if (results.matches) {
142
+ for (const res of results.matches) {
143
+ const { [this.textKey]: pageContent, ...metadata } = res.vector?.metadata ?? {};
144
+ result.push([
145
+ new document_js_1.Document({ metadata, pageContent: pageContent }),
146
+ res.score,
147
+ ]);
148
+ }
149
+ }
150
+ return result;
151
+ }
152
+ /**
153
+ * Static method that creates a new instance of the CloudflareVectorizeStore class
154
+ * from texts.
155
+ * @param texts Array of texts to add to the Vectorize database.
156
+ * @param metadatas Metadata associated with the texts.
157
+ * @param embeddings Embeddings to use for the texts.
158
+ * @param dbConfig Configuration for the Vectorize database.
159
+ * @param options Optional ids for the vectors.
160
+ * @returns Promise that resolves with a new instance of the CloudflareVectorizeStore class.
161
+ */
162
+ static async fromTexts(texts, metadatas, embeddings, dbConfig) {
163
+ const docs = [];
164
+ for (let i = 0; i < texts.length; i += 1) {
165
+ const metadata = Array.isArray(metadatas) ? metadatas[i] : metadatas;
166
+ const newDoc = new document_js_1.Document({
167
+ pageContent: texts[i],
168
+ metadata,
169
+ });
170
+ docs.push(newDoc);
171
+ }
172
+ return CloudflareVectorizeStore.fromDocuments(docs, embeddings, dbConfig);
173
+ }
174
+ /**
175
+ * Static method that creates a new instance of the CloudflareVectorizeStore class
176
+ * from documents.
177
+ * @param docs Array of documents to add to the Vectorize database.
178
+ * @param embeddings Embeddings to use for the documents.
179
+ * @param dbConfig Configuration for the Vectorize database.
180
+ * @param options Optional ids for the vectors.
181
+ * @returns Promise that resolves with a new instance of the CloudflareVectorizeStore class.
182
+ */
183
+ static async fromDocuments(docs, embeddings, dbConfig) {
184
+ const instance = new this(embeddings, dbConfig);
185
+ await instance.addDocuments(docs);
186
+ return instance;
187
+ }
188
+ /**
189
+ * Static method that creates a new instance of the CloudflareVectorizeStore class
190
+ * from an existing index.
191
+ * @param embeddings Embeddings to use for the documents.
192
+ * @param dbConfig Configuration for the Vectorize database.
193
+ * @returns Promise that resolves with a new instance of the CloudflareVectorizeStore class.
194
+ */
195
+ static async fromExistingIndex(embeddings, dbConfig) {
196
+ const instance = new this(embeddings, dbConfig);
197
+ return instance;
198
+ }
199
+ }
200
+ exports.CloudflareVectorizeStore = CloudflareVectorizeStore;
@@ -0,0 +1,90 @@
1
+ import { VectorizeIndex, VectorizeVectorMetadata } from "@cloudflare/workers-types";
2
+ import { VectorStore } from "./base.js";
3
+ import { Embeddings } from "../embeddings/base.js";
4
+ import { Document } from "../document.js";
5
+ import { AsyncCaller, type AsyncCallerParams } from "../util/async_caller.js";
6
+ export interface VectorizeLibArgs extends AsyncCallerParams {
7
+ index: VectorizeIndex;
8
+ textKey?: string;
9
+ }
10
+ /**
11
+ * Type that defines the parameters for the delete operation in the
12
+ * CloudflareVectorizeStore class. It includes ids, deleteAll flag, and namespace.
13
+ */
14
+ export type VectorizeDeleteParams = {
15
+ ids: string[];
16
+ };
17
+ /**
18
+ * Class that extends the VectorStore class and provides methods to
19
+ * interact with the Cloudflare Vectorize vector database.
20
+ */
21
+ export declare class CloudflareVectorizeStore extends VectorStore {
22
+ textKey: string;
23
+ namespace?: string;
24
+ index: VectorizeIndex;
25
+ caller: AsyncCaller;
26
+ _vectorstoreType(): string;
27
+ constructor(embeddings: Embeddings, args: VectorizeLibArgs);
28
+ /**
29
+ * Method that adds documents to the Vectorize database.
30
+ * @param documents Array of documents to add.
31
+ * @param options Optional ids for the documents.
32
+ * @returns Promise that resolves with the ids of the added documents.
33
+ */
34
+ addDocuments(documents: Document[], options?: {
35
+ ids?: string[];
36
+ } | string[]): Promise<string[]>;
37
+ /**
38
+ * Method that adds vectors to the Vectorize database.
39
+ * @param vectors Array of vectors to add.
40
+ * @param documents Array of documents associated with the vectors.
41
+ * @param options Optional ids for the vectors.
42
+ * @returns Promise that resolves with the ids of the added vectors.
43
+ */
44
+ addVectors(vectors: number[][], documents: Document[], options?: {
45
+ ids?: string[];
46
+ } | string[]): Promise<string[]>;
47
+ /**
48
+ * Method that deletes vectors from the Vectorize database.
49
+ * @param params Parameters for the delete operation.
50
+ * @returns Promise that resolves when the delete operation is complete.
51
+ */
52
+ delete(params: VectorizeDeleteParams): Promise<void>;
53
+ /**
54
+ * Method that performs a similarity search in the Vectorize database and
55
+ * returns the results along with their scores.
56
+ * @param query Query vector for the similarity search.
57
+ * @param k Number of top results to return.
58
+ * @returns Promise that resolves with an array of documents and their scores.
59
+ */
60
+ similaritySearchVectorWithScore(query: number[], k: number): Promise<[Document, number][]>;
61
+ /**
62
+ * Static method that creates a new instance of the CloudflareVectorizeStore class
63
+ * from texts.
64
+ * @param texts Array of texts to add to the Vectorize database.
65
+ * @param metadatas Metadata associated with the texts.
66
+ * @param embeddings Embeddings to use for the texts.
67
+ * @param dbConfig Configuration for the Vectorize database.
68
+ * @param options Optional ids for the vectors.
69
+ * @returns Promise that resolves with a new instance of the CloudflareVectorizeStore class.
70
+ */
71
+ static fromTexts(texts: string[], metadatas: Record<string, VectorizeVectorMetadata>[] | Record<string, VectorizeVectorMetadata>, embeddings: Embeddings, dbConfig: VectorizeLibArgs): Promise<CloudflareVectorizeStore>;
72
+ /**
73
+ * Static method that creates a new instance of the CloudflareVectorizeStore class
74
+ * from documents.
75
+ * @param docs Array of documents to add to the Vectorize database.
76
+ * @param embeddings Embeddings to use for the documents.
77
+ * @param dbConfig Configuration for the Vectorize database.
78
+ * @param options Optional ids for the vectors.
79
+ * @returns Promise that resolves with a new instance of the CloudflareVectorizeStore class.
80
+ */
81
+ static fromDocuments(docs: Document[], embeddings: Embeddings, dbConfig: VectorizeLibArgs): Promise<CloudflareVectorizeStore>;
82
+ /**
83
+ * Static method that creates a new instance of the CloudflareVectorizeStore class
84
+ * from an existing index.
85
+ * @param embeddings Embeddings to use for the documents.
86
+ * @param dbConfig Configuration for the Vectorize database.
87
+ * @returns Promise that resolves with a new instance of the CloudflareVectorizeStore class.
88
+ */
89
+ static fromExistingIndex(embeddings: Embeddings, dbConfig: VectorizeLibArgs): Promise<CloudflareVectorizeStore>;
90
+ }
@@ -0,0 +1,173 @@
1
+ import * as uuid from "uuid";
2
+ import { VectorStore } from "./base.js";
3
+ import { Document } from "../document.js";
4
+ import { chunkArray } from "../util/chunk.js";
5
+ import { AsyncCaller } from "../util/async_caller.js";
6
+ /**
7
+ * Class that extends the VectorStore class and provides methods to
8
+ * interact with the Cloudflare Vectorize vector database.
9
+ */
10
+ export class CloudflareVectorizeStore extends VectorStore {
11
+ _vectorstoreType() {
12
+ return "cloudflare_vectorize";
13
+ }
14
+ constructor(embeddings, args) {
15
+ super(embeddings, args);
16
+ Object.defineProperty(this, "textKey", {
17
+ enumerable: true,
18
+ configurable: true,
19
+ writable: true,
20
+ value: void 0
21
+ });
22
+ Object.defineProperty(this, "namespace", {
23
+ enumerable: true,
24
+ configurable: true,
25
+ writable: true,
26
+ value: void 0
27
+ });
28
+ Object.defineProperty(this, "index", {
29
+ enumerable: true,
30
+ configurable: true,
31
+ writable: true,
32
+ value: void 0
33
+ });
34
+ Object.defineProperty(this, "caller", {
35
+ enumerable: true,
36
+ configurable: true,
37
+ writable: true,
38
+ value: void 0
39
+ });
40
+ this.embeddings = embeddings;
41
+ const { index, textKey, ...asyncCallerArgs } = args;
42
+ if (!index) {
43
+ throw new Error("Must supply a Vectorize index binding, eg { index: env.VECTORIZE }");
44
+ }
45
+ this.index = index;
46
+ this.textKey = textKey ?? "text";
47
+ this.caller = new AsyncCaller({
48
+ maxConcurrency: 6,
49
+ maxRetries: 0,
50
+ ...asyncCallerArgs,
51
+ });
52
+ }
53
+ /**
54
+ * Method that adds documents to the Vectorize database.
55
+ * @param documents Array of documents to add.
56
+ * @param options Optional ids for the documents.
57
+ * @returns Promise that resolves with the ids of the added documents.
58
+ */
59
+ async addDocuments(documents, options) {
60
+ const texts = documents.map(({ pageContent }) => pageContent);
61
+ return this.addVectors(await this.embeddings.embedDocuments(texts), documents, options);
62
+ }
63
+ /**
64
+ * Method that adds vectors to the Vectorize database.
65
+ * @param vectors Array of vectors to add.
66
+ * @param documents Array of documents associated with the vectors.
67
+ * @param options Optional ids for the vectors.
68
+ * @returns Promise that resolves with the ids of the added vectors.
69
+ */
70
+ async addVectors(vectors, documents, options) {
71
+ const ids = Array.isArray(options) ? options : options?.ids;
72
+ const documentIds = ids == null ? documents.map(() => uuid.v4()) : ids;
73
+ const vectorizeVectors = vectors.map((values, idx) => {
74
+ const metadata = {
75
+ ...documents[idx].metadata,
76
+ [this.textKey]: documents[idx].pageContent,
77
+ };
78
+ return {
79
+ id: documentIds[idx],
80
+ metadata,
81
+ values,
82
+ };
83
+ });
84
+ // Stick to a limit of 500 vectors per upsert request
85
+ const chunkSize = 500;
86
+ const chunkedVectors = chunkArray(vectorizeVectors, chunkSize);
87
+ const batchRequests = chunkedVectors.map((chunk) => this.caller.call(async () => this.index.upsert(chunk)));
88
+ await Promise.all(batchRequests);
89
+ return documentIds;
90
+ }
91
+ /**
92
+ * Method that deletes vectors from the Vectorize database.
93
+ * @param params Parameters for the delete operation.
94
+ * @returns Promise that resolves when the delete operation is complete.
95
+ */
96
+ async delete(params) {
97
+ const batchSize = 1000;
98
+ const batchedIds = chunkArray(params.ids, batchSize);
99
+ const batchRequests = batchedIds.map((batchIds) => this.caller.call(async () => this.index.deleteByIds(batchIds)));
100
+ await Promise.all(batchRequests);
101
+ }
102
+ /**
103
+ * Method that performs a similarity search in the Vectorize database and
104
+ * returns the results along with their scores.
105
+ * @param query Query vector for the similarity search.
106
+ * @param k Number of top results to return.
107
+ * @returns Promise that resolves with an array of documents and their scores.
108
+ */
109
+ async similaritySearchVectorWithScore(query, k) {
110
+ const results = await this.index.query(query, {
111
+ returnVectors: true,
112
+ topK: k,
113
+ });
114
+ const result = [];
115
+ if (results.matches) {
116
+ for (const res of results.matches) {
117
+ const { [this.textKey]: pageContent, ...metadata } = res.vector?.metadata ?? {};
118
+ result.push([
119
+ new Document({ metadata, pageContent: pageContent }),
120
+ res.score,
121
+ ]);
122
+ }
123
+ }
124
+ return result;
125
+ }
126
+ /**
127
+ * Static method that creates a new instance of the CloudflareVectorizeStore class
128
+ * from texts.
129
+ * @param texts Array of texts to add to the Vectorize database.
130
+ * @param metadatas Metadata associated with the texts.
131
+ * @param embeddings Embeddings to use for the texts.
132
+ * @param dbConfig Configuration for the Vectorize database.
133
+ * @param options Optional ids for the vectors.
134
+ * @returns Promise that resolves with a new instance of the CloudflareVectorizeStore class.
135
+ */
136
+ static async fromTexts(texts, metadatas, embeddings, dbConfig) {
137
+ const docs = [];
138
+ for (let i = 0; i < texts.length; i += 1) {
139
+ const metadata = Array.isArray(metadatas) ? metadatas[i] : metadatas;
140
+ const newDoc = new Document({
141
+ pageContent: texts[i],
142
+ metadata,
143
+ });
144
+ docs.push(newDoc);
145
+ }
146
+ return CloudflareVectorizeStore.fromDocuments(docs, embeddings, dbConfig);
147
+ }
148
+ /**
149
+ * Static method that creates a new instance of the CloudflareVectorizeStore class
150
+ * from documents.
151
+ * @param docs Array of documents to add to the Vectorize database.
152
+ * @param embeddings Embeddings to use for the documents.
153
+ * @param dbConfig Configuration for the Vectorize database.
154
+ * @param options Optional ids for the vectors.
155
+ * @returns Promise that resolves with a new instance of the CloudflareVectorizeStore class.
156
+ */
157
+ static async fromDocuments(docs, embeddings, dbConfig) {
158
+ const instance = new this(embeddings, dbConfig);
159
+ await instance.addDocuments(docs);
160
+ return instance;
161
+ }
162
+ /**
163
+ * Static method that creates a new instance of the CloudflareVectorizeStore class
164
+ * from an existing index.
165
+ * @param embeddings Embeddings to use for the documents.
166
+ * @param dbConfig Configuration for the Vectorize database.
167
+ * @returns Promise that resolves with a new instance of the CloudflareVectorizeStore class.
168
+ */
169
+ static async fromExistingIndex(embeddings, dbConfig) {
170
+ const instance = new this(embeddings, dbConfig);
171
+ return instance;
172
+ }
173
+ }
@@ -54,7 +54,7 @@ export declare class SupabaseVectorStore extends VectorStore {
54
54
  * @returns A promise that resolves when the vectors have been deleted.
55
55
  */
56
56
  delete(params: {
57
- ids: string[];
57
+ ids: string[] | number[];
58
58
  }): Promise<void>;
59
59
  /**
60
60
  * Performs a similarity search on the vector store.
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/embeddings/cloudflare_workersai.cjs');
@@ -0,0 +1 @@
1
+ export * from '../dist/embeddings/cloudflare_workersai.js'
@@ -0,0 +1 @@
1
+ export * from '../dist/embeddings/cloudflare_workersai.js'
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/graphs/neo4j_graph.cjs');
@@ -0,0 +1 @@
1
+ export * from '../dist/graphs/neo4j_graph.js'
@@ -0,0 +1 @@
1
+ export * from '../dist/graphs/neo4j_graph.js'