forked from langchain-ai/langchainjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API key support to Unstructured loaders (langchain-ai#1128)
* feat: support unstructured api key in loader * add API key to instructions and examples * change api key order * update integration tests * retrigger build * default web path to hosted api * moved api key to an options argument * interface for unstructured options * linting, linting, linting * refactor loaders into mapping * move webpath to options * update function calls in test * fix examples * linting, linting, linting ... * Adds shim for existing Unstructured users * Remove bad content type header from Unstructured API call * Fix md formatting * Small fixes * Move additional UnstructuredDirectoryLoader constructor options into an options object * Remove extra unnecessary declaration --------- Co-authored-by: Matt Robinson <[email protected]> Co-authored-by: Matt Robinson <[email protected]> Co-authored-by: Jacob Lee <[email protected]> Co-authored-by: Nuno Campos <[email protected]>
- Loading branch information
1 parent
3495a79
commit 4e22af2
Showing
8 changed files
with
164 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import { UnstructuredLoader } from "langchain/document_loaders/fs/unstructured"; | ||
|
||
const options = { | ||
apiKey: "MY_API_KEY", | ||
}; | ||
|
||
const loader = new UnstructuredLoader( | ||
"https://api.unstructured.io/general/v0/general", | ||
"src/document_loaders/example_data/notion.md" | ||
"src/document_loaders/example_data/notion.md", | ||
options | ||
); | ||
const docs = await loader.load(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import { UnstructuredDirectoryLoader } from "langchain/document_loaders/fs/unstructured"; | ||
|
||
const options = { | ||
apiKey: "MY_API_KEY", | ||
}; | ||
|
||
const loader = new UnstructuredDirectoryLoader( | ||
"https://api.unstructured.io/general/v0/general", | ||
"langchain/src/document_loaders/tests/example_data" | ||
"langchain/src/document_loaders/tests/example_data", | ||
options | ||
); | ||
const docs = await loader.load(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters