langchain 0.0.167 → 0.0.168

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 (58) hide show
  1. package/README.md +4 -4
  2. package/chat_models/cloudflare_workersai.cjs +1 -0
  3. package/chat_models/cloudflare_workersai.d.ts +1 -0
  4. package/chat_models/cloudflare_workersai.js +1 -0
  5. package/chat_models/fake.cjs +1 -0
  6. package/chat_models/fake.d.ts +1 -0
  7. package/chat_models/fake.js +1 -0
  8. package/dist/agents/chat/index.cjs +3 -2
  9. package/dist/agents/chat/index.d.ts +3 -0
  10. package/dist/agents/chat/index.js +3 -2
  11. package/dist/chat_models/cloudflare_workersai.cjs +140 -0
  12. package/dist/chat_models/cloudflare_workersai.d.ts +46 -0
  13. package/dist/chat_models/cloudflare_workersai.js +136 -0
  14. package/dist/chat_models/fake.cjs +101 -0
  15. package/dist/chat_models/fake.d.ts +36 -0
  16. package/dist/chat_models/fake.js +97 -0
  17. package/dist/llms/cloudflare_workersai.cjs +117 -0
  18. package/dist/llms/cloudflare_workersai.d.ts +49 -0
  19. package/dist/llms/cloudflare_workersai.js +113 -0
  20. package/dist/llms/fake.cjs +82 -0
  21. package/dist/llms/fake.d.ts +31 -0
  22. package/dist/llms/fake.js +78 -0
  23. package/dist/llms/sagemaker_endpoint.cjs +9 -7
  24. package/dist/llms/sagemaker_endpoint.d.ts +3 -3
  25. package/dist/llms/sagemaker_endpoint.js +9 -7
  26. package/dist/load/import_constants.cjs +2 -0
  27. package/dist/load/import_constants.js +2 -0
  28. package/dist/load/import_map.cjs +6 -2
  29. package/dist/load/import_map.d.ts +4 -0
  30. package/dist/load/import_map.js +4 -0
  31. package/dist/util/axios-fetch-adapter.cjs +1 -1
  32. package/dist/util/axios-fetch-adapter.js +1 -1
  33. package/dist/util/env.cjs +1 -1
  34. package/dist/util/env.js +1 -1
  35. package/dist/util/event-source-parse.cjs +1 -1
  36. package/dist/util/event-source-parse.js +1 -1
  37. package/dist/vectorstores/closevector/common.cjs +128 -0
  38. package/dist/vectorstores/closevector/common.d.ts +82 -0
  39. package/dist/vectorstores/closevector/common.js +124 -0
  40. package/dist/vectorstores/closevector/node.cjs +109 -0
  41. package/dist/vectorstores/closevector/node.d.ts +83 -0
  42. package/dist/vectorstores/closevector/node.js +105 -0
  43. package/dist/vectorstores/closevector/web.cjs +109 -0
  44. package/dist/vectorstores/closevector/web.d.ts +80 -0
  45. package/dist/vectorstores/closevector/web.js +105 -0
  46. package/llms/cloudflare_workersai.cjs +1 -0
  47. package/llms/cloudflare_workersai.d.ts +1 -0
  48. package/llms/cloudflare_workersai.js +1 -0
  49. package/llms/fake.cjs +1 -0
  50. package/llms/fake.d.ts +1 -0
  51. package/llms/fake.js +1 -0
  52. package/package.json +68 -5
  53. package/vectorstores/closevector/node.cjs +1 -0
  54. package/vectorstores/closevector/node.d.ts +1 -0
  55. package/vectorstores/closevector/node.js +1 -0
  56. package/vectorstores/closevector/web.cjs +1 -0
  57. package/vectorstores/closevector/web.d.ts +1 -0
  58. package/vectorstores/closevector/web.js +1 -0
