Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ This is an experimental community implementation, and it is not officially suppo

## Setup

import IntegrationInstallTooltip from '/snippets/javascript-integrations/integration-install-tooltip.mdx';

<IntegrationInstallTooltip/>

```bash npm
npm install @langchain/community @langchain/core
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ UPSTASH_REDIS_REST_TOKEN="****"

Next, you will need to install Upstash Ratelimit and `@langchain/community`:

import IntegrationInstallTooltip from '/snippets/javascript-integrations/integration-install-tooltip.mdx';

<IntegrationInstallTooltip/>

```bash npm
npm install @upstash/ratelimit @langchain/community @langchain/core
Expand Down
3 changes: 0 additions & 3 deletions src/oss/javascript/integrations/chat/alibaba_tongyi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ You'll need to sign up for an Alibaba API key and set it as an environment varia

Then, you'll need to install the [`@langchain/community`](https://www.npmjs.com/package/@langchain/community) package:

import IntegrationInstallTooltip from '/snippets/javascript-integrations/integration-install-tooltip.mdx';

<IntegrationInstallTooltip/>

```bash npm
npm install @langchain/community @langchain/core
Expand Down
23 changes: 10 additions & 13 deletions src/oss/javascript/integrations/chat/anthropic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ If you want to get automated tracing of your model calls you can also set your [

The LangChain `ChatAnthropic` integration lives in the `@langchain/anthropic` package:

```{=mdx}

import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
<IntegrationInstallTooltip></IntegrationInstallTooltip>

<Npm2Yarn>
@langchain/anthropic @langchain/core
</Npm2Yarn>

<CodeGroup>
```bash npm
npm install @langchain/anthropic @langchain/core
```
```bash yarn
yarn add @langchain/anthropic @langchain/core
```
```bash pnpm
pnpm add @langchain/anthropic @langchain/core
```
</CodeGroup>

## Instantiation

