langchain 0.2.0-rc.1 → 0.2.0

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 (147) hide show
  1. package/dist/agents/executor.cjs +2 -2
  2. package/dist/agents/executor.js +2 -2
  3. package/dist/document_loaders/fs/docx.cjs +2 -0
  4. package/dist/document_loaders/fs/docx.d.ts +2 -0
  5. package/dist/document_loaders/fs/docx.js +2 -0
  6. package/dist/document_loaders/fs/epub.cjs +2 -0
  7. package/dist/document_loaders/fs/epub.d.ts +2 -0
  8. package/dist/document_loaders/fs/epub.js +2 -0
  9. package/dist/document_loaders/fs/notion.cjs +2 -0
  10. package/dist/document_loaders/fs/notion.d.ts +2 -0
  11. package/dist/document_loaders/fs/notion.js +2 -0
  12. package/dist/document_loaders/fs/obsidian.cjs +2 -0
  13. package/dist/document_loaders/fs/obsidian.d.ts +2 -0
  14. package/dist/document_loaders/fs/obsidian.js +2 -0
  15. package/dist/document_loaders/fs/openai_whisper_audio.cjs +2 -0
  16. package/dist/document_loaders/fs/openai_whisper_audio.d.ts +2 -0
  17. package/dist/document_loaders/fs/openai_whisper_audio.js +2 -0
  18. package/dist/document_loaders/fs/pdf.cjs +2 -0
  19. package/dist/document_loaders/fs/pdf.d.ts +2 -0
  20. package/dist/document_loaders/fs/pdf.js +2 -0
  21. package/dist/document_loaders/fs/pptx.cjs +2 -0
  22. package/dist/document_loaders/fs/pptx.d.ts +2 -0
  23. package/dist/document_loaders/fs/pptx.js +2 -0
  24. package/dist/document_loaders/fs/srt.cjs +2 -0
  25. package/dist/document_loaders/fs/srt.d.ts +2 -0
  26. package/dist/document_loaders/fs/srt.js +2 -0
  27. package/dist/document_loaders/fs/unstructured.cjs +3 -1
  28. package/dist/document_loaders/fs/unstructured.d.ts +2 -0
  29. package/dist/document_loaders/fs/unstructured.js +3 -1
  30. package/dist/document_loaders/web/apify_dataset.cjs +1 -0
  31. package/dist/document_loaders/web/apify_dataset.d.ts +2 -0
  32. package/dist/document_loaders/web/apify_dataset.js +1 -0
  33. package/dist/document_loaders/web/assemblyai.cjs +8 -0
  34. package/dist/document_loaders/web/assemblyai.d.ts +8 -0
  35. package/dist/document_loaders/web/assemblyai.js +8 -0
  36. package/dist/document_loaders/web/azure_blob_storage_container.cjs +1 -0
  37. package/dist/document_loaders/web/azure_blob_storage_container.d.ts +1 -0
  38. package/dist/document_loaders/web/azure_blob_storage_container.js +1 -0
  39. package/dist/document_loaders/web/azure_blob_storage_file.cjs +1 -0
  40. package/dist/document_loaders/web/azure_blob_storage_file.d.ts +1 -0
  41. package/dist/document_loaders/web/azure_blob_storage_file.js +1 -0
  42. package/dist/document_loaders/web/cheerio.cjs +2 -0
  43. package/dist/document_loaders/web/cheerio.d.ts +4 -0
  44. package/dist/document_loaders/web/cheerio.js +2 -0
  45. package/dist/document_loaders/web/college_confidential.cjs +2 -0
  46. package/dist/document_loaders/web/college_confidential.d.ts +2 -0
  47. package/dist/document_loaders/web/college_confidential.js +2 -0
  48. package/dist/document_loaders/web/confluence.cjs +2 -0
  49. package/dist/document_loaders/web/confluence.d.ts +8 -0
  50. package/dist/document_loaders/web/confluence.js +2 -0
  51. package/dist/document_loaders/web/couchbase.cjs +2 -0
  52. package/dist/document_loaders/web/couchbase.d.ts +2 -0
  53. package/dist/document_loaders/web/couchbase.js +2 -0
  54. package/dist/document_loaders/web/figma.cjs +2 -0
  55. package/dist/document_loaders/web/figma.d.ts +6 -0
  56. package/dist/document_loaders/web/figma.js +2 -0
  57. package/dist/document_loaders/web/firecrawl.cjs +2 -0
  58. package/dist/document_loaders/web/firecrawl.d.ts +2 -0
  59. package/dist/document_loaders/web/firecrawl.js +2 -0
  60. package/dist/document_loaders/web/gitbook.cjs +2 -0
  61. package/dist/document_loaders/web/gitbook.d.ts +2 -0
  62. package/dist/document_loaders/web/gitbook.js +2 -0
  63. package/dist/document_loaders/web/github.cjs +2 -0
  64. package/dist/document_loaders/web/github.d.ts +6 -0
  65. package/dist/document_loaders/web/github.js +2 -0
  66. package/dist/document_loaders/web/hn.cjs +2 -0
  67. package/dist/document_loaders/web/hn.d.ts +2 -0
  68. package/dist/document_loaders/web/hn.js +2 -0
  69. package/dist/document_loaders/web/imsdb.cjs +2 -0
  70. package/dist/document_loaders/web/imsdb.d.ts +2 -0
  71. package/dist/document_loaders/web/imsdb.js +2 -0
  72. package/dist/document_loaders/web/notionapi.cjs +2 -0
  73. package/dist/document_loaders/web/notionapi.d.ts +5 -0
  74. package/dist/document_loaders/web/notionapi.js +2 -0
  75. package/dist/document_loaders/web/pdf.cjs +2 -0
  76. package/dist/document_loaders/web/pdf.d.ts +2 -0
  77. package/dist/document_loaders/web/pdf.js +2 -0
  78. package/dist/document_loaders/web/playwright.cjs +2 -0
  79. package/dist/document_loaders/web/playwright.d.ts +4 -0
  80. package/dist/document_loaders/web/playwright.js +2 -0
  81. package/dist/document_loaders/web/puppeteer.cjs +2 -0
  82. package/dist/document_loaders/web/puppeteer.d.ts +2 -0
  83. package/dist/document_loaders/web/puppeteer.js +2 -0
  84. package/dist/document_loaders/web/recursive_url.cjs +3 -0
  85. package/dist/document_loaders/web/recursive_url.d.ts +6 -0
  86. package/dist/document_loaders/web/recursive_url.js +3 -0
  87. package/dist/document_loaders/web/s3.cjs +2 -0
  88. package/dist/document_loaders/web/s3.d.ts +4 -0
  89. package/dist/document_loaders/web/s3.js +2 -0
  90. package/dist/document_loaders/web/searchapi.cjs +2 -0
  91. package/dist/document_loaders/web/searchapi.d.ts +2 -0
  92. package/dist/document_loaders/web/searchapi.js +2 -0
  93. package/dist/document_loaders/web/serpapi.cjs +2 -0
  94. package/dist/document_loaders/web/serpapi.d.ts +2 -0
  95. package/dist/document_loaders/web/serpapi.js +2 -0
  96. package/dist/document_loaders/web/sitemap.cjs +3 -0
  97. package/dist/document_loaders/web/sitemap.d.ts +5 -0
  98. package/dist/document_loaders/web/sitemap.js +3 -0
  99. package/dist/document_loaders/web/sonix_audio.cjs +2 -0
  100. package/dist/document_loaders/web/sonix_audio.d.ts +2 -0
  101. package/dist/document_loaders/web/sonix_audio.js +2 -0
  102. package/dist/document_loaders/web/sort_xyz_blockchain.cjs +2 -0
  103. package/dist/document_loaders/web/sort_xyz_blockchain.d.ts +2 -0
  104. package/dist/document_loaders/web/sort_xyz_blockchain.js +2 -0
  105. package/dist/document_loaders/web/youtube.cjs +2 -0
  106. package/dist/document_loaders/web/youtube.d.ts +2 -0
  107. package/dist/document_loaders/web/youtube.js +2 -0
  108. package/dist/experimental/openai_assistant/index.cjs +3 -0
  109. package/dist/experimental/openai_assistant/index.js +3 -0
  110. package/dist/load/import_map.cjs +5 -2
  111. package/dist/load/import_map.d.ts +3 -0
  112. package/dist/load/import_map.js +3 -0
  113. package/dist/load/index.cjs +1 -1
  114. package/dist/load/index.js +1 -1
  115. package/dist/schema/prompt_template.cjs +34 -0
  116. package/dist/schema/prompt_template.d.ts +13 -0
  117. package/dist/schema/prompt_template.js +30 -0
  118. package/dist/schema/query_constructor.cjs +32 -0
  119. package/dist/schema/query_constructor.d.ts +12 -0
  120. package/dist/schema/query_constructor.js +28 -0
  121. package/dist/tools/index.cjs +26 -0
  122. package/dist/tools/index.d.ts +8 -0
  123. package/dist/tools/index.js +8 -0
  124. package/package.json +46 -7
  125. package/prompts/load.cjs +1 -0
  126. package/prompts/load.d.cts +1 -0
  127. package/prompts/load.d.ts +1 -0
  128. package/prompts/load.js +1 -0
  129. package/schema/document.cjs +1 -0
  130. package/schema/document.d.cts +1 -0
  131. package/schema/document.d.ts +1 -0
  132. package/schema/document.js +1 -0
  133. package/schema/prompt_template.cjs +1 -0
  134. package/schema/prompt_template.d.cts +1 -0
  135. package/schema/prompt_template.d.ts +1 -0
  136. package/schema/prompt_template.js +1 -0
  137. package/schema/query_constructor.cjs +1 -0
  138. package/schema/query_constructor.d.cts +1 -0
  139. package/schema/query_constructor.d.ts +1 -0
  140. package/schema/query_constructor.js +1 -0
  141. package/tools.cjs +1 -0
  142. package/tools.d.cts +1 -0
  143. package/tools.d.ts +1 -0
  144. package/tools.js +1 -0
  145. package/dist/load/dynamic_import_map.cjs +0 -8
  146. package/dist/load/dynamic_import_map.d.ts +0 -1
  147. package/dist/load/dynamic_import_map.js +0 -4