@@ -0,0 +1,105 @@
1
+ import { CloseVectorHNSWNode, } from "closevector-node";
2
+ import { CloseVector } from "./common.js";
3
+ /**
4
+ * Class that implements a vector store using Hierarchical Navigable Small
5
+ * World (HNSW) graphs. It extends the SaveableVectorStore class and
6
+ * provides methods for adding documents and vectors, performing
7
+ * similarity searches, and saving and loading the vector store.
8
+ */
9
+ export class CloseVectorNode extends CloseVector {
10
+ constructor(embeddings, args, credentials) {
11
+ super(embeddings, args, credentials);
12
+ if (args.instance) {
13
+ this.instance = args.instance;
14
+ }
15
+ else {
16
+ this.instance = new CloseVectorHNSWNode(embeddings, args);
17
+ }
18
+ if (this.credentials?.key) {
19
+ this.instance.accessKey = this.credentials.key;
20
+ }
21
+ if (this.credentials?.secret) {
22
+ this.instance.secret = this.credentials.secret;
23
+ }
24
+ }
25
+ /**
26
+ * Method to save the index to the CloseVector CDN.
27
+ * @param options
28
+ * @param options.description A description of the index.
29
+ * @param options.public Whether the index should be public or private. Defaults to false.
30
+ * @param options.uuid A UUID for the index. If not provided, a new index will be created.
31
+ * @param options.onProgress A callback function that will be called with the progress of the upload.
32
+ */
33
+ async saveToCloud(options) {
34
+ await this.instance.saveToCloud(options);
35
+ }
36
+ /**
37
+ * Method to load the index from the CloseVector CDN.
38
+ * @param options
39
+ * @param options.uuid The UUID of the index to be downloaded.
40
+ * @param options.credentials The credentials to be used by the CloseVectorNode instance.
41
+ * @param options.embeddings The embeddings to be used by the CloseVectorNode instance.
42
+ * @param options.onProgress A callback function that will be called with the progress of the download.
43
+ */
44
+ static async loadFromCloud(options) {
45
+ if (!options.credentials.key || !options.credentials.secret) {
46
+ throw new Error("key and secret must be provided");
47
+ }
48
+ const instance = await CloseVectorHNSWNode.loadFromCloud({
49
+ ...options,
50
+ accessKey: options.credentials.key,
51
+ secret: options.credentials.secret,
52
+ });
53
+ const vectorstore = new this(options.embeddings, instance.args, options.credentials);
54
+ return vectorstore;
55
+ }
56
+ /**
57
+ * Static method to load a vector store from a directory. It reads the
58
+ * HNSW index, the arguments, and the document store from the directory,
59
+ * then creates a new HNSWLib instance with these values.
60
+ * @param directory The directory from which to load the vector store.
61
+ * @param embeddings The embeddings to be used by the CloseVectorNode instance.
62
+ * @returns A Promise that resolves to a new CloseVectorNode instance.
63
+ */
64
+ static async load(directory, embeddings, credentials) {
65
+ const instance = await CloseVectorHNSWNode.load(directory, embeddings);
66
+ const vectorstore = new this(embeddings, instance.args, credentials);
67
+ return vectorstore;
68
+ }
69
+ /**
70
+ * Static method to create a new CloseVectorWeb instance from texts and metadata.
71
+ * It creates a new Document instance for each text and metadata, then
72
+ * calls the fromDocuments method to create the CloseVectorWeb instance.
73
+ * @param texts The texts to be used to create the documents.
74
+ * @param metadatas The metadata to be used to create the documents.
75
+ * @param embeddings The embeddings to be used by the CloseVectorWeb instance.
76
+ * @param args An optional configuration object for the CloseVectorWeb instance.
77
+ * @param credential An optional credential object for the CloseVector API.
78
+ * @returns A Promise that resolves to a new CloseVectorWeb instance.
79
+ */
80
+ static async fromTexts(texts, metadatas, embeddings, args, credential) {
81
+ const docs = CloseVector.textsToDocuments(texts, metadatas);
82
+ return await CloseVectorNode.fromDocuments(docs, embeddings, args, credential);
83
+ }
84
+ /**
85
+ * Static method to create a new CloseVectorNode instance from documents. It
86
+ * creates a new CloseVectorNode instance, adds the documents to it, then returns
87
+ * the instance.
88
+ * @param docs The documents to be added to the HNSWLib instance.
89
+ * @param embeddings The embeddings to be used by the HNSWLib instance.
90
+ * @param args An optional configuration object for the HNSWLib instance.
91
+ * @param credentials An optional credential object for the CloseVector API.
92
+ * @returns A Promise that resolves to a new CloseVectorNode instance.
93
+ */
94
+ static async fromDocuments(docs, embeddings, args, credentials) {
95
+ const _args = args || {
96
+ space: "cosine",
97
+ };
98
+ const instance = new this(embeddings, _args, credentials);
99
+ await instance.addDocuments(docs);
100
+ return instance;
101
+ }
102
+ static async imports() {
103
+ return CloseVectorHNSWNode.imports();
104
+ }
105
+ }
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CloseVectorWeb = void 0;
4
+ const closevector_web_1 = require("closevector-web");
5
+ const common_js_1 = require("./common.cjs");
6
+ const document_js_1 = require("../../document.cjs");
7
+ /**
8
+ * Class that implements a vector store using CloseVector, It extends the SaveableVectorStore class and
9
+ * provides methods for adding documents and vectors, performing
10
+ * similarity searches, and saving and loading the vector store.
11
+ */
12
+ class CloseVectorWeb extends common_js_1.CloseVector {
13
+ constructor(embeddings, args, credentials) {
14
+ super(embeddings, args, credentials);
15
+ if (args.instance) {
16
+ this.instance = args.instance;
17
+ }
18
+ else {
19
+ this.instance = new closevector_web_1.CloseVectorHNSWWeb(embeddings, args);
20
+ }
21
+ }
22
+ /**
23
+ * Method to save the index to the CloseVector CDN.
24
+ * @param options
25
+ * @param options.url the upload url generated by the CloseVector API: https://closevector-docs.getmegaportal.com/docs/api/http-api/file-url
26
+ * @param options.onProgress a callback function to track the upload progress
27
+ */
28
+ async saveToCloud(options) {
29
+ if (!this.instance.uuid && !options.uuid) {
30
+ throw new Error("No uuid provided");
31
+ }
32
+ if (!this.instance.uuid) {
33
+ this.instance._uuid = options.uuid;
34
+ }
35
+ await this.save(this.instance.uuid);
36
+ await this.instance.saveToCloud(options);
37
+ }
38
+ /**
39
+ * Method to load the index from the CloseVector CDN.
40
+ * @param options
41
+ * @param options.url the upload url generated by the CloseVector API: https://closevector-docs.getmegaportal.com/docs/api/http-api/file-url
42
+ * @param options.onProgress a callback function to track the upload progress
43
+ * @param options.uuid the uuid of the index to be downloaded
44
+ * @param options.embeddings the embeddings to be used by the CloseVectorWeb instance
45
+ */
46
+ static async loadFromCloud(options) {
47
+ const instance = await closevector_web_1.CloseVectorHNSWWeb.loadFromCloud(options);
48
+ const vectorstore = new this(options.embeddings, instance.args, options.credentials);
49
+ return vectorstore;
50
+ }
51
+ /**
52
+ * Static method to load a vector store from a directory. It reads the
53
+ * HNSW index, the arguments, and the document store from the directory,
54
+ * then creates a new CloseVectorWeb instance with these values.
55
+ * @param directory The directory from which to load the vector store.
56
+ * @param embeddings The embeddings to be used by the CloseVectorWeb instance.
57
+ * @returns A Promise that resolves to a new CloseVectorWeb instance.
58
+ */
59
+ static async load(directory, embeddings, credentials) {
60
+ const instance = await closevector_web_1.CloseVectorHNSWWeb.load(directory, embeddings);
61
+ const vectorstore = new this(embeddings, instance.args, credentials);
62
+ return vectorstore;
63
+ }
64
+ /**
65
+ * Static method to create a new CloseVectorWeb instance from texts and metadata.
66
+ * It creates a new Document instance for each text and metadata, then
67
+ * calls the fromDocuments method to create the CloseVectorWeb instance.
68
+ * @param texts The texts to be used to create the documents.
69
+ * @param metadatas The metadata to be used to create the documents.
70
+ * @param embeddings The embeddings to be used by the CloseVectorWeb instance.
71
+ * @param args An optional configuration object for the CloseVectorWeb instance.
72
+ * @param credential An optional credential object for the CloseVector API.
73
+ * @returns A Promise that resolves to a new CloseVectorWeb instance.
74
+ */
75
+ static async fromTexts(texts, metadatas, embeddings, args, credential) {
76
+ const docs = [];
77
+ for (let i = 0; i < texts.length; i += 1) {
78
+ const metadata = Array.isArray(metadatas) ? metadatas[i] : metadatas;
79
+ const newDoc = new document_js_1.Document({
80
+ pageContent: texts[i],
81
+ metadata,
82
+ });
83
+ docs.push(newDoc);
84
+ }
85
+ return await CloseVectorWeb.fromDocuments(docs, embeddings, args, credential);
86
+ }
87
+ /**
88
+ * Static method to create a new CloseVectorWeb instance from documents. It
89
+ * creates a new CloseVectorWeb instance, adds the documents to it, then returns
90
+ * the instance.
91
+ * @param docs The documents to be added to the CloseVectorWeb instance.
92
+ * @param embeddings The embeddings to be used by the CloseVectorWeb instance.
93
+ * @param args An optional configuration object for the CloseVectorWeb instance.
94
+ * @param credentials An optional credential object for the CloseVector API.
95
+ * @returns A Promise that resolves to a new CloseVectorWeb instance.
96
+ */
97
+ static async fromDocuments(docs, embeddings, args, credentials) {
98
+ const _args = args || {
99
+ space: "cosine",
100
+ };
101
+ const instance = new this(embeddings, _args, credentials);
102
+ await instance.addDocuments(docs);
103
+ return instance;
104
+ }
105
+ static async imports() {
106
+ return closevector_web_1.CloseVectorHNSWWeb.imports();
107
+ }
108
+ }
109
+ exports.CloseVectorWeb = CloseVectorWeb;
@@ -0,0 +1,80 @@
1
+ import { CloseVectorHNSWWeb, HierarchicalNSWT, CloseVectorHNSWLibArgs, CloseVectorCredentials, HnswlibModule } from "closevector-web";
2
+ import { CloseVector } from "./common.js";
3
+ import { Embeddings } from "../../embeddings/base.js";
4
+ import { Document } from "../../document.js";
5
+ /**
6
+ * package closevector-node is largely based on hnswlib.ts in the current folder with the following exceptions:
7
+ * 1. It uses a modified version of hnswlib-node to ensure the generated index can be loaded by closevector_web.ts.
8
+ * 2. It adds features to upload and download the index to/from the CDN provided by CloseVector.
9
+ *
10
+ * For more information, check out https://closevector-docs.getmegaportal.com/
11
+ */
12
+ /**
13
+ * Arguments for creating a CloseVectorWeb instance, extending CloseVectorHNSWLibArgs.
14
+ */
15
+ export interface CloseVectorWebArgs extends CloseVectorHNSWLibArgs<HierarchicalNSWT> {
16
+ instance?: CloseVectorHNSWWeb;
17
+ }
18
+ /**
19
+ * Class that implements a vector store using CloseVector, It extends the SaveableVectorStore class and
20
+ * provides methods for adding documents and vectors, performing
21
+ * similarity searches, and saving and loading the vector store.
22
+ */
23
+ export declare class CloseVectorWeb extends CloseVector<CloseVectorHNSWWeb> {
24
+ FilterType: (doc: Document) => boolean;
25
+ constructor(embeddings: Embeddings, args: CloseVectorWebArgs, credentials?: CloseVectorCredentials);
26
+ /**
27
+ * Method to save the index to the CloseVector CDN.
28
+ * @param options
29
+ * @param options.url the upload url generated by the CloseVector API: https://closevector-docs.getmegaportal.com/docs/api/http-api/file-url
30
+ * @param options.onProgress a callback function to track the upload progress
31
+ */
32
+ saveToCloud(options: Parameters<typeof this.instance.saveToCloud>[0] & {
33
+ uuid?: string;
34
+ }): Promise<void>;
35
+ /**
36
+ * Method to load the index from the CloseVector CDN.
37
+ * @param options
38
+ * @param options.url the upload url generated by the CloseVector API: https://closevector-docs.getmegaportal.com/docs/api/http-api/file-url
39
+ * @param options.onProgress a callback function to track the upload progress
40
+ * @param options.uuid the uuid of the index to be downloaded
41
+ * @param options.embeddings the embeddings to be used by the CloseVectorWeb instance
42
+ */
43
+ static loadFromCloud(options: Parameters<typeof CloseVectorHNSWWeb.loadFromCloud>[0] & {
44
+ embeddings: Embeddings;
45
+ credentials?: CloseVectorCredentials;
46
+ }): Promise<CloseVectorWeb>;
47
+ /**
48
+ * Static method to load a vector store from a directory. It reads the
49
+ * HNSW index, the arguments, and the document store from the directory,
50
+ * then creates a new CloseVectorWeb instance with these values.
51
+ * @param directory The directory from which to load the vector store.
52
+ * @param embeddings The embeddings to be used by the CloseVectorWeb instance.
53
+ * @returns A Promise that resolves to a new CloseVectorWeb instance.
54
+ */
55
+ static load(directory: string, embeddings: Embeddings, credentials?: CloseVectorCredentials): Promise<CloseVectorWeb>;
56
+ /**
57
+ * Static method to create a new CloseVectorWeb instance from texts and metadata.
58
+ * It creates a new Document instance for each text and metadata, then
59
+ * calls the fromDocuments method to create the CloseVectorWeb instance.
60
+ * @param texts The texts to be used to create the documents.
61
+ * @param metadatas The metadata to be used to create the documents.
62
+ * @param embeddings The embeddings to be used by the CloseVectorWeb instance.
63
+ * @param args An optional configuration object for the CloseVectorWeb instance.
64
+ * @param credential An optional credential object for the CloseVector API.
65
+ * @returns A Promise that resolves to a new CloseVectorWeb instance.
66
+ */
67
+ static fromTexts(texts: string[], metadatas: object[] | object, embeddings: Embeddings, args?: Record<string, unknown>, credential?: CloseVectorCredentials): Promise<CloseVectorWeb>;
68
+ /**
69
+ * Static method to create a new CloseVectorWeb instance from documents. It
70
+ * creates a new CloseVectorWeb instance, adds the documents to it, then returns
71
+ * the instance.
72
+ * @param docs The documents to be added to the CloseVectorWeb instance.
73
+ * @param embeddings The embeddings to be used by the CloseVectorWeb instance.
74
+ * @param args An optional configuration object for the CloseVectorWeb instance.
75
+ * @param credentials An optional credential object for the CloseVector API.
76
+ * @returns A Promise that resolves to a new CloseVectorWeb instance.
77
+ */
78
+ static fromDocuments(docs: Document[], embeddings: Embeddings, args?: Record<string, unknown>, credentials?: CloseVectorCredentials): Promise<CloseVectorWeb>;
79
+ static imports(): Promise<HnswlibModule>;
80
+ }
@@ -0,0 +1,105 @@
1
+ import { CloseVectorHNSWWeb, } from "closevector-web";
2
+ import { CloseVector } from "./common.js";
3
+ import { Document } from "../../document.js";
4
+ /**
5
+ * Class that implements a vector store using CloseVector, It extends the SaveableVectorStore class and
6
+ * provides methods for adding documents and vectors, performing
7
+ * similarity searches, and saving and loading the vector store.
8
+ */
9
+ export class CloseVectorWeb extends CloseVector {
10
+ constructor(embeddings, args, credentials) {
11
+ super(embeddings, args, credentials);
12
+ if (args.instance) {
13
+ this.instance = args.instance;
14
+ }
15
+ else {
16
+ this.instance = new CloseVectorHNSWWeb(embeddings, args);
17
+ }
18
+ }
19
+ /**
20
+ * Method to save the index to the CloseVector CDN.
21
+ * @param options
22
+ * @param options.url the upload url generated by the CloseVector API: https://closevector-docs.getmegaportal.com/docs/api/http-api/file-url
23
+ * @param options.onProgress a callback function to track the upload progress
24
+ */
25
+ async saveToCloud(options) {
26
+ if (!this.instance.uuid && !options.uuid) {
27
+ throw new Error("No uuid provided");
28
+ }
29
+ if (!this.instance.uuid) {
30
+ this.instance._uuid = options.uuid;
31
+ }
32
+ await this.save(this.instance.uuid);
33
+ await this.instance.saveToCloud(options);
34
+ }
35
+ /**
36
+ * Method to load the index from the CloseVector CDN.
37
+ * @param options
38
+ * @param options.url the upload url generated by the CloseVector API: https://closevector-docs.getmegaportal.com/docs/api/http-api/file-url
39
+ * @param options.onProgress a callback function to track the upload progress
40
+ * @param options.uuid the uuid of the index to be downloaded
41
+ * @param options.embeddings the embeddings to be used by the CloseVectorWeb instance
42
+ */
43
+ static async loadFromCloud(options) {
44
+ const instance = await CloseVectorHNSWWeb.loadFromCloud(options);
45
+ const vectorstore = new this(options.embeddings, instance.args, options.credentials);
46
+ return vectorstore;
47
+ }
48
+ /**
49
+ * Static method to load a vector store from a directory. It reads the
50
+ * HNSW index, the arguments, and the document store from the directory,
51
+ * then creates a new CloseVectorWeb instance with these values.
52
+ * @param directory The directory from which to load the vector store.
53
+ * @param embeddings The embeddings to be used by the CloseVectorWeb instance.
54
+ * @returns A Promise that resolves to a new CloseVectorWeb instance.
55
+ */
56
+ static async load(directory, embeddings, credentials) {
57
+ const instance = await CloseVectorHNSWWeb.load(directory, embeddings);
58
+ const vectorstore = new this(embeddings, instance.args, credentials);
59
+ return vectorstore;
60
+ }
61
+ /**
62
+ * Static method to create a new CloseVectorWeb instance from texts and metadata.
63
+ * It creates a new Document instance for each text and metadata, then
64
+ * calls the fromDocuments method to create the CloseVectorWeb instance.
65
+ * @param texts The texts to be used to create the documents.
66
+ * @param metadatas The metadata to be used to create the documents.
67
+ * @param embeddings The embeddings to be used by the CloseVectorWeb instance.
68
+ * @param args An optional configuration object for the CloseVectorWeb instance.
69
+ * @param credential An optional credential object for the CloseVector API.
70
+ * @returns A Promise that resolves to a new CloseVectorWeb instance.
71
+ */
72
+ static async fromTexts(texts, metadatas, embeddings, args, credential) {
73
+ const docs = [];
74
+ for (let i = 0; i < texts.length; i += 1) {
75
+ const metadata = Array.isArray(metadatas) ? metadatas[i] : metadatas;
76
+ const newDoc = new Document({
77
+ pageContent: texts[i],
78
+ metadata,
79
+ });
80
+ docs.push(newDoc);
81
+ }
82
+ return await CloseVectorWeb.fromDocuments(docs, embeddings, args, credential);
83
+ }
84
+ /**
85
+ * Static method to create a new CloseVectorWeb instance from documents. It
86
+ * creates a new CloseVectorWeb instance, adds the documents to it, then returns
87
+ * the instance.
88
+ * @param docs The documents to be added to the CloseVectorWeb instance.
89
+ * @param embeddings The embeddings to be used by the CloseVectorWeb instance.
90
+ * @param args An optional configuration object for the CloseVectorWeb instance.
91
+ * @param credentials An optional credential object for the CloseVector API.
92
+ * @returns A Promise that resolves to a new CloseVectorWeb instance.
93
+ */
94
+ static async fromDocuments(docs, embeddings, args, credentials) {
95
+ const _args = args || {
96
+ space: "cosine",
97
+ };
98
+ const instance = new this(embeddings, _args, credentials);
99
+ await instance.addDocuments(docs);
100
+ return instance;
101
+ }
102
+ static async imports() {
103
+ return CloseVectorHNSWWeb.imports();
104
+ }
105
+ }
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/llms/cloudflare_workersai.cjs');
@@ -0,0 +1 @@
1
+ export * from '../dist/llms/cloudflare_workersai.js'
@@ -0,0 +1 @@
1
+ export * from '../dist/llms/cloudflare_workersai.js'
package/llms/fake.cjs ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/llms/fake.cjs');
package/llms/fake.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '../dist/llms/fake.js'
package/llms/fake.js ADDED
@@ -0,0 +1 @@
1
+ export * from '../dist/llms/fake.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langchain",
3
- "version": "0.0.167",
3
+ "version": "0.0.168",
4
4
  "description": "Typescript bindings for langchain",
