Skip to content

Commit

Permalink
Merge pull request #1 from langchain-ai/main
Browse files Browse the repository at this point in the history
sync main
  • Loading branch information
andrewdoro authored Jun 9, 2024
2 parents 4cc15c3 + 6535861 commit e204c3e
Show file tree
Hide file tree
Showing 248 changed files with 10,329 additions and 2,454 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
Expand All @@ -38,11 +40,5 @@ jobs:
node-version: 18.x
- name: Install dependencies
run: yarn install --immutable
- name: Build Core
run: yarn turbo:command build --filter=@langchain/core
- name: Build all except LangChain Community & Examples
run: yarn turbo:command build --filter=!examples --filter=!@langchain/community --filter=!core_docs --filter=!api_refs --filter=!create-langchain-integration
- name: Build LangChain Community
run: yarn turbo:command build --filter=@langchain/community
- name: Build examples
run: yarn turbo:command build --filter=examples
92 changes: 92 additions & 0 deletions .github/workflows/standard-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Standard Tests (Integration)

on:
workflow_dispatch:
schedule:
- cron: '0 13 * * *'

jobs:
standard-tests:
runs-on: ubuntu-latest
strategy:
matrix:
package: [anthropic, cohere, google-genai, groq, mistralai]
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Run standard tests (integration) for ${{ matrix.package }}
run: yarn test:standard:int --filter=@langchain/${{ matrix.package }}
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}

# The `@langchain/openai` package contains standard tests for ChatOpenAI and AzureChatOpenAI
# We want to run these separately, so we need to pass the exact path for each test, which means
# we need separate jobs for each test.
standard-tests-openai:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Build `@langchain/openai`
run: yarn build --filter=@langchain/openai
- name: Run standard tests (integration) for ChatOpenAI
run: yarn workspace @langchain/openai test:single src/tests/chat_models.standard.int.test.ts
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

standard-tests-azure-openai:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Build `@langchain/openai`
run: yarn build --filter=@langchain/openai
- name: Run standard tests (integration) for `@langchain/openai` AzureChatOpenAI
run: yarn workspace @langchain/openai test:single src/tests/azure/chat_models.standard.int.test.ts
env:
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_API_DEPLOYMENT_NAME: "chat"
AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }}
AZURE_OPENAI_BASE_PATH: ${{ secrets.AZURE_OPENAI_BASE_PATH }}

standard-tests-bedrock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Build `@langchain/community`
run: yarn build --filter=@langchain/community
- name: Run standard tests (integration) for `@langchain/community` BedrockChat
run: yarn workspace @langchain/community test:single src/chat_models/tests/chatbedrock.standard.int.test.ts
env:
BEDROCK_AWS_REGION: "us-east-1"
BEDROCK_AWS_SECRET_ACCESS_KEY: ${{ secrets.BEDROCK_AWS_SECRET_ACCESS_KEY }}
BEDROCK_AWS_ACCESS_KEY_ID: ${{ secrets.BEDROCK_AWS_ACCESS_KEY_ID }}
77 changes: 32 additions & 45 deletions .github/workflows/test-exports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ env:
jobs:
exports-esbuild:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
Expand All @@ -34,22 +36,17 @@ jobs:
- name: Install dependencies
run: yarn install --immutable

- name: Build "@langchain/community"
run: yarn workspace @langchain/community build
- name: Build dependencies
run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai
shell: bash
env:
SKIP_API_DOCS: true
- name: Build LangChain
run: yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true

- name: Test esbuild exports
run: docker compose -f environment_tests/docker-compose.yml run test-exports-esbuild

exports-esm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
Expand All @@ -60,22 +57,17 @@ jobs:
- name: Install dependencies
run: yarn install --immutable

- name: Build "@langchain/community"
run: yarn workspace @langchain/community build
shell: bash
env:
SKIP_API_DOCS: true
- name: Build LangChain
run: yarn workspace langchain build
- name: Build dependencies
run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai
shell: bash
env:
SKIP_API_DOCS: true

- name: Test esm exports
run: docker compose -f environment_tests/docker-compose.yml run test-exports-esm

exports-cjs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
Expand All @@ -86,22 +78,17 @@ jobs:
- name: Install dependencies
run: yarn install --immutable

- name: Build "@langchain/community"
run: yarn workspace @langchain/community build
shell: bash
env:
SKIP_API_DOCS: true
- name: Build LangChain
run: yarn workspace langchain build
- name: Build dependencies
run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai
shell: bash
env:
SKIP_API_DOCS: true

- name: Test cjs exports
run: docker compose -f environment_tests/docker-compose.yml run test-exports-cjs

exports-cf:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
Expand All @@ -111,17 +98,18 @@ jobs:
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace langchain build

- name: Build dependencies
run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai
shell: bash
env:
SKIP_API_DOCS: true

- name: Test cf exports
run: docker compose -f environment_tests/docker-compose.yml run test-exports-cf

exports-vercel:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
Expand All @@ -131,17 +119,18 @@ jobs:
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace langchain build

- name: Build dependencies
run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai
shell: bash
env:
SKIP_API_DOCS: true

- name: Test vercel exports
run: docker compose -f environment_tests/docker-compose.yml run test-exports-vercel