Expand Down Expand Up @@ -366,16 +367,12 @@ AIMessage {

## Prompt caching

```{=mdx}

<Warning>
**Compatibility**

This feature is currently in beta.
</Warning>

```

Anthropic supports [caching parts of your prompt](https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching) in order to reduce costs for use-cases that require long context. You can cache tools and both entire messages and individual blocks.

The initial request containing one or more blocks or tool definitions with a `"cache_control": { "type": "ephemeral" }` field will automatically cache that part of the prompt. This initial caching step will cost extra, but subsequent requests will be billed at a reduced rate. The cache has a lifetime of 5 minutes, but this is refereshed each time the cache is hit.
Expand Down
37 changes: 21 additions & 16 deletions src/oss/javascript/integrations/chat/arcjet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,34 @@ The Arcjet Redact object is not a chat model itself, instead it wraps an LLM. It

Install the Arcjet Redaction Library:

```{=mdx}
import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
<IntegrationInstallTooltip></IntegrationInstallTooltip>

<Npm2Yarn>
@arcjet/redact
</Npm2Yarn>

<CodeGroup>
```bash npm
npm install @arcjet/redact
```
```bash yarn
yarn add @arcjet/redact
```
```bash pnpm
pnpm add @arcjet/redact
```
</CodeGroup>

And install LangChain Community:

```{=mdx}
<IntegrationInstallTooltip></IntegrationInstallTooltip>

<Npm2Yarn>
@langchain/community @langchain/core
</Npm2Yarn>
<CodeGroup>
```bash npm
npm install @langchain/community @langchain/core
```
```bash yarn
yarn add @langchain/community @langchain/core
```
```bash pnpm
pnpm add @langchain/community @langchain/core
```
</CodeGroup>

And now you're ready to start protecting your chat model calls with Arcjet Redaction!

```

## Usage

```typescript
Expand Down
35 changes: 20 additions & 15 deletions src/oss/javascript/integrations/chat/azure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,17 @@ If you want to get automated tracing of your model calls you can also set your [

The LangChain AzureChatOpenAI integration lives in the `@langchain/openai` package:

```{=mdx}

import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
<IntegrationInstallTooltip></IntegrationInstallTooltip>

<Npm2Yarn>
@langchain/openai @langchain/core
</Npm2Yarn>

<CodeGroup>
```bash npm
npm install @langchain/openai @langchain/core
```
```bash yarn
yarn add @langchain/openai @langchain/core
```
```bash pnpm
pnpm add @langchain/openai @langchain/core
```
</CodeGroup>

## Instantiation

Expand Down Expand Up @@ -256,13 +257,17 @@ If you are using the deprecated Azure OpenAI SDK with the `@langchain/azure-open

1. Install the new `@langchain/openai` package and remove the previous `@langchain/azure-openai` package:

```{=mdx}

<Npm2Yarn>
@langchain/openai
</Npm2Yarn>

<CodeGroup>
```bash npm
npm install @langchain/openai
```
```bash yarn
yarn add @langchain/openai
```
```bash pnpm
pnpm add @langchain/openai
```
</CodeGroup>

```bash
npm uninstall @langchain/azure-openai
Expand Down
3 changes: 0 additions & 3 deletions src/oss/javascript/integrations/chat/baidu_qianfan.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ title: ChatBaiduQianfan

You'll first need to install the [`@langchain/baidu-qianfan`](https://www.npmjs.com/package/@langchain/baidu-qianfan) package:

import IntegrationInstallTooltip from '/snippets/javascript-integrations/integration-install-tooltip.mdx';

<IntegrationInstallTooltip/>

```bash npm
npm install @langchain/baidu-qianfan @langchain/core
Expand Down
3 changes: 0 additions & 3 deletions src/oss/javascript/integrations/chat/baidu_wenxin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ Use the [`@langchain/baidu-qianfan`](/oss/integrations/chat/baidu_qianfan/) pack

LangChain.js supports Baidu's ERNIE-bot family of models. Here's an example:

import IntegrationInstallTooltip from '/snippets/javascript-integrations/integration-install-tooltip.mdx';

<IntegrationInstallTooltip/>

```bash npm
npm install @langchain/community @langchain/core
Expand Down
39 changes: 23 additions & 16 deletions src/oss/javascript/integrations/chat/bedrock.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ title: BedrockChat

This will help you getting started with Amazon Bedrock [chat models](/oss/concepts/chat_models). For detailed documentation of all `BedrockChat` features and configurations head to the [API reference](https://api.js.langchain.com/classes/langchain_community_chat_models_bedrock.BedrockChat.html).

```{=mdx}
<Tip>
The newer [`ChatBedrockConverse` chat model is now available via the dedicated `@langchain/aws`](/oss/integrations/chat/bedrock_converse) integration package. Use [tool calling](/oss/concepts/tool_calling) with more models with this package.
</Tip>
```


## Overview

Expand Down Expand Up @@ -47,25 +46,33 @@ If you want to get automated tracing of your model calls you can also set your [

The LangChain `BedrockChat` integration lives in the `@langchain/community` package. You'll also need to install several official AWS packages as peer dependencies:

```{=mdx}
import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
<IntegrationInstallTooltip></IntegrationInstallTooltip>

<Npm2Yarn>
@langchain/community @langchain/core @aws-crypto/sha256-js @aws-sdk/credential-provider-node @smithy/protocol-http @smithy/signature-v4 @smithy/eventstream-codec @smithy/util-utf8 @aws-sdk/types
</Npm2Yarn>
<CodeGroup>
```bash npm
npm install @langchain/community @langchain/core @aws-crypto/sha256-js @aws-sdk/credential-provider-node @smithy/protocol-http @smithy/signature-v4 @smithy/eventstream-codec @smithy/util-utf8 @aws-sdk/types
```
```bash yarn
yarn add @langchain/community @langchain/core @aws-crypto/sha256-js @aws-sdk/credential-provider-node @smithy/protocol-http @smithy/signature-v4 @smithy/eventstream-codec @smithy/util-utf8 @aws-sdk/types
```
```bash pnpm
pnpm add @langchain/community @langchain/core @aws-crypto/sha256-js @aws-sdk/credential-provider-node @smithy/protocol-http @smithy/signature-v4 @smithy/eventstream-codec @smithy/util-utf8 @aws-sdk/types
```
</CodeGroup>

You can also use BedrockChat in web environments such as Edge functions or Cloudflare Workers by omitting the @aws-sdk/credential-provider-node dependency and using the web entrypoint:

```{=mdx}
<IntegrationInstallTooltip></IntegrationInstallTooltip>

<Npm2Yarn>
@langchain/community @langchain/core @aws-crypto/sha256-js @smithy/protocol-http @smithy/signature-v4 @smithy/eventstream-codec @smithy/util-utf8 @aws-sdk/types
</Npm2Yarn>
You can also use BedrockChat in web environments such as Edge functions or Cloudflare Workers by omitting the @aws-sdk/credential-provider-node dependency and using the web entrypoint:

<CodeGroup>
```bash npm
npm install @langchain/community @langchain/core @aws-crypto/sha256-js @smithy/protocol-http @smithy/signature-v4 @smithy/eventstream-codec @smithy/util-utf8 @aws-sdk/typespenai
```
```bash yarn
yarn add @langchain/community @langchain/core @aws-crypto/sha256-js @smithy/protocol-http @smithy/signature-v4 @smithy/eventstream-codec @smithy/util-utf8 @aws-sdk/types
```
```bash pnpm
pnpm add @langchain/community @langchain/core @aws-crypto/sha256-js @smithy/protocol-http @smithy/signature-v4 @smithy/eventstream-codec @smithy/util-utf8 @aws-sdk/types
```
</CodeGroup>


## Instantiation

Expand Down
18 changes: 10 additions & 8 deletions src/oss/javascript/integrations/chat/bedrock_converse.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ If you want to get automated tracing of your model calls you can also set your [

The LangChain `ChatBedrockConverse` integration lives in the `@langchain/aws` package:

```{=mdx}
import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
<IntegrationInstallTooltip></IntegrationInstallTooltip>

<Npm2Yarn>
@langchain/aws @langchain/core
</Npm2Yarn>

<CodeGroup>
```bash npm
npm install @langchain/aws @langchain/core
```
```bash yarn
yarn add @langchain/aws @langchain/core
```
```bash pnpm
pnpm add @langchain/aws @langchain/core
```
</CodeGroup>

## Instantiation

Expand Down
19 changes: 10 additions & 9 deletions src/oss/javascript/integrations/chat/cerebras.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,17 @@ If you want to get automated tracing of your model calls you can also set your [

The LangChain ChatCerebras integration lives in the `@langchain/cerebras` package:

```{=mdx}

import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
<IntegrationInstallTooltip></IntegrationInstallTooltip>

<Npm2Yarn>
@langchain/cerebras @langchain/core
</Npm2Yarn>

<CodeGroup>
```bash npm
npm install @langchain/cerebras @langchain/core
```
```bash yarn
yarn add @langchain/cerebras @langchain/core
```
```bash pnpm
pnpm add @langchain/cerebras @langchain/core
```
</CodeGroup>

## Instantiation

Expand Down
18 changes: 10 additions & 8 deletions src/oss/javascript/integrations/chat/cloudflare_workersai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ Passing a binding within a Cloudflare Worker is not yet supported.

The LangChain ChatCloudflareWorkersAI integration lives in the `@langchain/cloudflare` package:

```{=mdx}
import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
<IntegrationInstallTooltip></IntegrationInstallTooltip>

<Npm2Yarn>
@langchain/cloudflare @langchain/core
</Npm2Yarn>

<CodeGroup>
```bash npm
npm install @langchain/cloudflare @langchain/core
```
```bash yarn
yarn add @langchain/cloudflare @langchain/core
```
```bash pnpm
pnpm add @langchain/cloudflare @langchain/core
```
</CodeGroup>

## Instantiation

Expand Down
19 changes: 10 additions & 9 deletions src/oss/javascript/integrations/chat/cohere.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,17 @@ If you want to get automated tracing of your model calls you can also set your [

The LangChain ChatCohere integration lives in the `@langchain/cohere` package:

```{=mdx}

import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
<IntegrationInstallTooltip></IntegrationInstallTooltip>

<Npm2Yarn>
@langchain/cohere @langchain/core
</Npm2Yarn>

<CodeGroup>
```bash npm
npm install @langchain/cohere @langchain/core
```
```bash yarn
yarn add @langchain/cohere @langchain/core
```
```bash pnpm
pnpm add @langchain/cohere @langchain/core
```
</CodeGroup>

## Instantiation

Expand Down
3 changes: 0 additions & 3 deletions src/oss/javascript/integrations/chat/deep_infra.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ title: ChatDeepInfra
LangChain supports chat models hosted by [Deep Infra](https://deepinfra.com/) through the `ChatDeepInfra` wrapper.
First, you'll need to install the `@langchain/community` package:

import IntegrationInstallTooltip from '/snippets/javascript-integrations/integration-install-tooltip.mdx';

<IntegrationInstallTooltip/>

```bash npm
npm install @langchain/community @langchain/core
Expand Down
19 changes: 10 additions & 9 deletions src/oss/javascript/integrations/chat/fireworks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ If you want to get automated tracing of your model calls you can also set your [

The LangChain `ChatFireworks` integration lives in the `@langchain/community` package:

```{=mdx}

import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
<IntegrationInstallTooltip></IntegrationInstallTooltip>

<Npm2Yarn>
@langchain/community @langchain/core
</Npm2Yarn>

<CodeGroup>
```bash npm
npm install @langchain/community @langchain/core
```
```bash yarn
yarn add @langchain/community @langchain/core
```
```bash pnpm
pnpm add @langchain/community @langchain/core
```
</CodeGroup>

## Instantiation

Expand Down
Loading