@@ -158,10 +158,10 @@ class AgentExecutorIterator extends serializable_1.Serializable {
158
158
  */
159
159
  async onFirstStep() {
160
160
  if (this.iterations === 0) {
161
- const callbackManager = await manager_1.CallbackManager.configure(this.callbacks, this.agentExecutor.callbacks, this.tags, this.agentExecutor.tags, this.metadata, this.agentExecutor.metadata, {
161
+ const callbackManager = await manager_1.CallbackManager.configure(this.callbacks ?? this.config?.callbacks, this.agentExecutor.callbacks, this.tags ?? this.config?.tags, this.agentExecutor.tags, this.metadata ?? this.config?.metadata, this.agentExecutor.metadata, {
162
162
  verbose: this.agentExecutor.verbose,
163
163
  });
164
- this.runManager = await callbackManager?.handleChainStart(this.agentExecutor.toJSON(), this.inputs, undefined, undefined, this.tags, this.metadata, this.runName);
164
+ this.runManager = await callbackManager?.handleChainStart(this.agentExecutor.toJSON(), this.inputs, undefined, undefined, this.tags ?? this.config?.tags, this.metadata ?? this.config?.metadata, this.runName ?? this.config?.runName);
165
165
  }
166
166
  }
167
167
  /**
@@ -155,10 +155,10 @@ export class AgentExecutorIterator extends Serializable {
155
155
  */
156
156
  async onFirstStep() {
157
157
  if (this.iterations === 0) {
158
- const callbackManager = await CallbackManager.configure(this.callbacks, this.agentExecutor.callbacks, this.tags, this.agentExecutor.tags, this.metadata, this.agentExecutor.metadata, {
158
+ const callbackManager = await CallbackManager.configure(this.callbacks ?? this.config?.callbacks, this.agentExecutor.callbacks, this.tags ?? this.config?.tags, this.agentExecutor.tags, this.metadata ?? this.config?.metadata, this.agentExecutor.metadata, {
159
159
  verbose: this.agentExecutor.verbose,
160
160
  });
161
- this.runManager = await callbackManager?.handleChainStart(this.agentExecutor.toJSON(), this.inputs, undefined, undefined, this.tags, this.metadata, this.runName);
161
+ this.runManager = await callbackManager?.handleChainStart(this.agentExecutor.toJSON(), this.inputs, undefined, undefined, this.tags ?? this.config?.tags, this.metadata ?? this.config?.metadata, this.runName ?? this.config?.runName);
162
162
  }
163
163
  }
164
164
  /**
@@ -9,6 +9,8 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
9
9
  newPackageName: "@langchain/community",
10
10
  });
11
11
  /**
12
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/docx" instead. This entrypoint will be removed in 0.3.0.
13
+ *
12
14
  * A class that extends the `BufferLoader` class. It represents a document
13
15
  * loader that loads documents from DOCX files.
14
16
  */
@@ -2,6 +2,8 @@
2
2
  import { Document } from "@langchain/core/documents";
3
3
  import { BufferLoader } from "./buffer.js";
4
4
  /**
5
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/docx" instead. This entrypoint will be removed in 0.3.0.
6
+ *
5
7
  * A class that extends the `BufferLoader` class. It represents a document
6
8
  * loader that loads documents from DOCX files.
7
9
  */
@@ -6,6 +6,8 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
6
6
  newPackageName: "@langchain/community",
7
7
  });
8
8
  /**
9
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/docx" instead. This entrypoint will be removed in 0.3.0.
10
+ *
9
11
  * A class that extends the `BufferLoader` class. It represents a document
10
12
  * loader that loads documents from DOCX files.
11
13
  */
@@ -9,6 +9,8 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
9
9
  newPackageName: "@langchain/community",
10
10
  });
11
11
  /**
12
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/epub" instead. This entrypoint will be removed in 0.3.0.
13
+ *
12
14
  * A class that extends the `BaseDocumentLoader` class. It represents a
13
15
  * document loader that loads documents from EPUB files.
14
16
  */
@@ -2,6 +2,8 @@ import type { EPub } from "epub2";
2
2
  import { Document } from "@langchain/core/documents";
3
3
  import { BaseDocumentLoader } from "../base.js";
4
4
  /**
5
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/epub" instead. This entrypoint will be removed in 0.3.0.
6
+ *
5
7
  * A class that extends the `BaseDocumentLoader` class. It represents a
6
8
  * document loader that loads documents from EPUB files.
7
9
  */
@@ -6,6 +6,8 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
6
6
  newPackageName: "@langchain/community",
7
7
  });