5
5
  "type": "module",
6
6
  "engines": {
@@ -133,6 +133,9 @@
133
133
  "llms/aleph_alpha.cjs",
134
134
  "llms/aleph_alpha.js",
135
135
  "llms/aleph_alpha.d.ts",
136
+ "llms/cloudflare_workersai.cjs",
137
+ "llms/cloudflare_workersai.js",
138
+ "llms/cloudflare_workersai.d.ts",
136
139
  "llms/cohere.cjs",
137
140
  "llms/cohere.js",
138
141
  "llms/cohere.d.ts",
@@ -178,6 +181,9 @@
178
181
  "llms/yandex.cjs",
179
182
  "llms/yandex.js",
180
183
  "llms/yandex.d.ts",
184
+ "llms/fake.cjs",
185
+ "llms/fake.js",
186
+ "llms/fake.d.ts",
181
187
  "prompts.cjs",
182
188
  "prompts.js",
183
189
  "prompts.d.ts",
@@ -202,6 +208,12 @@
202
208
  "vectorstores/cloudflare_vectorize.cjs",
203
209
  "vectorstores/cloudflare_vectorize.js",
204
210
  "vectorstores/cloudflare_vectorize.d.ts",
211
+ "vectorstores/closevector/web.cjs",
212
+ "vectorstores/closevector/web.js",
213
+ "vectorstores/closevector/web.d.ts",
214
+ "vectorstores/closevector/node.cjs",
215
+ "vectorstores/closevector/node.js",
216
+ "vectorstores/closevector/node.d.ts",
205
217
  "vectorstores/chroma.cjs",
206
218
  "vectorstores/chroma.js",
207
219
  "vectorstores/chroma.d.ts",
@@ -436,6 +448,9 @@
436
448
  "chat_models/bedrock.cjs",
437
449
  "chat_models/bedrock.js",
438
450
  "chat_models/bedrock.d.ts",
451
+ "chat_models/cloudflare_workersai.cjs",
452
+ "chat_models/cloudflare_workersai.js",
453
+ "chat_models/cloudflare_workersai.d.ts",
439
454
  "chat_models/googlevertexai.cjs",
440
455
  "chat_models/googlevertexai.js",
441
456
  "chat_models/googlevertexai.d.ts",
@@ -457,6 +472,9 @@
457
472
  "chat_models/minimax.cjs",
458
473
  "chat_models/minimax.js",
459
474
  "chat_models/minimax.d.ts",
475
+ "chat_models/fake.cjs",
476
+ "chat_models/fake.js",
477
+ "chat_models/fake.d.ts",
460
478
  "schema.cjs",
461
479
  "schema.js",
462
480
  "schema.d.ts",
@@ -698,13 +716,13 @@
698
716
  },
