Skip to content

Commit

Permalink
docs[patch]: Update deprecated entrypoints (#5808)
Browse files Browse the repository at this point in the history
* Update deprecated entrypoints

* Fix build

* Fix
  • Loading branch information
jacoblee93 authored Jun 19, 2024
1 parent 387fe31 commit 592215d
Show file tree
Hide file tree
Showing 104 changed files with 137 additions and 137 deletions.
2 changes: 1 addition & 1 deletion docs/core_docs/docs/concepts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ Each DocumentLoader has its own specific parameters, but they can all be invoked
An example use case is as follows:

```typescript
import { CSVLoader } from "langchain/document_loaders/fs/csv";
import { CSVLoader } from "@langchain/community/document_loaders/fs/csv";

const loader = new CSVLoader();
// <-- Integration specific parameters here
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/chatbots_retrieval.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
],
"source": [
"import \"cheerio\";\n",
"import { CheerioWebBaseLoader } from \"langchain/document_loaders/web/cheerio\";\n",
"import { CheerioWebBaseLoader } from \"@langchain/community/document_loaders/web/cheerio\";\n",
"\n",
"const loader = new CheerioWebBaseLoader(\n",
" \"https://docs.smith.langchain.com/user_guide\"\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/core_docs/docs/how_to/document_loader_csv.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ id,text
Example code:

```typescript
import { CSVLoader } from "langchain/document_loaders/fs/csv";
import { CSVLoader } from "@langchain/community/document_loaders/fs/csv";

const loader = new CSVLoader("src/document_loaders/example_data/example.csv");

Expand Down Expand Up @@ -63,7 +63,7 @@ id,text
Example code:

```typescript
import { CSVLoader } from "langchain/document_loaders/fs/csv";
import { CSVLoader } from "@langchain/community/document_loaders/fs/csv";

const loader = new CSVLoader(
"src/document_loaders/example_data/example.csv",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/document_loader_directory.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
JSONLinesLoader,
} from "langchain/document_loaders/fs/json";
import { TextLoader } from "langchain/document_loaders/fs/text";
import { CSVLoader } from "langchain/document_loaders/fs/csv";
import { CSVLoader } from "@langchain/community/document_loaders/fs/csv";

const loader = new DirectoryLoader(
"src/document_loaders/example_data/example",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/extraction_long_text.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
}
],
"source": [
"import { CheerioWebBaseLoader } from \"langchain/document_loaders/web/cheerio\";\n",
"import { CheerioWebBaseLoader } from \"@langchain/community/document_loaders/web/cheerio\";\n",
"// Only required in a Deno notebook environment to load the peer dep.\n",
"import \"cheerio\";\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/qa_chat_history_how_to.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"outputs": [],
"source": [
"import \"cheerio\";\n",
"import { CheerioWebBaseLoader } from \"langchain/document_loaders/web/cheerio\";\n",
"import { CheerioWebBaseLoader } from \"@langchain/community/document_loaders/web/cheerio\";\n",
"import { RecursiveCharacterTextSplitter } from \"langchain/text_splitter\";\n",
"import { MemoryVectorStore } from \"langchain/vectorstores/memory\"\n",
"import { OpenAIEmbeddings, ChatOpenAI } from \"@langchain/openai\";\n",
Expand Down
10 changes: 5 additions & 5 deletions docs/core_docs/docs/how_to/qa_sources.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
{
"data": {
"text/plain": [
"\u001b[32m\"Task decomposition is a technique used to break down complex tasks into smaller and simpler steps. T\"\u001b[39m... 287 more characters"
"\u001b[32m\"Task decomposition is a technique used to break down complex tasks into smaller and simpler steps. T\"\u001b[39m... 254 more characters"
]
},
"execution_count": 3,
Expand All @@ -168,7 +168,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -213,11 +213,11 @@
" }\n",
" }\n",
" ],\n",
" answer: \u001b[32m\"Task decomposition is a technique used to break down complex tasks into smaller and simpler steps fo\"\u001b[39m... 232 more characters\n",
" answer: \u001b[32m\"Task decomposition is a technique used to break down complex tasks into smaller and simpler steps fo\"\u001b[39m... 230 more characters\n",
"}"
]
},
"execution_count": 12,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -257,7 +257,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Check out the [LangSmith trace](https://smith.langchain.com/public/f07e78b6-cafc-41fd-af54-892c92263b09/r) here to see the internals of the chain.\n",
"Check out the [LangSmith trace](https://smith.langchain.com/public/c3753531-563c-40d4-a6bf-21bfe8741d10/r) here to see the internals of the chain.\n",
"\n",
"## Next steps\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/qa_streaming.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
],
"source": [
"import \"cheerio\";\n",
"import { CheerioWebBaseLoader } from \"langchain/document_loaders/web/cheerio\";\n",
"import { CheerioWebBaseLoader } from \"@langchain/community/document_loaders/web/cheerio\";\n",
"import { RecursiveCharacterTextSplitter } from \"langchain/text_splitter\";\n",
"import { MemoryVectorStore } from \"langchain/vectorstores/memory\"\n",
"import { OpenAIEmbeddings, ChatOpenAI } from \"@langchain/openai\";\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This example goes over how to load conversations.json from your ChatGPT data exp
Example code:

```typescript
import { ChatGPTLoader } from "langchain/document_loaders/fs/chatgpt";
import { ChatGPTLoader } from "@langchain/community/document_loaders/fs/chatgpt";

const loader = new ChatGPTLoader("./example_data/example_conversations.json");

Expand All @@ -21,7 +21,7 @@ console.log(docs);
Example code:

```typescript
import { ChatGPTLoader } from "langchain/document_loaders/fs/chatgpt";
import { ChatGPTLoader } from "@langchain/community/document_loaders/fs/chatgpt";

const loader = new ChatGPTLoader(
"./example_data/example_conversations.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ id,text
Example code:

```typescript
import { CSVLoader } from "langchain/document_loaders/fs/csv";
import { CSVLoader } from "@langchain/community/document_loaders/fs/csv";

const loader = new CSVLoader("src/document_loaders/example_data/example.csv");

Expand Down Expand Up @@ -61,7 +61,7 @@ id,text
Example code:

```typescript
import { CSVLoader } from "langchain/document_loaders/fs/csv";
import { CSVLoader } from "@langchain/community/document_loaders/fs/csv";

const loader = new CSVLoader(
"src/document_loaders/example_data/example.csv",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
JSONLinesLoader,
} from "langchain/document_loaders/fs/json";
import { TextLoader } from "langchain/document_loaders/fs/text";
import { CSVLoader } from "langchain/document_loaders/fs/csv";
import { CSVLoader } from "@langchain/community/document_loaders/fs/csv";

const loader = new DirectoryLoader(
"src/document_loaders/example_data/example",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install mammoth
# Usage

```typescript
import { DocxLoader } from "langchain/document_loaders/fs/docx";
import { DocxLoader } from "@langchain/community/document_loaders/fs/docx";

const loader = new DocxLoader(
"src/document_loaders/tests/example_data/attention.docx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install epub2 html-to-text
# Usage, one document per chapter

```typescript
import { EPubLoader } from "langchain/document_loaders/fs/epub";
import { EPubLoader } from "@langchain/community/document_loaders/fs/epub";

const loader = new EPubLoader("src/document_loaders/example_data/example.epub");

Expand All @@ -25,7 +25,7 @@ const docs = await loader.load();
# Usage, one document per file

```typescript
import { EPubLoader } from "langchain/document_loaders/fs/epub";
import { EPubLoader } from "@langchain/community/document_loaders/fs/epub";

const loader = new EPubLoader(
"src/document_loaders/example_data/example.epub",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ npm install officeparser
## Usage, one document per page

```typescript
import { PPTXLoader } from "langchain/document_loaders/fs/pptx";
import { PPTXLoader } from "@langchain/community/document_loaders/fs/pptx";

const loader = new PPTXLoader("src/document_loaders/example_data/example.pptx");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install srt-parser-2
## Usage

```typescript
import { SRTLoader } from "langchain/document_loaders/fs/srt";
import { SRTLoader } from "@langchain/community/document_loaders/fs/srt";

const loader = new SRTLoader(
"src/document_loaders/example_data/Star_Wars_The_Clone_Wars_S06E07_Crisis_at_the_Heart.srt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install cheerio
## Usage

```typescript
import { CollegeConfidentialLoader } from "langchain/document_loaders/web/college_confidential";
import { CollegeConfidentialLoader } from "@langchain/community/document_loaders/web/college_confidential";

const loader = new CollegeConfidentialLoader(
"https://www.collegeconfidential.com/colleges/brown-university/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For more details on connecting to a Couchbase cluster, please check the [Node.js
For help with querying for documents using SQL++ (SQL for JSON), please check the [documentation](https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/index.html).

```typescript
import { CouchbaseDocumentLoader } from "langchain/document_loaders/web/couchbase";
import { CouchbaseDocumentLoader } from "@langchain/community/document_loaders/web/couchbase";
import { Cluster } from "couchbase";

const connectionString = "couchbase://localhost"; // valid couchbase connection string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install cheerio
## Load from single GitBook page

```typescript
import { GitbookLoader } from "langchain/document_loaders/web/gitbook";
import { GitbookLoader } from "@langchain/community/document_loaders/web/gitbook";

const loader = new GitbookLoader(
"https://docs.gitbook.com/product-tour/navigation"
Expand All @@ -29,7 +29,7 @@ const docs = await loader.load();
For this to work, the GitbookLoader needs to be initialized with the root path (https://docs.gitbook.com in this example) and have `shouldLoadAllPaths` set to `true`.

```typescript
import { GitbookLoader } from "langchain/document_loaders/web/gitbook";
import { GitbookLoader } from "@langchain/community/document_loaders/web/gitbook";

const loader = new GitbookLoader("https://docs.gitbook.com", {
shouldLoadAllPaths: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install cheerio
## Usage

```typescript
import { HNLoader } from "langchain/document_loaders/web/hn";
import { HNLoader } from "@langchain/community/document_loaders/web/hn";

const loader = new HNLoader("https://news.ycombinator.com/item?id=34817881");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install cheerio
## Usage

```typescript
import { IMSDBLoader } from "langchain/document_loaders/web/imsdb";
import { IMSDBLoader } from "@langchain/community/document_loaders/web/imsdb";

const loader = new IMSDBLoader("https://imsdb.com/scripts/BlacKkKlansman.html");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ npm i html-to-text

```typescript
import { compile } from "html-to-text";
import { RecursiveUrlLoader } from "langchain/document_loaders/web/recursive_url";
import { RecursiveUrlLoader } from "@langchain/community/document_loaders/web/recursive_url";

const url = "/docs/introduction";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ npm install cheerio
## Usage

```typescript
import { CheerioWebBaseLoader } from "langchain/document_loaders/web/cheerio";
import { CheerioWebBaseLoader } from "@langchain/community/document_loaders/web/cheerio";

const loader = new CheerioWebBaseLoader(
"https://news.ycombinator.com/item?id=34817881"
Expand All @@ -33,7 +33,7 @@ const docs = await loader.load();
## Usage, with a custom selector

```typescript
import { CheerioWebBaseLoader } from "langchain/document_loaders/web/cheerio";
import { CheerioWebBaseLoader } from "@langchain/community/document_loaders/web/cheerio";

const loader = new CheerioWebBaseLoader(
"https://news.ycombinator.com/item?id=34817881",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ npm install playwright
## Usage

```typescript
import { PlaywrightWebBaseLoader } from "langchain/document_loaders/web/playwright";
import { PlaywrightWebBaseLoader } from "@langchain/community/document_loaders/web/playwright";

/**
* Loader uses `page.content()`
Expand Down Expand Up @@ -64,7 +64,7 @@ import {
PlaywrightWebBaseLoader,
Page,
Browser,
} from "langchain/document_loaders/web/playwright";
} from "@langchain/community/document_loaders/web/playwright";

const url = "https://www.tabnews.com.br/";
const loader = new PlaywrightWebBaseLoader(url);
Expand All @@ -81,7 +81,7 @@ import {
PlaywrightWebBaseLoader,
Page,
Browser,
} from "langchain/document_loaders/web/playwright";
} from "@langchain/community/document_loaders/web/playwright";

const loader = new PlaywrightWebBaseLoader("https://www.tabnews.com.br/", {
launchOptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ npm install puppeteer
## Usage

```typescript
import { PuppeteerWebBaseLoader } from "langchain/document_loaders/web/puppeteer";
import { PuppeteerWebBaseLoader } from "@langchain/community/document_loaders/web/puppeteer";

/**
* Loader uses `page.evaluate(() => document.body.innerHTML)`
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/tutorials/agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ We will also create a retriever over some data of our own. For a deeper explanat

```typescript
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";
import { CheerioWebBaseLoader } from "langchain/document_loaders/web/cheerio";
import { CheerioWebBaseLoader } from "@langchain/community/document_loaders/web/cheerio";
import { MemoryVectorStore } from "langchain/vectorstores/memory";
import { OpenAIEmbeddings } from "@langchain/openai";

Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/tutorials/local_rag.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"source": [
"import \"cheerio\";\n",
"import { RecursiveCharacterTextSplitter } from \"langchain/text_splitter\";\n",
"import { CheerioWebBaseLoader } from \"langchain/document_loaders/web/cheerio\";"
"import { CheerioWebBaseLoader } from \"@langchain/community/document_loaders/web/cheerio\";"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/tutorials/qa_chat_history.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"outputs": [],
"source": [
"import \"cheerio\";\n",
"import { CheerioWebBaseLoader } from \"langchain/document_loaders/web/cheerio\";\n",
"import { CheerioWebBaseLoader } from \"@langchain/community/document_loaders/web/cheerio\";\n",
"import { RecursiveCharacterTextSplitter } from \"langchain/text_splitter\";\n",
"import { MemoryVectorStore } from \"langchain/vectorstores/memory\"\n",
"import { OpenAIEmbeddings, ChatOpenAI } from \"@langchain/openai\";\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/tutorials/rag.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"outputs": [],
"source": [
"import \"cheerio\";\n",
"import { CheerioWebBaseLoader } from \"langchain/document_loaders/web/cheerio\";\n",
"import { CheerioWebBaseLoader } from \"@langchain/community/document_loaders/web/cheerio\";\n",
"import { RecursiveCharacterTextSplitter } from \"langchain/text_splitter\";\n",
"import { MemoryVectorStore } from \"langchain/vectorstores/memory\"\n",
"import { OpenAIEmbeddings, ChatOpenAI } from \"@langchain/openai\";\n",
Expand Down
8 changes: 4 additions & 4 deletions environment_tests/test-exports-bun/src/entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export * from "langchain/memory";
export * from "langchain/memory/index";
export * from "langchain/memory/chat_memory";
export * from "langchain/document";
export * from "langchain/document_loaders/base";
export * from "langchain/document_loaders/web/searchapi";
export * from "langchain/document_loaders/web/serpapi";
export * from "langchain/document_loaders/web/sort_xyz_blockchain";
export * from "@langchain/community/document_loaders/base";
export * from "@langchain/community/document_loaders/web/searchapi";
export * from "@langchain/community/document_loaders/web/serpapi";
export * from "@langchain/community/document_loaders/web/sort_xyz_blockchain";
export * from "langchain/document_transformers/openai_functions";
export * from "langchain/callbacks";
export * from "langchain/output_parsers";
Expand Down
2 changes: 1 addition & 1 deletion environment_tests/test-exports-bun/src/import.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function test() {
const { MemoryVectorStore } = await import("langchain/vectorstores/memory");
const { OpenAIEmbeddings } = await import("@langchain/openai");
const { Document } = await import("@langchain/core/documents");
const { CSVLoader } = await import("langchain/document_loaders/fs/csv");
const { CSVLoader } = await import("@langchain/community/document_loaders/fs/csv");

// Test exports
assert(typeof OpenAI === "function");
Expand Down
2 changes: 1 addition & 1 deletion environment_tests/test-exports-bun/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ChatPromptTemplate } from "@langchain/core/prompts";
import { MemoryVectorStore } from "langchain/vectorstores/memory";
import { OpenAIEmbeddings } from "@langchain/openai";
import { Document } from "@langchain/core/documents";
import { CSVLoader } from "langchain/document_loaders/fs/csv";
import { CSVLoader } from "@langchain/community/document_loaders/fs/csv";
import { CallbackManager } from "@langchain/core/callbacks/manager";

// Test exports
Expand Down
2 changes: 1 addition & 1 deletion environment_tests/test-exports-bun/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ChatPromptTemplate } from "@langchain/core/prompts";
import { MemoryVectorStore } from "langchain/vectorstores/memory";
import { OpenAIEmbeddings } from "@langchain/openai";
import { Document } from "@langchain/core/documents";
import { CSVLoader } from "langchain/document_loaders/fs/csv";
import { CSVLoader } from "@langchain/community/document_loaders/fs/csv";

async function test(useAzure: boolean = false) {
// Test exports
Expand Down
Loading

0 comments on commit 592215d

Please sign in to comment.