langchain 0.0.69 → 0.0.71

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 (71) hide show
  1. package/dist/agents/mrkl/prompt.cjs +1 -1
  2. package/dist/agents/mrkl/prompt.d.ts +1 -1
  3. package/dist/agents/mrkl/prompt.js +1 -1
  4. package/dist/callbacks/base.cjs +25 -2
  5. package/dist/callbacks/base.js +2 -2
  6. package/dist/chains/llm_chain.d.ts +7 -7
  7. package/dist/chains/question_answering/load.cjs +14 -40
  8. package/dist/chains/question_answering/load.d.ts +3 -3
  9. package/dist/chains/question_answering/load.js +16 -42
  10. package/dist/chains/sql_db/sql_db_chain.cjs +4 -0
  11. package/dist/chains/sql_db/sql_db_chain.d.ts +3 -1
  12. package/dist/chains/sql_db/sql_db_chain.js +4 -0
  13. package/dist/chains/sql_db/sql_db_prompt.cjs +58 -1
  14. package/dist/chains/sql_db/sql_db_prompt.d.ts +3 -0
  15. package/dist/chains/sql_db/sql_db_prompt.js +57 -0
  16. package/dist/chat_models/openai.cjs +89 -4
  17. package/dist/chat_models/openai.d.ts +18 -53
  18. package/dist/chat_models/openai.js +90 -5
  19. package/dist/document_loaders/fs/directory.d.ts +5 -6
  20. package/dist/document_loaders/fs/pdf.d.ts +1 -1
  21. package/dist/document_loaders/fs/unstructured.cjs +68 -49
  22. package/dist/document_loaders/fs/unstructured.d.ts +16 -11
  23. package/dist/document_loaders/fs/unstructured.js +69 -50
  24. package/dist/document_loaders/web/s3.cjs +2 -1
  25. package/dist/document_loaders/web/s3.js +2 -1
  26. package/dist/embeddings/openai.cjs +86 -6
  27. package/dist/embeddings/openai.d.ts +7 -2
  28. package/dist/embeddings/openai.js +86 -6
  29. package/dist/llms/openai-chat.cjs +97 -6
  30. package/dist/llms/openai-chat.d.ts +22 -58
  31. package/dist/llms/openai-chat.js +97 -6
  32. package/dist/llms/openai.cjs +94 -5
  33. package/dist/llms/openai.d.ts +18 -59
  34. package/dist/llms/openai.js +95 -6
  35. package/dist/memory/base.cjs +1 -1
  36. package/dist/memory/base.js +1 -1
  37. package/dist/memory/index.cjs +3 -1
  38. package/dist/memory/index.d.ts +1 -0
  39. package/dist/memory/index.js +1 -0
  40. package/dist/memory/vector_store.cjs +61 -0
  41. package/dist/memory/vector_store.d.ts +19 -0
  42. package/dist/memory/vector_store.js +57 -0
  43. package/dist/output_parsers/combining.cjs +15 -4
  44. package/dist/output_parsers/combining.d.ts +1 -0
  45. package/dist/output_parsers/combining.js +15 -4
  46. package/dist/output_parsers/structured.cjs +10 -5
  47. package/dist/output_parsers/structured.js +10 -5
  48. package/dist/retrievers/time_weighted.d.ts +1 -1
  49. package/dist/tools/webbrowser.cjs +1 -1
  50. package/dist/tools/webbrowser.js +1 -1
  51. package/dist/util/sql_utils.cjs +15 -1
  52. package/dist/util/sql_utils.d.ts +2 -0
  53. package/dist/util/sql_utils.js +13 -0
  54. package/dist/vectorstores/chroma.cjs +25 -2
  55. package/dist/vectorstores/chroma.js +2 -2
  56. package/dist/vectorstores/milvus.cjs +25 -2
  57. package/dist/vectorstores/milvus.js +2 -2
  58. package/dist/vectorstores/myscale.cjs +26 -3
  59. package/dist/vectorstores/myscale.js +3 -3
  60. package/dist/vectorstores/opensearch.cjs +25 -2
  61. package/dist/vectorstores/opensearch.js +2 -2
  62. package/dist/vectorstores/pinecone.cjs +25 -2
  63. package/dist/vectorstores/pinecone.js +2 -2
  64. package/dist/vectorstores/prisma.cjs +1 -1
  65. package/dist/vectorstores/prisma.js +2 -1
  66. package/dist/vectorstores/supabase.cjs +13 -1
  67. package/dist/vectorstores/supabase.d.ts +6 -1
  68. package/dist/vectorstores/supabase.js +13 -1
  69. package/dist/vectorstores/weaviate.cjs +25 -2
  70. package/dist/vectorstores/weaviate.js +2 -2
  71. package/package.json +5 -5