699
717
  "scripts": {
700
718
  "build": "yarn clean && yarn build:esm && yarn build:cjs && node scripts/create-entrypoints.js && node scripts/check-tree-shaking.js",
701
- "build:esm": "tsc --outDir dist/ && rimraf dist/tests dist/**/tests",
702
- "build:cjs": "tsc --outDir dist-cjs/ -p tsconfig.cjs.json && node scripts/move-cjs-to-dist.js && rimraf dist-cjs",
719
+ "build:esm": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist/ && rimraf dist/tests dist/**/tests",
720
+ "build:cjs": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist-cjs/ -p tsconfig.cjs.json && node scripts/move-cjs-to-dist.js && rimraf dist-cjs",
703
721
  "build:watch": "node scripts/create-entrypoints.js && tsc --outDir dist/ --watch",
704
- "lint": "eslint src && dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
722
+ "lint": "NODE_OPTIONS=--max-old-space-size=4096 eslint src && dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
705
723
  "lint:fix": "yarn lint --fix",
706
724
  "precommit": "lint-staged",
707
- "clean": "rimraf dist/ && node scripts/create-entrypoints.js pre",
725
+ "clean": "rimraf dist/ && NODE_OPTIONS=--max-old-space-size=4096 node scripts/create-entrypoints.js pre",
708
726
  "prepack": "yarn build",
709
727
  "release": "release-it --only-version --config .release-it.json",
710
728
  "test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
@@ -788,6 +806,9 @@
788
806
  "cassandra-driver": "^4.6.4",
789
807
  "cheerio": "^1.0.0-rc.12",
790
808
  "chromadb": "^1.5.3",
809
+ "closevector-common": "0.1.0-alpha.1",
810
+ "closevector-node": "0.1.0-alpha.10",
811
+ "closevector-web": "0.1.0-alpha.15",
791
812
  "cohere-ai": ">=6.0.0",
792
813
  "d3-dsv": "^2.0.0",
793
814
  "dotenv": "^16.0.3",
@@ -900,6 +921,9 @@
900
921
  "cassandra-driver": "^4.6.4",
901
922
  "cheerio": "^1.0.0-rc.12",
902
923
  "chromadb": "*",
924
+ "closevector-common": "0.1.0-alpha.1",
925
+ "closevector-node": "0.1.0-alpha.10",
926
+ "closevector-web": "0.1.0-alpha.16",
903
927
  "cohere-ai": ">=6.0.0",
904
928
  "d3-dsv": "^2.0.0",
905
929
  "epub2": "^3.0.1",
@@ -1091,6 +1115,15 @@
1091
1115
  "chromadb": {
1092
1116
  "optional": true
1093
1117
  },
1118
+ "closevector-common": {
1119
+ "optional": true
1120
+ },
1121
+ "closevector-node": {
1122
+ "optional": true
1123
+ },
1124
+ "closevector-web": {
1125
+ "optional": true
1126
+ },
1094
1127
  "cohere-ai": {
1095
1128
  "optional": true
1096
1129
  },
@@ -1465,6 +1498,11 @@
1465
1498
  "import": "./llms/aleph_alpha.js",
1466
1499
  "require": "./llms/aleph_alpha.cjs"
1467
1500
  },
