langchain 0.0.132 → 0.0.133

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 (44) hide show
  1. package/dist/agents/chat/outputParser.cjs +2 -1
  2. package/dist/agents/chat/outputParser.js +2 -1
  3. package/dist/agents/executor.cjs +106 -7
  4. package/dist/agents/executor.d.ts +23 -0
  5. package/dist/agents/executor.js +104 -6
  6. package/dist/agents/mrkl/outputParser.cjs +2 -1
  7. package/dist/agents/mrkl/outputParser.js +2 -1
  8. package/dist/chat_models/googlevertexai.cjs +1 -1
  9. package/dist/chat_models/googlevertexai.d.ts +2 -2
  10. package/dist/chat_models/googlevertexai.js +2 -2
  11. package/dist/chat_models/ollama.cjs +8 -8
  12. package/dist/chat_models/ollama.js +8 -8
  13. package/dist/document_loaders/web/notionapi.cjs +153 -74
  14. package/dist/document_loaders/web/notionapi.d.ts +19 -10
  15. package/dist/document_loaders/web/notionapi.js +154 -75
  16. package/dist/embeddings/googlevertexai.cjs +1 -1
  17. package/dist/embeddings/googlevertexai.d.ts +2 -2
  18. package/dist/embeddings/googlevertexai.js +2 -2
  19. package/dist/experimental/multimodal_embeddings/googlevertexai.cjs +1 -1
  20. package/dist/experimental/multimodal_embeddings/googlevertexai.d.ts +2 -2
  21. package/dist/experimental/multimodal_embeddings/googlevertexai.js +2 -2
  22. package/dist/llms/googlevertexai.cjs +1 -1
  23. package/dist/llms/googlevertexai.js +2 -2
  24. package/dist/load/import_constants.cjs +1 -0
  25. package/dist/load/import_constants.js +1 -0
  26. package/dist/schema/output_parser.cjs +2 -2
  27. package/dist/schema/output_parser.js +2 -2
  28. package/dist/tools/base.cjs +26 -2
  29. package/dist/tools/base.d.ts +9 -0
  30. package/dist/tools/base.js +24 -1
  31. package/dist/types/googlevertexai-types.d.ts +8 -3
  32. package/dist/util/googlevertexai-connection.cjs +49 -15
  33. package/dist/util/googlevertexai-connection.d.ts +12 -4
  34. package/dist/util/googlevertexai-connection.js +46 -13
  35. package/dist/vectorstores/googlevertexai.cjs +550 -0
  36. package/dist/vectorstores/googlevertexai.d.ts +180 -0
  37. package/dist/vectorstores/googlevertexai.js +519 -0
  38. package/dist/vectorstores/vectara.cjs +11 -2
  39. package/dist/vectorstores/vectara.d.ts +10 -1
  40. package/dist/vectorstores/vectara.js +11 -2
  41. package/package.json +10 -2
  42. package/vectorstores/googlevertexai.cjs +1 -0
  43. package/vectorstores/googlevertexai.d.ts +1 -0
  44. package/vectorstores/googlevertexai.js +1 -0
@@ -163,10 +163,19 @@ class VectaraStore extends base_js_1.VectorStore {
163
163
  console.log(`Added ${countAdded} documents to Vectara`);
164
164
  }
165
165
  }