8
8
  /**
9
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/epub" instead. This entrypoint will be removed in 0.3.0.
10
+ *
9
11
  * A class that extends the `BaseDocumentLoader` class. It represents a
10
12
  * document loader that loads documents from EPUB files.
11
13
  */
@@ -9,6 +9,8 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
9
9
  newPackageName: "@langchain/community",
10
10
  });
11
11
  /**
12
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/notion" instead. This entrypoint will be removed in 0.3.0.
13
+ *
12
14
  * A class that extends the DirectoryLoader class. It represents a
13
15
  * document loader that loads documents from a directory in the Notion
14
16
  * format. It uses the TextLoader for loading '.md' files and ignores
@@ -1,5 +1,7 @@
1
1
  import { DirectoryLoader } from "./directory.js";
2
2
  /**
3
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/notion" instead. This entrypoint will be removed in 0.3.0.
4
+ *
3
5
  * A class that extends the DirectoryLoader class. It represents a
4
6
  * document loader that loads documents from a directory in the Notion
5
7
  * format. It uses the TextLoader for loading '.md' files and ignores
@@ -6,6 +6,8 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
6
6
  newPackageName: "@langchain/community",
7
7
  });
8
8
  /**
9
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/notion" instead. This entrypoint will be removed in 0.3.0.
10
+ *
9
11
  * A class that extends the DirectoryLoader class. It represents a
10
12
  * document loader that loads documents from a directory in the Notion
11
13
  * format. It uses the TextLoader for loading '.md' files and ignores
@@ -225,6 +225,8 @@ Object.defineProperty(ObsidianFileLoader, "DATAVIEW_INLINE_PAREN_REGEX", {
225
225
  value: /\((\w+)::\s*(.*)\)/gm
226
226
  });
227
227
  /**
228
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/obsidian" instead. This entrypoint will be removed in 0.3.0.
229
+ *
228
230
  * Represents a loader for directories containing Obsidian markdown files. This loader extends
229
231
  * the DirectoryLoader and provides functionality to load and parse '.md' files with YAML frontmatter,
230
232
  * Obsidian tags, and Dataview fields.
@@ -11,6 +11,8 @@ export interface ObsidianFileLoaderOptions {
11
11
  collectMetadata?: boolean;
12
12
  }
13
13
  /**
14
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/obsidian" instead. This entrypoint will be removed in 0.3.0.
15
+ *
14
16
  * Represents a loader for directories containing Obsidian markdown files. This loader extends
15
17
  * the DirectoryLoader and provides functionality to load and parse '.md' files with YAML frontmatter,
16
18
  * Obsidian tags, and Dataview fields.
@@ -219,6 +219,8 @@ Object.defineProperty(ObsidianFileLoader, "DATAVIEW_INLINE_PAREN_REGEX", {
219
219
  value: /\((\w+)::\s*(.*)\)/gm
220
220
  });
221
221
  /**
222
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/obsidian" instead. This entrypoint will be removed in 0.3.0.
223
+ *
222
224
  * Represents a loader for directories containing Obsidian markdown files. This loader extends
223
225
  * the DirectoryLoader and provides functionality to load and parse '.md' files with YAML frontmatter,
224
226
  * Obsidian tags, and Dataview fields.
@@ -11,6 +11,8 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
11
11
  });
12
12
  const MODEL_NAME = "whisper-1";
13
13
  /**
14
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/openai_whisper_audio" instead. This entrypoint will be removed in 0.3.0.
15
+ *
14
16
  * @example
15
17
  * ```typescript
16
18
  * const loader = new OpenAIWhisperAudio(
@@ -3,6 +3,8 @@ import { type ClientOptions } from "@langchain/openai";
3
3
  import { Document } from "@langchain/core/documents";
4
4
  import { BufferLoader } from "./buffer.js";
5
5
  /**
6
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/openai_whisper_audio" instead. This entrypoint will be removed in 0.3.0.
7
+ *
6
8
  * @example
7
9
  * ```typescript
8
10
  * const loader = new OpenAIWhisperAudio(
@@ -8,6 +8,8 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
8
8
  });
9
9
  const MODEL_NAME = "whisper-1";
10
10
  /**
11
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/openai_whisper_audio" instead. This entrypoint will be removed in 0.3.0.
12
+ *
11
13
  * @example
12
14
  * ```typescript
13
15
  * const loader = new OpenAIWhisperAudio(
@@ -10,6 +10,8 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
10
10
  newPackageName: "@langchain/community",
11
11
  });
12
12
  /**
13
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/pdf" instead. This entrypoint will be removed in 0.3.0.
14
+ *
13
15
  * A class that extends the `BufferLoader` class. It represents a document
14
16
  * loader that loads documents from PDF files.
15
17
  * @example
@@ -3,6 +3,8 @@
3
3
  import { Document } from "@langchain/core/documents";
4
4
  import { BufferLoader } from "./buffer.js";
5
5
  /**
6
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/pdf" instead. This entrypoint will be removed in 0.3.0.
7
+ *
6
8
  * A class that extends the `BufferLoader` class. It represents a document
7
9
  * loader that loads documents from PDF files.
8
10
  * @example
@@ -7,6 +7,8 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
7
7
  newPackageName: "@langchain/community",
8
8
  });
9
9
  /**
10
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/pdf" instead. This entrypoint will be removed in 0.3.0.
11
+ *
10
12
  * A class that extends the `BufferLoader` class. It represents a document
11
13
  * loader that loads documents from PDF files.
12
14
  * @example
@@ -10,6 +10,8 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
10
10
  newPackageName: "@langchain/community",
11
11
  });
12
12
  /**
13
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/pptx" instead. This entrypoint will be removed in 0.3.0.
14
+ *
13
15
  * A class that extends the `BufferLoader` class. It represents a document
14
16
  * loader that loads documents from PDF files.
15
17
  */
