Skip to content

Commit

Permalink
Adds standalone @langchain/anthropic package (#3377)
Browse files Browse the repository at this point in the history
* Adds standalone @langchain/anthropic package

* Format

* Fix docker

* Fix Docker
  • Loading branch information
jacoblee93 authored Nov 22, 2023
1 parent 8e3c2ab commit 11d10c0
Show file tree
Hide file tree
Showing 36 changed files with 1,077 additions and 459 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/test-exports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace langchain-core build && yarn workspace langchain build
run: yarn workspace langchain-core build && yarn workspace @langchain/anthropic build && yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace langchain-core build && yarn workspace langchain build
run: yarn workspace langchain-core build && yarn workspace @langchain/anthropic build && yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -74,7 +74,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace langchain-core build && yarn workspace langchain build
run: yarn workspace langchain-core build && yarn workspace @langchain/anthropic build && yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -94,7 +94,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace langchain-core build && yarn workspace langchain build
run: yarn workspace langchain-core build && yarn workspace @langchain/anthropic build && yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -114,7 +114,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace langchain-core build && yarn workspace langchain build
run: yarn workspace langchain-core build && yarn workspace @langchain/anthropic build && yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -134,7 +134,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn workspace langchain-core build && yarn workspace langchain build
run: yarn workspace langchain-core build && yarn workspace @langchain/anthropic build && yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -154,7 +154,7 @@ jobs:
# - name: Install dependencies
# run: yarn install --immutable
# - name: Build
# run: yarn workspace langchain-core build && yarn workspace langchain build
# run: yarn workspace langchain-core build && yarn workspace @langchain/anthropic build && yarn workspace langchain build
# shell: bash
# env:
# SKIP_API_DOCS: true
Expand Down
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
- ./environment_tests/scripts:/scripts
- ./langchain:/langchain
- ./langchain-core:/langchain-core
- ./libs/langchain-anthropic:/langchain-anthropic
command: bash /scripts/docker-ci-entrypoint.sh
test-exports-esm:
image: node:18
Expand All @@ -23,6 +24,7 @@ services:
- ./environment_tests/scripts:/scripts
- ./langchain:/langchain
- ./langchain-core:/langchain-core
- ./libs/langchain-anthropic:/langchain-anthropic
command: bash /scripts/docker-ci-entrypoint.sh
test-exports-cjs:
image: node:18
Expand All @@ -35,6 +37,7 @@ services:
- ./environment_tests/scripts:/scripts
- ./langchain:/langchain
- ./langchain-core:/langchain-core
- ./libs/langchain-anthropic:/langchain-anthropic
command: bash /scripts/docker-ci-entrypoint.sh
test-exports-cf:
image: node:18
Expand All @@ -47,6 +50,7 @@ services:
- ./environment_tests/scripts:/scripts
- ./langchain:/langchain
- ./langchain-core:/langchain-core
- ./libs/langchain-anthropic:/langchain-anthropic
command: bash /scripts/docker-ci-entrypoint.sh
test-exports-vercel:
image: node:18
Expand All @@ -59,6 +63,7 @@ services:
- ./environment_tests/scripts:/scripts
- ./langchain:/langchain
- ./langchain-core:/langchain-core
- ./libs/langchain-anthropic:/langchain-anthropic
command: bash /scripts/docker-ci-entrypoint.sh
test-exports-vite:
image: node:18
Expand All @@ -71,6 +76,7 @@ services:
- ./environment_tests/scripts:/scripts
- ./langchain:/langchain
- ./langchain-core:/langchain-core
- ./libs/langchain-anthropic:/langchain-anthropic
command: bash /scripts/docker-ci-entrypoint.sh
# test-exports-bun:
# image: oven/bun
Expand All @@ -79,7 +85,8 @@ services:
# - ./environment_tests/test-exports-bun:/package
# - ./environment_tests/scripts:/scripts
# - ./langchain:/langchain-workspace
# - ./langchain-core:/langchain-core-workspace
# - ./langchain-core:/langchain-core
# - ./libs/langchain-anthropic:/langchain-anthropic-workspace
# command: bash /scripts/docker-bun-ci-entrypoint.sh
success:
image: alpine:3.14
Expand Down
2 changes: 1 addition & 1 deletion docs/api_refs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dev": "next dev -p 3001",
"typedoc": "npx typedoc --options typedoc.json",
"build:scripts": "node ./scripts/generate-api-refs.js && node ./scripts/update-typedoc-css.js",
"build": "yarn workspace langchain-core build && yarn workspace langchain build && yarn build:scripts && next build",
"build": "yarn workspace langchain-core build && yarn workspace @langchain/anthropic build && yarn workspace langchain build && yarn build:scripts && next build",
"start": "yarn build && next start -p 3001",
"lint": "next lint"
},
Expand Down
2 changes: 2 additions & 0 deletions environment_tests/scripts/docker-ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ cp ../root/yarn.lock ../root/.yarnrc.yml .
# Avoid calling "yarn add ../langchain" as yarn berry does seem to hang for ~30s
# before installation actually occurs
sed -i 's/"langchain-core": "workspace:\*"/"langchain-core": "..\/langchain-core"/g' package.json
sed -i 's/"@langchain\/anthropic": "workspace:\*"/"@langchain\/anthropic": "..\/langchain-anthropic"/g' package.json
sed -i 's/"langchain": "workspace:\*"/"langchain": "..\/langchain"/g' package.json