1501
+ "./llms/cloudflare_workersai": {
1502
+ "types": "./llms/cloudflare_workersai.d.ts",
1503
+ "import": "./llms/cloudflare_workersai.js",
1504
+ "require": "./llms/cloudflare_workersai.cjs"
1505
+ },
1468
1506
  "./llms/cohere": {
1469
1507
  "types": "./llms/cohere.d.ts",
1470
1508
  "import": "./llms/cohere.js",
@@ -1540,6 +1578,11 @@
1540
1578
  "import": "./llms/yandex.js",
1541
1579
  "require": "./llms/yandex.cjs"
1542
1580
  },
1581
+ "./llms/fake": {
1582
+ "types": "./llms/fake.d.ts",
1583
+ "import": "./llms/fake.js",
1584
+ "require": "./llms/fake.cjs"
1585
+ },
1543
1586
  "./prompts": {
1544
1587
  "types": "./prompts.d.ts",
1545
1588
  "import": "./prompts.js",
@@ -1580,6 +1623,16 @@
1580
1623
  "import": "./vectorstores/cloudflare_vectorize.js",
1581
1624
  "require": "./vectorstores/cloudflare_vectorize.cjs"
1582
1625
  },
1626
+ "./vectorstores/closevector/web": {
1627
+ "types": "./vectorstores/closevector/web.d.ts",
1628
+ "import": "./vectorstores/closevector/web.js",
1629
+ "require": "./vectorstores/closevector/web.cjs"
1630
+ },
1631
+ "./vectorstores/closevector/node": {
1632
+ "types": "./vectorstores/closevector/node.d.ts",
1633
+ "import": "./vectorstores/closevector/node.js",
1634
+ "require": "./vectorstores/closevector/node.cjs"
1635
+ },
1583
1636
  "./vectorstores/chroma": {
1584
1637
  "types": "./vectorstores/chroma.d.ts",
1585
1638
  "import": "./vectorstores/chroma.js",
@@ -1970,6 +2023,11 @@
1970
2023
  "import": "./chat_models/bedrock.js",
1971
2024
  "require": "./chat_models/bedrock.cjs"
1972
2025
  },