exports-vite:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
Expand All @@ -151,17 +140,18 @@ jobs:
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace langchain build

- name: Build dependencies
run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai
shell: bash
env:
SKIP_API_DOCS: true

- name: Test vite exports
run: docker compose -f environment_tests/docker-compose.yml run test-exports-vite

exports-tsc:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
Expand All @@ -171,11 +161,10 @@ jobs:
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace langchain build

- name: Build dependencies
run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai
shell: bash
env:
SKIP_API_DOCS: true

- name: Test compiling exports with tsc
run: docker compose -f environment_tests/docker-compose.yml run test-exports-tsc
Expand All @@ -194,8 +183,6 @@ jobs:
# - name: Build
# run: yarn workspace langchain build
# shell: bash
# env:
# SKIP_API_DOCS: true

# - name: Test bun exports
# run: docker compose -f environment_tests/docker-compose.yml run test-exports-bun
2 changes: 0 additions & 2 deletions .github/workflows/unit-tests-langchain-community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,5 @@ jobs:
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build --filter=@langchain/community
- name: Test
run: yarn run test:unit:ci --filter=@langchain/community
2 changes: 0 additions & 2 deletions .github/workflows/unit-tests-langchain-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ jobs:
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build --filter=@langchain/core
- name: Test
run: yarn run test:unit:ci --filter=@langchain/core
2 changes: 0 additions & 2 deletions .github/workflows/unit-tests-langchain-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,5 @@ jobs:
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build --filter=!@langchain/community --filter=!@langchain/core --filter=!langchain --filter=!api_refs --filter=!core_docs --filter=!create-langchain-integration --filter=!examples
- name: Test
run: yarn run test:unit:ci --filter=!@langchain/community --filter=!@langchain/core --filter=!langchain --filter=!api_refs --filter=!core_docs --filter=!create-langchain-integration --filter=!examples
2 changes: 0 additions & 2 deletions .github/workflows/unit-tests-langchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ jobs:
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build --filter=langchain
- name: Test
run: yarn run test:unit:ci --filter=langchain
env:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ LangChain supports several different types of integrations with third-party prov

We welcome such contributions, but ask that you read our dedicated [integration contribution guide](https://github.com/langchain-ai/langchainjs/blob/main/.github/contributing/INTEGRATIONS.md) for specific details and patterns to consider before opening a pull request.

You can also check out the [guide on extending LangChain.js](https://js.langchain.com/docs/guides/extending_langchain/) in our docs.
You can also check out the [guides on extending LangChain.js](https://js.langchain.com/v0.2/docs/how_to/#custom) in our docs.

#### Integration packages

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ This library aims to assist in the development of those types of applications. C

**❓Question Answering over specific documents**

- [Documentation](https://js.langchain.com/docs/use_cases/question_answering/)
- [Documentation](https://js.langchain.com/v0.2/docs/tutorials/rag/)
- End-to-end Example: [Doc-Chatbot](https://github.com/dissorial/doc-chatbot)


**💬 Chatbots**

- [Documentation](https://js.langchain.com/docs/modules/model_io/chat/)
- [Documentation](https://js.langchain.com/v0.2/docs/tutorials/chatbot)
- End-to-end Example: [Chat-LangChain](https://github.com/langchain-ai/chat-langchain)

## 🚀 How does LangChain help?
Expand Down Expand Up @@ -93,9 +93,9 @@ Agents involve an LLM making decisions about which Actions to take, taking that
Please see [here](https://js.langchain.com) for full documentation, which includes:

- [Getting started](https://js.langchain.com/v0.2/docs/introduction): installation, setting up the environment, simple examples
- Overview of the [interfaces](https://js.langchain.com/docs/expression_language/), [modules](https://js.langchain.com/docs/modules/) and [integrations](https://js.langchain.com/docs/integrations/platforms)
- [Use case](https://js.langchain.com/docs/use_cases/) walkthroughs and best practice [guides](https://js.langchain.com/docs/guides/)
- [Reference](https://v02.api.js.langchain.com): full API docs
- Overview of the [interfaces](https://js.langchain.com/v0.2/docs/how_to/lcel_cheatsheet/), [modules](https://js.langchain.com/v0.2/docs/concepts) and [integrations](https://js.langchain.com/v0.2/docs/integrations/platforms/)
- [Tutorial](https://js.langchain.com/v0.2/docs/tutorials/) walkthroughs
- [Reference](https://api.js.langchain.com): full API docs

## 💁 Contributing

Expand Down
2 changes: 1 addition & 1 deletion cookbook/rag_fusion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"source": [
"## Setup\n",
"\n",
"For this example we'll use an in memory store as our vectorstore/retriever, and some fake data. You can swap out the vectorstore for your [preferred LangChain.js option](https://js.langchain.com/docs/modules/data_connection/vectorstores/integrations/) later.\n"
"For this example we'll use an in memory store as our vectorstore/retriever, and some fake data. You can swap out the vectorstore for your [preferred LangChain.js option](https://js.langchain.com/v0.2/docs/integrations/vectorstores) later.\n"
]
},
{
Expand Down
Loading

0 comments on commit e204c3e

Please sign in to comment.