166
- async addFiles(filePaths, metadata = undefined) {
166
+ /**
167
+ * Vectara provides a way to add documents directly via their API. This API handles
168
+ * pre-processing and chunking internally in an optimal manner. This method is a wrapper
169
+ * to utilize that API within LangChain.
170
+ *
171
+ * @param filePaths An array of Blob objects representing the files to be uploaded to Vectara.
172
+ * @param metadata Optional. An array of metadata objects corresponding to each file in the `filePaths` array.
173
+ * @returns A Promise that resolves to the number of successfully uploaded files.
174
+ */
175
+ async addFiles(filePaths, metadatas = undefined) {
167
176
  let numDocs = 0;
168
177
  for (const [index, fileBlob] of filePaths.entries()) {
169
- const md = metadata ? metadata[index] : {};
178
+ const md = metadatas ? metadatas[index] : {};
170
179
  const data = new FormData();
171
180
  data.append("file", fileBlob, `file_${index}`);
172
181
  data.append("doc-metadata", JSON.stringify(md));
@@ -75,7 +75,16 @@ export declare class VectaraStore extends VectorStore {
75
75
  * @returns A Promise that resolves when the documents have been added.
76
76
  */
77
77
  addDocuments(documents: Document[]): Promise<void>;
78
- addFiles(filePaths: Blob[], metadata?: Record<string, unknown> | undefined): Promise<number>;
78
+ /**
79
+ * Vectara provides a way to add documents directly via their API. This API handles
80
+ * pre-processing and chunking internally in an optimal manner. This method is a wrapper
81
+ * to utilize that API within LangChain.
82
+ *
83
+ * @param filePaths An array of Blob objects representing the files to be uploaded to Vectara.
84
+ * @param metadata Optional. An array of metadata objects corresponding to each file in the `filePaths` array.
85
+ * @returns A Promise that resolves to the number of successfully uploaded files.
86
+ */
87
+ addFiles(filePaths: Blob[], metadatas?: Record<string, unknown> | undefined): Promise<number>;
79
88
  /**
80
89
  * Performs a similarity search and returns documents along with their
81
90
  * scores.
@@ -160,10 +160,19 @@ export class VectaraStore extends VectorStore {
160
160
  console.log(`Added ${countAdded} documents to Vectara`);
161
161
  }
162
162
  }
163
- async addFiles(filePaths, metadata = undefined) {
163
+ /**
164
+ * Vectara provides a way to add documents directly via their API. This API handles
165
+ * pre-processing and chunking internally in an optimal manner. This method is a wrapper
166
+ * to utilize that API within LangChain.
167
+ *
168
+ * @param filePaths An array of Blob objects representing the files to be uploaded to Vectara.
169
+ * @param metadata Optional. An array of metadata objects corresponding to each file in the `filePaths` array.
170
+ * @returns A Promise that resolves to the number of successfully uploaded files.
171
+ */
172
+ async addFiles(filePaths, metadatas = undefined) {
164
173
  let numDocs = 0;
165
174
  for (const [index, fileBlob] of filePaths.entries()) {
166
- const md = metadata ? metadata[index] : {};
175
+ const md = metadatas ? metadatas[index] : {};
167
176
  const data = new FormData();
168
177
  data.append("file", fileBlob, `file_${index}`);
169
178
  data.append("doc-metadata", JSON.stringify(md));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langchain",
3
- "version": "0.0.132",
3
+ "version": "0.0.133",
4
4
  "description": "Typescript bindings for langchain",
5
5
  "type": "module",
6
6
  "engines": {
@@ -169,6 +169,9 @@
169
169
  "vectorstores/chroma.cjs",
170
170
  "vectorstores/chroma.js",
171
171
  "vectorstores/chroma.d.ts",
172
+ "vectorstores/googlevertexai.cjs",
173
+ "vectorstores/googlevertexai.js",
174
+ "vectorstores/googlevertexai.d.ts",
172
175
  "vectorstores/hnswlib.cjs",
173
176
  "vectorstores/hnswlib.js",
174
177
  "vectorstores/hnswlib.d.ts",
@@ -995,7 +998,7 @@
995
998
  "js-tiktoken": "^1.0.7",
996
999
  "js-yaml": "^4.1.0",
997
1000
  "jsonpointer": "^5.0.1",
998
- "langsmith": "~0.0.16",
1001
+ "langsmith": "~0.0.26",
999
1002
  "ml-distance": "^4.0.0",
1000
1003
  "object-hash": "^3.0.0",
1001
1004
  "openai": "^3.3.0",
@@ -1301,6 +1304,11 @@
1301
1304
  "import": "./vectorstores/chroma.js",
1302
1305
  "require": "./vectorstores/chroma.cjs"
1303
1306
  },
1307
+ "./vectorstores/googlevertexai": {
1308
+ "types": "./vectorstores/googlevertexai.d.ts",
1309
+ "import": "./vectorstores/googlevertexai.js",
1310
+ "require": "./vectorstores/googlevertexai.cjs"
1311
+ },
1304
1312
  "./vectorstores/hnswlib": {
1305
1313
  "types": "./vectorstores/hnswlib.d.ts",
1306
1314
  "import": "./vectorstores/hnswlib.js",
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/vectorstores/googlevertexai.cjs');
@@ -0,0 +1 @@
1
+ export * from '../dist/vectorstores/googlevertexai.js'
@@ -0,0 +1 @@
1
+ export * from '../dist/vectorstores/googlevertexai.js'