@@ -2,6 +2,8 @@
2
2
  import { Document } from "@langchain/core/documents";
3
3
  import { BufferLoader } from "./buffer.js";
4
4
  /**
5
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/pptx" instead. This entrypoint will be removed in 0.3.0.
6
+ *
5
7
  * A class that extends the `BufferLoader` class. It represents a document
6
8
  * loader that loads documents from PDF files.
7
9
  */
@@ -7,6 +7,8 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
7
7
  newPackageName: "@langchain/community",
8
8
  });
9
9
  /**
10
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/pptx" instead. This entrypoint will be removed in 0.3.0.
11
+ *
10
12
  * A class that extends the `BufferLoader` class. It represents a document
11
13
  * loader that loads documents from PDF files.
12
14
  */
@@ -12,6 +12,8 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
12
12
  newPackageName: "@langchain/community",
13
13
  });
14
14
  /**
15
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/srt" instead. This entrypoint will be removed in 0.3.0.
16
+ *
15
17
  * A class that extends the `TextLoader` class. It represents a document
16
18
  * loader that loads documents from SRT (SubRip) subtitle files. It has a
17
19
  * constructor that takes a `filePathOrBlob` parameter representing the
@@ -1,5 +1,7 @@
1
1
  import { TextLoader } from "./text.js";
2
2
  /**
3
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/srt" instead. This entrypoint will be removed in 0.3.0.
4
+ *
3
5
  * A class that extends the `TextLoader` class. It represents a document
4
6
  * loader that loads documents from SRT (SubRip) subtitle files. It has a
5
7
  * constructor that takes a `filePathOrBlob` parameter representing the
@@ -6,6 +6,8 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
6
6
  newPackageName: "@langchain/community",
7
7
  });
8
8
  /**
9
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/srt" instead. This entrypoint will be removed in 0.3.0.
10
+ *
9
11
  * A class that extends the `TextLoader` class. It represents a document
10
12
  * loader that loads documents from SRT (SubRip) subtitle files. It has a
11
13
  * constructor that takes a `filePathOrBlob` parameter representing the
@@ -33,6 +33,8 @@ const UNSTRUCTURED_API_FILETYPES = [
33
33
  ".epub",
34
34
  ];
35
35
  /**
36
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/unstructured" instead. This entrypoint will be removed in 0.3.0.
37
+ *
36
38
  * A document loader that uses the Unstructured API to load unstructured
37
39
  * documents. It supports both the new syntax with options object and the
38
40
  * legacy syntax for backward compatibility. The load() method sends a
@@ -244,7 +246,7 @@ class UnstructuredLoader extends base_js_1.BaseDocumentLoader {
244
246
  const documents = [];
245
247
  for (const element of elements) {
246
248
  const { metadata, text } = element;
247
- if (typeof text === "string") {
249
+ if (typeof text === "string" && text !== "") {
248
250
  documents.push(new documents_1.Document({
249
251
  pageContent: text,
250
252
  metadata: {
@@ -64,6 +64,8 @@ type UnstructuredDirectoryLoaderOptions = UnstructuredLoaderOptions & {
64
64
  unknown?: UnknownHandling;
65
65
  };
66
66
  /**
67
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/unstructured" instead. This entrypoint will be removed in 0.3.0.
68
+ *
67
69
  * A document loader that uses the Unstructured API to load unstructured
68
70
  * documents. It supports both the new syntax with options object and the
69
71
  * legacy syntax for backward compatibility. The load() method sends a
@@ -29,6 +29,8 @@ const UNSTRUCTURED_API_FILETYPES = [
29
29
  ".epub",
30
30
  ];
31
31
  /**
32
+ * @deprecated - Import from "@langchain/community/document_loaders/fs/unstructured" instead. This entrypoint will be removed in 0.3.0.
33
+ *
32
34
  * A document loader that uses the Unstructured API to load unstructured
33
35
  * documents. It supports both the new syntax with options object and the
34
36
  * legacy syntax for backward compatibility. The load() method sends a
@@ -240,7 +242,7 @@ export class UnstructuredLoader extends BaseDocumentLoader {
240
242
  const documents = [];
241
243
  for (const element of elements) {
242
244
  const { metadata, text } = element;
243
- if (typeof text === "string") {
245
+ if (typeof text === "string" && text !== "") {
244
246
  documents.push(new Document({
245
247
  pageContent: text,
246
248
  metadata: {
@@ -12,6 +12,7 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
12
12
  newPackageName: "@langchain/community",
13
13
  });
14
14
  /**
15
+ * @deprecated - Import from "@langchain/community/document_loaders/web/apify_dataset" instead. This entrypoint will be removed in 0.3.0.
15
16
  * A class that extends the BaseDocumentLoader and implements the
16
17
  * DocumentLoader interface. It represents a document loader that loads
17
18
  * documents from an Apify dataset.
@@ -3,6 +3,7 @@ import { Document } from "@langchain/core/documents";
3
3
  import { AsyncCaller, AsyncCallerParams } from "@langchain/core/utils/async_caller";
4
4
  import { BaseDocumentLoader, DocumentLoader } from "../base.js";
5
5
  /**
6
+ * @deprecated - Import from "@langchain/community/document_loaders/web/apify_dataset" instead. This entrypoint will be removed in 0.3.0.
6
7
  * A type that represents a function that takes a single object (an Apify
7
8
  * dataset item) and converts it to an instance of the Document class.
8
9
  *
@@ -15,6 +16,7 @@ export interface ApifyDatasetLoaderConfig<Metadata extends Record<string, any>>
15
16
  clientOptions?: ApifyClientOptions;
16
17
  }
17
18
  /**
19
+ * @deprecated - Import from "@langchain/community/document_loaders/web/apify_dataset" instead. This entrypoint will be removed in 0.3.0.
18
20
  * A class that extends the BaseDocumentLoader and implements the
19
21
  * DocumentLoader interface. It represents a document loader that loads
20
22
  * documents from an Apify dataset.
@@ -9,6 +9,7 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
9
9
  newPackageName: "@langchain/community",
10
10
  });
11
11
  /**
12
+ * @deprecated - Import from "@langchain/community/document_loaders/web/apify_dataset" instead. This entrypoint will be removed in 0.3.0.
12
13
  * A class that extends the BaseDocumentLoader and implements the
13
14
  * DocumentLoader interface. It represents a document loader that loads
14
15
  * documents from an Apify dataset.
@@ -11,6 +11,7 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
11
11
  newPackageName: "@langchain/community",
12
12
  });
13
13
  /**
14
+ * @deprecated
14
15
  * Base class for AssemblyAI loaders.
15
16
  */
