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

Rename to @langchain/core #3381

Merged
merged 3 commits into from
Nov 22, 2023
Merged
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
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/anthropic 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/anthropic 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/anthropic 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/anthropic 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/anthropic 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/anthropic 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/anthropic 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
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/anthropic 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
4 changes: 2 additions & 2 deletions environment_tests/scripts/docker-bun-ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ bun install --no-save

# Link the package locally
cd ../langchain
sed -i 's/"langchain-core": "[^\"]*"/"langchain-core": "link:langchain-core"/g' package.json
sed -i 's/"@langchain\/core": "[^\"]*"/"@langchain\/core": "link:@langchain\/core"/g' package.json
bun link

# Reinstall deps with bun because bun doesn't install deps of linked deps
Expand All @@ -34,7 +34,7 @@ bun install --no-save
cd ../app

# Replace the workspace dependency with the local copy, and install all others
sed -i 's/"langchain-core": "workspace:\*"/"langchain-core": "link:langchain-core"/g' package.json
sed -i 's/"@langchain\/core": "workspace:\*"/"@langchain\/core": "link:@langchain\/core"/g' package.json
sed -i 's/"langchain": "workspace:\*"/"langchain": "link:langchain"/g' package.json
bun install --no-save

Expand Down
2 changes: 1 addition & 1 deletion environment_tests/scripts/docker-ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cp ../root/yarn.lock ../root/.yarnrc.yml .
# Replace the workspace dependency with the local copy, and install all others
# 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\/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