2026
+ "./chat_models/cloudflare_workersai": {
2027
+ "types": "./chat_models/cloudflare_workersai.d.ts",
2028
+ "import": "./chat_models/cloudflare_workersai.js",
2029
+ "require": "./chat_models/cloudflare_workersai.cjs"
2030
+ },
1973
2031
  "./chat_models/googlevertexai": {
1974
2032
  "types": "./chat_models/googlevertexai.d.ts",
1975
2033
  "import": "./chat_models/googlevertexai.js",
@@ -2005,6 +2063,11 @@
2005
2063
  "import": "./chat_models/minimax.js",
2006
2064
  "require": "./chat_models/minimax.cjs"
2007
2065
  },
2066
+ "./chat_models/fake": {
2067
+ "types": "./chat_models/fake.d.ts",
2068
+ "import": "./chat_models/fake.js",
2069
+ "require": "./chat_models/fake.cjs"
2070
+ },
2008
2071
  "./schema": {
2009
2072
  "types": "./schema.d.ts",
2010
2073
  "import": "./schema.js",
@@ -0,0 +1 @@
1
+ module.exports = require('../../dist/vectorstores/closevector/node.cjs');
@@ -0,0 +1 @@
1
+ export * from '../../dist/vectorstores/closevector/node.js'
@@ -0,0 +1 @@
1
+ export * from '../../dist/vectorstores/closevector/node.js'
@@ -0,0 +1 @@
1
+ module.exports = require('../../dist/vectorstores/closevector/web.cjs');
@@ -0,0 +1 @@
1
+ export * from '../../dist/vectorstores/closevector/web.js'
@@ -0,0 +1 @@
1
+ export * from '../../dist/vectorstores/closevector/web.js'