@@ -1,4 +1,4 @@
1
- import { v4 as uuidv4 } from "uuid";
1
+ import * as uuid from "uuid";
2
2
  import { VectorStore } from "./base.js";
3
3
  import { Document } from "../document.js";
4
4
  export class Chroma extends VectorStore {
@@ -135,7 +135,7 @@ export class Chroma extends VectorStore {
135
135
  }
136
136
  function ensureCollectionName(collectionName) {
137
137
  if (!collectionName) {
138
- return `langchain-${uuidv4()}`;
138
+ return `langchain-${uuid.v4()}`;
139
139
  }
140
140
  return collectionName;
141
141
  }
@@ -1,7 +1,30 @@
1
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
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.Milvus = void 0;
4
- const uuid_1 = require("uuid");
27
+ const uuid = __importStar(require("uuid"));
5
28
  const milvus2_sdk_node_1 = require("@zilliz/milvus2-sdk-node");
6
29
  const Milvus_js_1 = require("@zilliz/milvus2-sdk-node/dist/milvus/const/Milvus.js");
7
30
  const types_js_1 = require("@zilliz/milvus2-sdk-node/dist/milvus/types.js");
@@ -441,7 +464,7 @@ function createFieldTypeForMetadata(documents) {
441
464
  return fields;
442
465
  }
443
466
  function genCollectionName() {
444
- return `${MILVUS_COLLECTION_NAME_PREFIX}_${(0, uuid_1.v4)().replaceAll("-", "")}`;
467
+ return `${MILVUS_COLLECTION_NAME_PREFIX}_${uuid.v4().replaceAll("-", "")}`;
445
468
  }
446
469
  function getTextFieldMaxLength(documents) {
447
470
  let textMaxLength = 0;
@@ -1,4 +1,4 @@
1
- import { v4 as uuidv4 } from "uuid";
1
+ import * as uuid from "uuid";
2
2
  import { MilvusClient } from "@zilliz/milvus2-sdk-node";
3
3
  import { DataType, DataTypeMap, } from "@zilliz/milvus2-sdk-node/dist/milvus/const/Milvus.js";
4
4
  import { ErrorCode, } from "@zilliz/milvus2-sdk-node/dist/milvus/types.js";
@@ -437,7 +437,7 @@ function createFieldTypeForMetadata(documents) {
437
437
  return fields;
438
438
  }
439
439
  function genCollectionName() {
440
- return `${MILVUS_COLLECTION_NAME_PREFIX}_${uuidv4().replaceAll("-", "")}`;
440
+ return `${MILVUS_COLLECTION_NAME_PREFIX}_${uuid.v4().replaceAll("-", "")}`;
441
441
  }
442
442
  function getTextFieldMaxLength(documents) {
443
443
  let textMaxLength = 0;
@@ -1,7 +1,30 @@
1
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
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.MyScaleStore = void 0;
4
- const uuid_1 = require("uuid");
27
+ const uuid = __importStar(require("uuid"));
5
28
  const client_1 = require("@clickhouse/client");
6
29
  const base_js_1 = require("./base.cjs");
7
30
  const document_js_1 = require("../document.cjs");
@@ -71,7 +94,7 @@ class MyScaleStore extends base_js_1.VectorStore {
71
94
  host: `${args.protocol ?? "https://"}${args.host}:${args.port}`,
72
95
  username: args.username,
73
96
  password: args.password,
74
- session_id: (0, uuid_1.v4)(),
97
+ session_id: uuid.v4(),
75
98
  });
76
99
  }
77
100
  async addVectors(vectors, documents) {
@@ -152,7 +175,7 @@ class MyScaleStore extends base_js_1.VectorStore {
152
175
  const vector = vectors[i];
153
176
  const document = documents[i];
154
177
  const item = [
155
- `'${(0, uuid_1.v4)()}'`,
178
+ `'${uuid.v4()}'`,
156
179
  `'${this.escapeString(document.pageContent)}'`,
157
180
  `[${vector}]`,
158
181
  `'${JSON.stringify(document.metadata)}'`,
@@ -1,4 +1,4 @@
1
- import { v4 as uuid } from "uuid";
1
+ import * as uuid from "uuid";
2
2
  import { createClient } from "@clickhouse/client";
3
3
  import { VectorStore } from "./base.js";
4
4
  import { Document } from "../document.js";
@@ -68,7 +68,7 @@ export class MyScaleStore extends VectorStore {
68
68
  host: `${args.protocol ?? "https://"}${args.host}:${args.port}`,
69
69
  username: args.username,
70
70
  password: args.password,
71
- session_id: uuid(),
71
+ session_id: uuid.v4(),
72
72
  });
73
73
  }
74
74
  async addVectors(vectors, documents) {
@@ -149,7 +149,7 @@ export class MyScaleStore extends VectorStore {
149
149
  const vector = vectors[i];
150
150
  const document = documents[i];
151
151
  const item = [
152
- `'${uuid()}'`,
152
+ `'${uuid.v4()}'`,
153
153
  `'${this.escapeString(document.pageContent)}'`,
154
154
  `[${vector}]`,
155
155
  `'${JSON.stringify(document.metadata)}'`,
@@ -1,8 +1,31 @@
1
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
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.OpenSearchVectorStore = void 0;
4
27
  const opensearch_1 = require("@opensearch-project/opensearch");
5
- const uuid_1 = require("uuid");
28
+ const uuid = __importStar(require("uuid"));
6
29
  const document_js_1 = require("../document.cjs");
7
30
  const base_js_1 = require("./base.cjs");
8
31
  class OpenSearchVectorStore extends base_js_1.VectorStore {
@@ -68,7 +91,7 @@ class OpenSearchVectorStore extends base_js_1.VectorStore {
68
91
  {
69
92
  index: {
70
93
  _index: this.indexName,
71
- _id: (0, uuid_1.v4)(),
94
+ _id: uuid.v4(),
72
95
  },
73
96
  },
74
97
  {
@@ -1,5 +1,5 @@
1
1
  import { errors } from "@opensearch-project/opensearch";
2
- import { v4 as uuid } from "uuid";
2
+ import * as uuid from "uuid";
3
3
  import { Document } from "../document.js";
4
4
  import { VectorStore } from "./base.js";
5
5
  export class OpenSearchVectorStore extends VectorStore {
@@ -65,7 +65,7 @@ export class OpenSearchVectorStore extends VectorStore {
65
65
  {
66
66
  index: {
67
67
  _index: this.indexName,
68
- _id: uuid(),
68
+ _id: uuid.v4(),
69
69
  },
70
70
  },
71
71
  {
@@ -1,10 +1,33 @@
1
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
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
6
29
  exports.PineconeStore = void 0;
7
- const uuid_1 = require("uuid");
30
+ const uuid = __importStar(require("uuid"));
8
31
  const flat_1 = __importDefault(require("flat"));
9
32
  const base_js_1 = require("./base.cjs");
10
33
  const document_js_1 = require("../document.cjs");
@@ -46,7 +69,7 @@ class PineconeStore extends base_js_1.VectorStore {
46
69
  return this.addVectors(await this.embeddings.embedDocuments(texts), documents, ids);
47
70
  }
48
71
  async addVectors(vectors, documents, ids) {
49
- const documentIds = ids == null ? documents.map(() => (0, uuid_1.v4)()) : ids;
72
+ const documentIds = ids == null ? documents.map(() => uuid.v4()) : ids;
50
73
  const pineconeVectors = vectors.map((values, idx) => {
51
74
  // Pinecone doesn't support nested objects, so we flatten them
52
75
  const metadata = (0, flat_1.default)({
@@ -1,4 +1,4 @@
1
- import { v4 as uuidv4 } from "uuid";
1
+ import * as uuid from "uuid";
2
2
  import flatten from "flat";
3
3
  import { VectorStore } from "./base.js";
4
4
  import { Document } from "../document.js";
@@ -40,7 +40,7 @@ export class PineconeStore extends VectorStore {
40
40
  return this.addVectors(await this.embeddings.embedDocuments(texts), documents, ids);
41
41
  }
42
42
  async addVectors(vectors, documents, ids) {
43
- const documentIds = ids == null ? documents.map(() => uuidv4()) : ids;
43
+ const documentIds = ids == null ? documents.map(() => uuid.v4()) : ids;
44
44
  const pineconeVectors = vectors.map((values, idx) => {
45
45
  // Pinecone doesn't support nested objects, so we flatten them
46
46
  const metadata = flatten({
@@ -162,7 +162,6 @@ class PrismaVectorStore extends base_js_1.VectorStore {
162
162
  return instance;
163
163
  }
164
164
  }
165
- exports.PrismaVectorStore = PrismaVectorStore;
166
165
  Object.defineProperty(PrismaVectorStore, "IdColumn", {
167
166
  enumerable: true,
168
167
  configurable: true,
@@ -175,3 +174,4 @@ Object.defineProperty(PrismaVectorStore, "ContentColumn", {
175
174
  writable: true,
176
175
  value: ContentColumnSymbol
177
176
  });
177
+ exports.PrismaVectorStore = PrismaVectorStore;
@@ -2,7 +2,7 @@ import { VectorStore } from "./base.js";
2
2
  import { Document } from "../document.js";
3
3
  const IdColumnSymbol = Symbol("id");
4
4
  const ContentColumnSymbol = Symbol("content");
5
- export class PrismaVectorStore extends VectorStore {
5
+ class PrismaVectorStore extends VectorStore {
6
6
  constructor(embeddings, config) {
7
7
  super(embeddings, {});
8
8
  Object.defineProperty(this, "tableSql", {
@@ -171,3 +171,4 @@ Object.defineProperty(PrismaVectorStore, "ContentColumn", {
171
171
  writable: true,
172
172
  value: ContentColumnSymbol
173
173
  });
174
+ export { PrismaVectorStore };
@@ -24,9 +24,16 @@ class SupabaseVectorStore extends base_js_1.VectorStore {
24
24
  writable: true,
25
25
  value: void 0
26
26
  });
27
+ Object.defineProperty(this, "filter", {
28
+ enumerable: true,
29
+ configurable: true,
30
+ writable: true,
31
+ value: void 0
32
+ });
27
33
  this.client = args.client;
28
34
  this.tableName = args.tableName || "documents";
29
35
  this.queryName = args.queryName || "match_documents";
36
+ this.filter = args.filter;
30
37
  }
31
38
  async addDocuments(documents) {
32
39
  const texts = documents.map(({ pageContent }) => pageContent);
@@ -49,8 +56,13 @@ class SupabaseVectorStore extends base_js_1.VectorStore {
49
56
  }
50
57
  }
51
58
  }
52
- async similaritySearchVectorWithScore(query, k) {
59
+ async similaritySearchVectorWithScore(query, k, filter) {
60
+ if (filter && this.filter) {
61
+ throw new Error("cannot provide both `filter` and `this.filter`");
62
+ }
63
+ const _filter = filter ?? this.filter;
53
64
  const matchDocumentsParams = {
65
+ filter: _filter,
54
66
  query_embedding: query,
55
67
  match_count: k,
56
68
  };
@@ -2,20 +2,25 @@ import type { SupabaseClient } from "@supabase/supabase-js";
2
2
  import { VectorStore } from "./base.js";
3
3
  import { Embeddings } from "../embeddings/base.js";
4
4
  import { Document } from "../document.js";
5
+ type SupabaseMetadata = Record<string, any>;
5
6
  export interface SupabaseLibArgs {
6
7
  client: SupabaseClient;
7
8
  tableName?: string;
8
9
  queryName?: string;
10
+ filter?: SupabaseMetadata;
9
11
  }
10
12
  export declare class SupabaseVectorStore extends VectorStore {
13
+ FilterType: SupabaseMetadata;
11
14
  client: SupabaseClient;
12
15
  tableName: string;
13
16
  queryName: string;
17
+ filter?: SupabaseMetadata;
14
18
  constructor(embeddings: Embeddings, args: SupabaseLibArgs);
15
19
  addDocuments(documents: Document[]): Promise<void>;
16
20
  addVectors(vectors: number[][], documents: Document[]): Promise<void>;
17
- similaritySearchVectorWithScore(query: number[], k: number): Promise<[Document, number][]>;
21
+ similaritySearchVectorWithScore(query: number[], k: number, filter?: this["FilterType"]): Promise<[Document, number][]>;
18
22
  static fromTexts(texts: string[], metadatas: object[] | object, embeddings: Embeddings, dbConfig: SupabaseLibArgs): Promise<SupabaseVectorStore>;
19
23
  static fromDocuments(docs: Document[], embeddings: Embeddings, dbConfig: SupabaseLibArgs): Promise<SupabaseVectorStore>;
20
24
  static fromExistingIndex(embeddings: Embeddings, dbConfig: SupabaseLibArgs): Promise<SupabaseVectorStore>;
21
25
  }
26
+ export {};
@@ -21,9 +21,16 @@ export class SupabaseVectorStore extends VectorStore {
21
21
  writable: true,
22
22
  value: void 0
23
23
  });
24
+ Object.defineProperty(this, "filter", {
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true,
28
+ value: void 0
29
+ });
24
30
  this.client = args.client;
25
31
  this.tableName = args.tableName || "documents";
26
32
  this.queryName = args.queryName || "match_documents";
33
+ this.filter = args.filter;
27
34
  }
28
35
  async addDocuments(documents) {
29
36
  const texts = documents.map(({ pageContent }) => pageContent);
@@ -46,8 +53,13 @@ export class SupabaseVectorStore extends VectorStore {
46
53
  }
47
54
  }
48
55
  }
49
- async similaritySearchVectorWithScore(query, k) {
56
+ async similaritySearchVectorWithScore(query, k, filter) {
57
+ if (filter && this.filter) {
58
+ throw new Error("cannot provide both `filter` and `this.filter`");
59
+ }
60
+ const _filter = filter ?? this.filter;
50
61
  const matchDocumentsParams = {
62
+ filter: _filter,
51
63
  query_embedding: query,
52
64
  match_count: k,
53
65
  };
@@ -1,7 +1,30 @@
1
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
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.WeaviateStore = exports.flattenObjectForWeaviate = void 0;
4
- const uuid_1 = require("uuid");
27
+ const uuid = __importStar(require("uuid"));
5
28
  const base_js_1 = require("./base.cjs");
6
29
  const document_js_1 = require("../document.cjs");
7
30
  // Note this function is not generic, it is designed specifically for Weaviate
@@ -89,7 +112,7 @@ class WeaviateStore extends base_js_1.VectorStore {
89
112
  const flattenedMetadata = (0, exports.flattenObjectForWeaviate)(document.metadata);
90
113
  return {
91
114
  class: this.indexName,
92
- id: (0, uuid_1.v4)(),
115
+ id: uuid.v4(),
93
116
  vector: vectors[index],
94
117
  properties: {
95
118
  [this.textKey]: document.pageContent,
@@ -1,4 +1,4 @@
1
- import { v4 } from "uuid";
1
+ import * as uuid from "uuid";
2
2
  import { VectorStore } from "./base.js";
3
3
  import { Document } from "../document.js";
4
4
  // Note this function is not generic, it is designed specifically for Weaviate
@@ -85,7 +85,7 @@ export class WeaviateStore extends VectorStore {
85
85
  const flattenedMetadata = flattenObjectForWeaviate(document.metadata);
86
86
  return {
87
87
  class: this.indexName,
88
- id: v4(),
88
+ id: uuid.v4(),
89
89
  vector: vectors[index],
90
90
  properties: {
91
91
  [this.textKey]: document.pageContent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langchain",
3
- "version": "0.0.69",
3
+ "version": "0.0.71",
4
4
  "description": "Typescript bindings for langchain",
5
5
  "type": "module",
6
6
  "engines": {
@@ -330,8 +330,8 @@
330
330
  "@types/object-hash": "^3.0.2",
331
331
  "@types/pdf-parse": "^1.1.1",
332
332
  "@types/uuid": "^9",
333
- "@typescript-eslint/eslint-plugin": "^5.51.0",
334
- "@typescript-eslint/parser": "^5.51.0",
333
+ "@typescript-eslint/eslint-plugin": "^5.58.0",
334
+ "@typescript-eslint/parser": "^5.58.0",
335
335
  "axios": "^0.26.0",
336
336
  "cheerio": "^1.0.0-rc.12",
337
337
  "chromadb": "^1.4.0",
@@ -362,9 +362,9 @@
362
362
  "rollup": "^3.19.1",
363
363
  "sqlite3": "^5.1.4",
364
364
  "srt-parser-2": "^1.2.2",
365
- "ts-jest": "^29.0.5",
365
+ "ts-jest": "^29.1.0",
366
366
  "typeorm": "^0.3.12",
367
- "typescript": "^4.9.5",
367
+ "typescript": "^5.0.0",
368
368
  "weaviate-ts-client": "^1.0.0"
369
369
  },
370
370
  "peerDependencies": {