16
17
  class AssemblyAILoader extends base_js_1.BaseDocumentLoader {
@@ -40,6 +41,9 @@ class AssemblyAILoader extends base_js_1.BaseDocumentLoader {
40
41
  this.client = new assemblyai_1.AssemblyAI(options);
41
42
  }
42
43
  }
44
+ /**
45
+ * @deprecated
46
+ */
43
47
  class CreateTranscriptLoader extends AssemblyAILoader {
44
48
  /**
45
49
  * Transcribe audio or retrieve an existing transcript by its ID.
@@ -91,6 +95,7 @@ class CreateTranscriptLoader extends AssemblyAILoader {
91
95
  }
92
96
  }
93
97
  /**
98
+ * @deprecated - Import from "@langchain/community/document_loaders/web/assemblyai" instead. This entrypoint will be removed in 0.3.0.
94
99
  * Transcribe audio and load the transcript as a document using AssemblyAI.
95
100
  */
96
101
  class AudioTranscriptLoader extends CreateTranscriptLoader {
@@ -111,6 +116,7 @@ class AudioTranscriptLoader extends CreateTranscriptLoader {
111
116
  }
112
117
  exports.AudioTranscriptLoader = AudioTranscriptLoader;
113
118
  /**
119
+ * @deprecated - Import from "@langchain/community/document_loaders/web/assemblyai" instead. This entrypoint will be removed in 0.3.0.
114
120
  * Transcribe audio and load the paragraphs of the transcript, creating a document for each paragraph.
115
121
  */
116
122
  class AudioTranscriptParagraphsLoader extends CreateTranscriptLoader {
@@ -129,6 +135,7 @@ class AudioTranscriptParagraphsLoader extends CreateTranscriptLoader {
129
135
  }
130
136
  exports.AudioTranscriptParagraphsLoader = AudioTranscriptParagraphsLoader;
131
137
  /**
138
+ * @deprecated - Import from "@langchain/community/document_loaders/web/assemblyai" instead. This entrypoint will be removed in 0.3.0.
132
139
  * Transcribe audio and load the sentences of the transcript, creating a document for each sentence.
133
140
  */
134
141
  class AudioTranscriptSentencesLoader extends CreateTranscriptLoader {
@@ -147,6 +154,7 @@ class AudioTranscriptSentencesLoader extends CreateTranscriptLoader {
147
154
  }
148
155
  exports.AudioTranscriptSentencesLoader = AudioTranscriptSentencesLoader;
149
156
  /**
157
+ * @deprecated - Import from "@langchain/community/document_loaders/web/assemblyai" instead. This entrypoint will be removed in 0.3.0.
150
158
  * Transcribe audio and load subtitles for the transcript as `srt` or `vtt` format.
151
159
  */
152
160
  class AudioSubtitleLoader extends CreateTranscriptLoader {
@@ -4,6 +4,7 @@ import { BaseDocumentLoader } from "../base.js";
4
4
  import { AssemblyAIOptions } from "../../types/assemblyai-types.js";
5
5
  export type * from "../../types/assemblyai-types.js";
6
6
  /**
7
+ * @deprecated
7
8
  * Base class for AssemblyAI loaders.
8
9
  */
9
10
  declare abstract class AssemblyAILoader extends BaseDocumentLoader {
@@ -15,6 +16,9 @@ declare abstract class AssemblyAILoader extends BaseDocumentLoader {
15
16
  */
16
17
  constructor(assemblyAIOptions?: AssemblyAIOptions);
17
18
  }
19
+ /**
20
+ * @deprecated
21
+ */
18
22
  declare abstract class CreateTranscriptLoader extends AssemblyAILoader {
19
23
  protected transcribeParams?: TranscribeParams | CreateTranscriptParameters;
20
24
  protected transcriptId?: string;
@@ -28,6 +32,7 @@ declare abstract class CreateTranscriptLoader extends AssemblyAILoader {
28
32
  protected transcribeOrGetTranscript(): Promise<Transcript>;
29
33
  }
30
34
  /**
35
+ * @deprecated - Import from "@langchain/community/document_loaders/web/assemblyai" instead. This entrypoint will be removed in 0.3.0.
31
36
  * Transcribe audio and load the transcript as a document using AssemblyAI.
32
37
  */
33
38
  export declare class AudioTranscriptLoader extends CreateTranscriptLoader {
@@ -39,6 +44,7 @@ export declare class AudioTranscriptLoader extends CreateTranscriptLoader {
39
44
  load(): Promise<Document<Transcript>[]>;
40
45
  }
41
46
  /**
47
+ * @deprecated - Import from "@langchain/community/document_loaders/web/assemblyai" instead. This entrypoint will be removed in 0.3.0.
42
48
  * Transcribe audio and load the paragraphs of the transcript, creating a document for each paragraph.
43
49
  */
44
50
  export declare class AudioTranscriptParagraphsLoader extends CreateTranscriptLoader {
@@ -49,6 +55,7 @@ export declare class AudioTranscriptParagraphsLoader extends CreateTranscriptLoa
49
55
  load(): Promise<Document<TranscriptParagraph>[]>;
50
56
  }
51
57
  /**
58
+ * @deprecated - Import from "@langchain/community/document_loaders/web/assemblyai" instead. This entrypoint will be removed in 0.3.0.
52
59
  * Transcribe audio and load the sentences of the transcript, creating a document for each sentence.
53
60
  */
54
61
  export declare class AudioTranscriptSentencesLoader extends CreateTranscriptLoader {
@@ -59,6 +66,7 @@ export declare class AudioTranscriptSentencesLoader extends CreateTranscriptLoad
59
66
  load(): Promise<Document<TranscriptSentence>[]>;
60
67
  }
61
68
  /**
69
+ * @deprecated - Import from "@langchain/community/document_loaders/web/assemblyai" instead. This entrypoint will be removed in 0.3.0.
62
70
  * Transcribe audio and load subtitles for the transcript as `srt` or `vtt` format.
63
71
  */
64
72
  export declare class AudioSubtitleLoader extends CreateTranscriptLoader {
@@ -8,6 +8,7 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
8
8
  newPackageName: "@langchain/community",
9
9
  });
10
10
  /**
11
+ * @deprecated
11
12
  * Base class for AssemblyAI loaders.
12
13
  */
13
14
  class AssemblyAILoader extends BaseDocumentLoader {
@@ -37,6 +38,9 @@ class AssemblyAILoader extends BaseDocumentLoader {
37
38
  this.client = new AssemblyAI(options);
38
39
  }
39
40
  }
41
+ /**
42
+ * @deprecated
43
+ */
40
44
  class CreateTranscriptLoader extends AssemblyAILoader {
41
45
  /**
42
46
  * Transcribe audio or retrieve an existing transcript by its ID.
@@ -88,6 +92,7 @@ class CreateTranscriptLoader extends AssemblyAILoader {
88
92
  }
89
93
  }
90
94
  /**
95
+ * @deprecated - Import from "@langchain/community/document_loaders/web/assemblyai" instead. This entrypoint will be removed in 0.3.0.
91
96
  * Transcribe audio and load the transcript as a document using AssemblyAI.
92
97
  */
93
98
  export class AudioTranscriptLoader extends CreateTranscriptLoader {
@@ -107,6 +112,7 @@ export class AudioTranscriptLoader extends CreateTranscriptLoader {
107
112
  }
108
113
  }
109
114
  /**
115
+ * @deprecated - Import from "@langchain/community/document_loaders/web/assemblyai" instead. This entrypoint will be removed in 0.3.0.
110
116
  * Transcribe audio and load the paragraphs of the transcript, creating a document for each paragraph.
111
117
  */
112
118
  export class AudioTranscriptParagraphsLoader extends CreateTranscriptLoader {
@@ -124,6 +130,7 @@ export class AudioTranscriptParagraphsLoader extends CreateTranscriptLoader {
124
130
  }
125
131
  }
126
132
  /**
133
+ * @deprecated - Import from "@langchain/community/document_loaders/web/assemblyai" instead. This entrypoint will be removed in 0.3.0.
127
134
  * Transcribe audio and load the sentences of the transcript, creating a document for each sentence.
128
135
  */
129
136
  export class AudioTranscriptSentencesLoader extends CreateTranscriptLoader {
@@ -141,6 +148,7 @@ export class AudioTranscriptSentencesLoader extends CreateTranscriptLoader {
141
148
  }
142
149
  }
143
150
  /**
151
+ * @deprecated - Import from "@langchain/community/document_loaders/web/assemblyai" instead. This entrypoint will be removed in 0.3.0.
144
152
  * Transcribe audio and load subtitles for the transcript as `srt` or `vtt` format.
145
153
  */
146
154
  export class AudioSubtitleLoader extends CreateTranscriptLoader {
@@ -10,6 +10,7 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
10
10
  newPackageName: "@langchain/community",
11
11
  });
12
12
  /**
13
+ * @deprecated - Import from "@langchain/community/document_loaders/web/azure_blog_storage_container" instead. This entrypoint will be removed in 0.3.0.
13
14
  * Class representing a document loader that loads documents from an Azure
14
15
  * Blob Storage container. It extends the BaseDocumentLoader class.
15
16
  */
@@ -23,6 +23,7 @@ interface AzureBlobStorageContainerLoaderConfig {
23
23
  unstructuredConfig?: UnstructuredLoaderOptions;
24
24
  }
25
25
  /**
26
+ * @deprecated - Import from "@langchain/community/document_loaders/web/azure_blog_storage_container" instead. This entrypoint will be removed in 0.3.0.
26
27
  * Class representing a document loader that loads documents from an Azure
27
28
  * Blob Storage container. It extends the BaseDocumentLoader class.
28
29
  */
@@ -7,6 +7,7 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
7
7
  newPackageName: "@langchain/community",
8
8
  });
9
9
  /**
10
+ * @deprecated - Import from "@langchain/community/document_loaders/web/azure_blog_storage_container" instead. This entrypoint will be removed in 0.3.0.
10
11
  * Class representing a document loader that loads documents from an Azure
11
12
  * Blob Storage container. It extends the BaseDocumentLoader class.
12
13
  */
@@ -36,6 +36,7 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
36
36
  newPackageName: "@langchain/community",
37
37
  });
38
38
  /**
39
+ * @deprecated - Import from "@langchain/community/document_loaders/web/azure_blog_storage_file" instead. This entrypoint will be removed in 0.3.0.
39
40
  * Class representing a document loader that loads a specific file from
40
41
  * Azure Blob Storage. It extends the BaseDocumentLoader class and
41
42
  * implements the DocumentLoader interface.
@@ -19,6 +19,7 @@ interface AzureBlobStorageFileLoaderConfig {
19
19
  unstructuredConfig?: UnstructuredLoaderOptions;
20
20
  }
21
21
  /**
22
+ * @deprecated - Import from "@langchain/community/document_loaders/web/azure_blog_storage_file" instead. This entrypoint will be removed in 0.3.0.
22
23
  * Class representing a document loader that loads a specific file from
23
24
  * Azure Blob Storage. It extends the BaseDocumentLoader class and
24
25
  * implements the DocumentLoader interface.
@@ -10,6 +10,7 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
10
10
  newPackageName: "@langchain/community",
11
11
  });
12
12
  /**
13
+ * @deprecated - Import from "@langchain/community/document_loaders/web/azure_blog_storage_file" instead. This entrypoint will be removed in 0.3.0.
13
14
  * Class representing a document loader that loads a specific file from
14
15
  * Azure Blob Storage. It extends the BaseDocumentLoader class and
15
16
  * implements the DocumentLoader interface.
@@ -10,6 +10,8 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
10
10
  newPackageName: "@langchain/community",
11
11
  });
12
12
  /**
13
+ * @deprecated - Import from "@langchain/community/document_loaders/web/cheerio" instead. This entrypoint will be removed in 0.3.0.
14
+ *
13
15
  * A class that extends the BaseDocumentLoader and implements the
14
16
  * DocumentLoader interface. It represents a document loader for loading
15
17
  * web-based documents using Cheerio.
@@ -4,6 +4,8 @@ import { AsyncCaller, AsyncCallerParams } from "@langchain/core/utils/async_call
4
4
  import { BaseDocumentLoader } from "../base.js";
5
5
  import type { DocumentLoader } from "../base.js";
6
6
  /**
7
+ * @deprecated - Import from "@langchain/community/document_loaders/web/cheerio" instead. This entrypoint will be removed in 0.3.0.
8
+ *
7
9
  * Represents the parameters for configuring the CheerioWebBaseLoader. It
8
10
  * extends the AsyncCallerParams interface and adds additional parameters
9
11
  * specific to web-based loaders.
@@ -24,6 +26,8 @@ export interface WebBaseLoaderParams extends AsyncCallerParams {
24
26
  textDecoder?: TextDecoder;
25
27
  }
26
28
  /**
29
+ * @deprecated - Import from "@langchain/community/document_loaders/web/cheerio" instead. This entrypoint will be removed in 0.3.0.
30
+ *
27
31
  * A class that extends the BaseDocumentLoader and implements the
28
32
  * DocumentLoader interface. It represents a document loader for loading
29
33
  * web-based documents using Cheerio.
@@ -7,6 +7,8 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
7
7
  newPackageName: "@langchain/community",
8
8
  });
9
9
  /**
10
+ * @deprecated - Import from "@langchain/community/document_loaders/web/cheerio" instead. This entrypoint will be removed in 0.3.0.
11
+ *
10
12
  * A class that extends the BaseDocumentLoader and implements the
11
13
  * DocumentLoader interface. It represents a document loader for loading
12
14
  * web-based documents using Cheerio.
@@ -9,6 +9,8 @@ const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.c
9
9
  newPackageName: "@langchain/community",
10
10
  });
11
11
  /**
12
+ * @deprecated - Import from "@langchain/community/document_loaders/web/college_confidential" instead. This entrypoint will be removed in 0.3.0.
13
+ *
12
14
  * A document loader specifically designed for loading documents from the
13
15
  * College Confidential website. It extends the CheerioWebBaseLoader.
14
16
  * @example
@@ -1,6 +1,8 @@
1
1
  import { Document } from "@langchain/core/documents";
2
2
  import { CheerioWebBaseLoader } from "./cheerio.js";
3
3
  /**
4
+ * @deprecated - Import from "@langchain/community/document_loaders/web/college_confidential" instead. This entrypoint will be removed in 0.3.0.
5
+ *
4
6
  * A document loader specifically designed for loading documents from the
5
7
  * College Confidential website. It extends the CheerioWebBaseLoader.
6
8
  * @example
@@ -6,6 +6,8 @@ import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation
6
6
  newPackageName: "@langchain/community",
7
7
  });
8
8
  /**
9
+ * @deprecated - Import from "@langchain/community/document_loaders/web/college_confidential" instead. This entrypoint will be removed in 0.3.0.
10
+ *
9
11
  * A document loader specifically designed for loading documents from the
10
12
  * College Confidential website. It extends the CheerioWebBaseLoader.
11
13
  * @example