Skip to content

Commit

Permalink
docs[patch]: Add section about req optional dep (#3689)
Browse files Browse the repository at this point in the history
* docs[patch]: Add section about req optional dep

* Update CONTRIBUTING.md
  • Loading branch information
bracesproul authored Dec 16, 2023
1 parent 1dfc5f4 commit 93ab496
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ yarn build

LangChain exposes multiple subpaths the user can import from, e.g.

```ts
```typescript
import { OpenAI } from "langchain/llms/openai";
```

Expand All @@ -223,13 +223,22 @@ should edit the `langchain/scripts/create-entrypoints.js` or `libs/langchain-com
entrypoint `tools` that imports from `tools/index.ts` you'd add
the following to the `entrypoints` variable:

```ts
```typescript
const entrypoints = {
// ...
tools: "tools/index",
};
```

If you're adding a new integration which requires installing a third party depencency, you must add the entrypoint to the `requiresOptionalDependency` array, also located inside `langchain/scripts/create-entrypoints.js` or `libs/langchain-community/scripts/create-entrypoints.js`.

```typescript
const requiresOptionalDependency = [
// ...
"tools/index",
];
```

This will make sure the entrypoint is included in the published package,
and in generated documentation.

Expand Down

2 comments on commit 93ab496

@vercel
Copy link

@vercel vercel bot commented on 93ab496 Dec 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 93ab496 Dec 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

langchainjs-docs – ./docs/core_docs/

langchainjs-docs-ruddy.vercel.app
langchainjs-docs-langchain.vercel.app
langchainjs-docs-git-main-langchain.vercel.app
js.langchain.com

Please sign in to comment.