Expand Down
4 changes: 2 additions & 2 deletions environment_tests/test-exports-bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"license": "MIT",
"dependencies": {
"@langchain/anthropic": "workspace:*",
"@langchain/core": "workspace:*",
"d3-dsv": "2",
"hnswlib-node": "^1.4.2",
"langchain": "workspace:*",
"langchain-core": "workspace:*"
"langchain": "workspace:*"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.2",
Expand Down
4 changes: 2 additions & 2 deletions environment_tests/test-exports-cf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"dependencies": {
"@langchain/anthropic": "workspace:*",
"langchain": "workspace:*",
"langchain-core": "workspace:*"
"@langchain/core": "workspace:*",
"langchain": "workspace:*"
},
"private": true,
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions environment_tests/test-exports-cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"license": "MIT",
"dependencies": {
"@langchain/anthropic": "workspace:*",
"@langchain/core": "workspace:*",
"d3-dsv": "2",
"hnswlib-node": "^1.4.2",
"langchain": "workspace:*",
"langchain-core": "workspace:*"
"langchain": "workspace:*"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.2",
Expand Down
4 changes: 2 additions & 2 deletions environment_tests/test-exports-esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"license": "MIT",
"dependencies": {
"@langchain/anthropic": "workspace:*",
"@langchain/core": "workspace:*",
"d3-dsv": "2",
"hnswlib-node": "^1.4.2",
"langchain": "workspace:*",
"langchain-core": "workspace:*"
"langchain": "workspace:*"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.2",
Expand Down
4 changes: 2 additions & 2 deletions environment_tests/test-exports-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"license": "MIT",
"dependencies": {
"@langchain/anthropic": "workspace:*",
"@langchain/core": "workspace:*",
"d3-dsv": "2",
"hnswlib-node": "^1.4.2",
"langchain": "workspace:*",
"langchain-core": "workspace:*"
"langchain": "workspace:*"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.2",
Expand Down
2 changes: 1 addition & 1 deletion environment_tests/test-exports-vercel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
},
"dependencies": {
"@langchain/anthropic": "workspace:*",
"@langchain/core": "workspace:*",
"@types/node": "18.15.11",
"@types/react": "18.0.33",
"@types/react-dom": "18.0.11",
"eslint": "8.37.0",
"eslint-config-next": "13.3.0",
"langchain": "workspace:*",
"langchain-core": "workspace:*",
"next": "13.4.9",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
4 changes: 2 additions & 2 deletions environment_tests/test-exports-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"dependencies": {
"@langchain/anthropic": "workspace:*",
"langchain": "workspace:*",
"langchain-core": "workspace:*"
"@langchain/core": "workspace:*",
"langchain": "workspace:*"
},
"devDependencies": {
"typescript": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion langchain-core/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# langchain-core
# @langchain/core
6 changes: 3 additions & 3 deletions langchain-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "langchain-core",
"version": "0.0.4",
"description": "Typescript bindings for langchain",
"name": "@langchain/core",
"version": "0.0.0",
"description": "Core LangChain.js abstractions and schemas",
"type": "module",
"engines": {
"node": ">=18"
Expand Down
2 changes: 1 addition & 1 deletion langchain-core/scripts/create-entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const generateImportMap = () => {
const importTypes = [
"langchain-core",
(k, p) =>
` "langchain-core/${k}"?:
` "@langchain/core/${k}"?:
| typeof import("../${p}.js")
| Promise<typeof import("../${p}.js")>;`,
"src/load/import_type.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@
"@huggingface/inference": "^2.6.4",
"@jest/globals": "^29.5.0",
"@langchain/anthropic": "workspace:*",
"@langchain/core": "workspace:*",
"@mozilla/readability": "^0.4.4",
"@notionhq/client": "^2.2.10",
"@opensearch-project/opensearch": "^2.2.0",
Expand Down Expand Up @@ -943,7 +944,6 @@
"jest": "^29.5.0",
"jest-environment-node": "^29.6.4",
"jsdom": "^22.1.0",
"langchain-core": "workspace:*",
"llmonitor": "^0.5.9",
"lodash": "^4.17.21",
"mammoth": "^1.5.1",
Expand Down Expand Up @@ -1380,13 +1380,13 @@
},
"dependencies": {
"@langchain/anthropic": "^0.0.2",
"@langchain/core": "^0.0.0",
"binary-extensions": "^2.2.0",
"expr-eval": "^2.0.2",
"flat": "^5.0.2",
"js-tiktoken": "^1.0.7",
"js-yaml": "^4.1.0",
"jsonpointer": "^5.0.1",
"langchain-core": "^0.0.4",
"langchainhub": "~0.0.6",
"langsmith": "~0.0.48",
"ml-distance": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion langchain/scripts/check-tree-shaking.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function listExternals() {
...Object.keys(packageJson.peerDependencies),
/node\:/,
/js-tiktoken/,
/langchain-core/,
/@langchain\/core/,
"axios", // axios is a dependency of openai
"convex",
"convex/server",
Expand Down
2 changes: 1 addition & 1 deletion langchain/src/base_language/count_tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export {
calculateMaxTokens,
getModelContextSize,
getEmbeddingContextSize,
} from "langchain-core/language_models/base";
} from "@langchain/core/language_models/base";
2 changes: 1 addition & 1 deletion langchain/src/base_language/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export {
type BaseFunctionCallOptions,
type BaseLanguageModelInput,
BaseLanguageModel,
} from "langchain-core/language_models/base";
} from "@langchain/core/language_models/base";

/*
* Export utility functions for token calculations:
Expand Down
2 changes: 1 addition & 1 deletion langchain/src/cache/base.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/caches";
export * from "@langchain/core/caches";
2 changes: 1 addition & 1 deletion langchain/src/cache/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { InMemoryCache } from "langchain-core/caches";
export { InMemoryCache } from "@langchain/core/caches";
2 changes: 1 addition & 1 deletion langchain/src/cache/tests/ioredis.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect, jest } from "@jest/globals";
import { insecureHash } from "langchain-core/utils/hash";
import { insecureHash } from "@langchain/core/utils/hash";

import { RedisCache } from "../ioredis.js";

Expand Down
2 changes: 1 addition & 1 deletion langchain/src/cache/tests/redis.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect, jest } from "@jest/globals";
import { insecureHash } from "langchain-core/utils/hash";
import { insecureHash } from "@langchain/core/utils/hash";

import { RedisCache } from "../redis.js";

Expand Down
2 changes: 1 addition & 1 deletion langchain/src/cache/tests/upstash_redis.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect, jest } from "@jest/globals";
import { insecureHash } from "langchain-core/utils/hash";
import { insecureHash } from "@langchain/core/utils/hash";

import { UpstashRedisCache } from "../upstash_redis.js";
import { StoredGeneration } from "../../schema/index.js";
Expand Down
2 changes: 1 addition & 1 deletion langchain/src/callbacks/base.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/callbacks/base";
export * from "@langchain/core/callbacks/base";
2 changes: 1 addition & 1 deletion langchain/src/callbacks/handlers/console.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/tracers/console";
export * from "@langchain/core/tracers/console";
2 changes: 1 addition & 1 deletion langchain/src/callbacks/handlers/initialize.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/tracers/initialize";
export * from "@langchain/core/tracers/initialize";
2 changes: 1 addition & 1 deletion langchain/src/callbacks/handlers/log_stream.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/tracers/log_stream";
export * from "@langchain/core/tracers/log_stream";
2 changes: 1 addition & 1 deletion langchain/src/callbacks/handlers/run_collector.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/tracers/run_collector";
export * from "@langchain/core/tracers/run_collector";
2 changes: 1 addition & 1 deletion langchain/src/callbacks/handlers/tracer.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/tracers/base";
export * from "@langchain/core/tracers/base";
2 changes: 1 addition & 1 deletion langchain/src/callbacks/handlers/tracer_langchain.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/tracers/tracer_langchain";
export * from "@langchain/core/tracers/tracer_langchain";
2 changes: 1 addition & 1 deletion langchain/src/callbacks/handlers/tracer_langchain_v1.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/tracers/tracer_langchain_v1";
export * from "@langchain/core/tracers/tracer_langchain_v1";
2 changes: 1 addition & 1 deletion langchain/src/callbacks/manager.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/callbacks/manager";
export * from "@langchain/core/callbacks/manager";
2 changes: 1 addition & 1 deletion langchain/src/callbacks/promises.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/callbacks/promises";
export * from "@langchain/core/callbacks/promises";
2 changes: 1 addition & 1 deletion langchain/src/chains/openai_functions/structured_output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";
import { JsonSchema7Type } from "zod-to-json-schema/src/parseDef.js";

import { Validator } from "langchain-core/utils/json_schema";
import { Validator } from "@langchain/core/utils/json_schema";
import { LLMChain, LLMChainInput } from "../llm_chain.js";
import { ChatOpenAI } from "../../chat_models/openai.js";
import { BasePromptTemplate } from "../../prompts/index.js";
Expand Down
2 changes: 1 addition & 1 deletion langchain/src/chat_models/base.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/language_models/chat_models";
export * from "@langchain/core/language_models/chat_models";
2 changes: 1 addition & 1 deletion langchain/src/document.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { type DocumentInput, Document } from "langchain-core/documents";
export { type DocumentInput, Document } from "@langchain/core/documents";
2 changes: 1 addition & 1 deletion langchain/src/embeddings/base.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/embeddings";
export * from "@langchain/core/embeddings";
2 changes: 1 addition & 1 deletion langchain/src/embeddings/cache_backed.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { insecureHash } from "langchain-core/utils/hash";
import { insecureHash } from "@langchain/core/utils/hash";

import { BaseStore } from "../schema/storage.js";
import { EncoderBackedStore } from "../storage/encoder_backed.js";
Expand Down
2 changes: 1 addition & 1 deletion langchain/src/llms/base.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/language_models/llms";
export * from "@langchain/core/language_models/llms";
2 changes: 1 addition & 1 deletion langchain/src/load/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { load as coreLoad } from "langchain-core/load";
import { load as coreLoad } from "@langchain/core/load";
import { optionalImportEntrypoints } from "./import_constants.js";
import * as importMap from "./import_map.js";
import { OptionalImportMap, SecretMap } from "./import_type.js";
Expand Down
2 changes: 1 addition & 1 deletion langchain/src/load/serializable.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "langchain-core/load/serializable";
export * from "@langchain/core/load/serializable";
2 changes: 1 addition & 1 deletion langchain/src/load/tests/load.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect } from "@jest/globals";
import { stringify } from "yaml";
import { z } from "zod";
import { RunnableSequence } from "langchain-core/runnables";
import { RunnableSequence } from "@langchain/core/runnables";

import { load } from "../index.js";
import { OpenAI } from "../../llms/openai.js";
Expand Down
4 changes: 2 additions & 2 deletions langchain/src/memory/base.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "langchain-core/memory";
export { getBufferString } from "langchain-core/messages";
export * from "@langchain/core/memory";
export { getBufferString } from "@langchain/core/messages";
2 changes: 1 addition & 1 deletion langchain/src/output_parsers/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export {
ListOutputParser,
CommaSeparatedListOutputParser,
CustomListOutputParser,
} from "langchain-core/output_parsers";
} from "@langchain/core/output_parsers";
2 changes: 1 addition & 1 deletion langchain/src/output_parsers/openai_functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { JsonSchema7ObjectType } from "zod-to-json-schema/src/parsers/object.js"
import {
compare,
type Operation as JSONPatchOperation,
} from "langchain-core/utils/json_patch";
} from "@langchain/core/utils/json_patch";

import { ChatGeneration, Generation } from "../schema/index.js";
import { Optional } from "../types/type-utils.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { expect, test } from "@jest/globals";
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";
import { Operation, applyPatch } from "langchain-core/utils/json_patch";
import { Operation, applyPatch } from "@langchain/core/utils/json_patch";

import { ChatOpenAI } from "../../chat_models/openai.js";
import { ChatPromptTemplate } from "../../prompts/index.js";
Expand Down
Loading