Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs[patch]: Add section about req optional dep #3689

Merged
merged 2 commits into from
Dec 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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