yarn install --no-immutable

# Check the build command completes successfully
Expand Down
1 change: 1 addition & 0 deletions environment_tests/test-exports-bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"author": "LangChain",
"license": "MIT",
"dependencies": {
"@langchain/anthropic": "workspace:*",
"d3-dsv": "2",
"hnswlib-node": "^1.4.2",
"langchain": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions environment_tests/test-exports-cf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"wrangler": "3.7.0"
},
"dependencies": {
"@langchain/anthropic": "workspace:*",
"langchain": "workspace:*",
"langchain-core": "workspace:*"
},
Expand Down
1 change: 1 addition & 0 deletions environment_tests/test-exports-cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"author": "LangChain",
"license": "MIT",
"dependencies": {
"@langchain/anthropic": "workspace:*",
"d3-dsv": "2",
"hnswlib-node": "^1.4.2",
"langchain": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions environment_tests/test-exports-esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"author": "LangChain",
"license": "MIT",
"dependencies": {
"@langchain/anthropic": "workspace:*",
"d3-dsv": "2",
"hnswlib-node": "^1.4.2",
"langchain": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions environment_tests/test-exports-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"author": "LangChain",
"license": "MIT",
"dependencies": {
"@langchain/anthropic": "workspace:*",
"d3-dsv": "2",
"hnswlib-node": "^1.4.2",
"langchain": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions environment_tests/test-exports-vercel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"test": "next lint"
},
"dependencies": {
"@langchain/anthropic": "workspace:*",
"@types/node": "18.15.11",
"@types/react": "18.0.33",
"@types/react-dom": "18.0.11",
Expand Down
1 change: 1 addition & 0 deletions environment_tests/test-exports-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"test": "tsc"
},
"dependencies": {
"@langchain/anthropic": "workspace:*",
"langchain": "workspace:*",
"langchain-core": "workspace:*"
},
Expand Down
3 changes: 2 additions & 1 deletion langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@
"@google-cloud/storage": "^6.10.1",
"@huggingface/inference": "^2.6.4",
"@jest/globals": "^29.5.0",
"@langchain/anthropic": "workspace:*",
"@mozilla/readability": "^0.4.4",
"@notionhq/client": "^2.2.10",
"@opensearch-project/opensearch": "^2.2.0",
Expand Down Expand Up @@ -1378,7 +1379,7 @@
}
},
"dependencies": {
"@anthropic-ai/sdk": "^0.9.1",
"@langchain/anthropic": "^0.0.2",
"binary-extensions": "^2.2.0",
"expr-eval": "^2.0.2",
"flat": "^5.0.2",
Expand Down
Loading

2 comments on commit 11d10c0

@vercel
Copy link

@vercel vercel bot commented on 11d10c0 Nov 22, 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 11d10c0 Nov 22, 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-langchain.vercel.app
langchainjs-docs-ruddy.vercel.app
langchainjs-docs-git-main-langchain.vercel.app
js.langchain.com

Please sign in to comment.