@langchain/anthropic 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,10 +4,10 @@ exports.ChatAnthropic = exports.DEFAULT_STOP_SEQUENCES = exports.HUMAN_PROMPT =
4
4
  const sdk_1 = require("@anthropic-ai/sdk");
5
5
  Object.defineProperty(exports, "AI_PROMPT", { enumerable: true, get: function () { return sdk_1.AI_PROMPT; } });
6
6
  Object.defineProperty(exports, "HUMAN_PROMPT", { enumerable: true, get: function () { return sdk_1.HUMAN_PROMPT; } });
7
- const messages_1 = require("langchain-core/messages");
8
- const outputs_1 = require("langchain-core/outputs");
9
- const env_1 = require("langchain-core/utils/env");
10
- const chat_models_1 = require("langchain-core/language_models/chat_models");
7
+ const messages_1 = require("@langchain/core/messages");
8
+ const outputs_1 = require("@langchain/core/outputs");
9
+ const env_1 = require("@langchain/core/utils/env");
10
+ const chat_models_1 = require("@langchain/core/language_models/chat_models");
11
11
  /**
12
12
  * Extracts the custom role of a generic chat message.
13
13
  * @param message The chat message from which to extract the custom role.
@@ -1,12 +1,12 @@
1
1
  import { Anthropic, AI_PROMPT, HUMAN_PROMPT, ClientOptions } from "@anthropic-ai/sdk";
2
2
  import type { CompletionCreateParams } from "@anthropic-ai/sdk/resources/completions";
3
3
  import type { Stream } from "@anthropic-ai/sdk/streaming";
4
- import { CallbackManagerForLLMRun } from "langchain-core/callbacks/manager";
5
- import { type BaseMessage } from "langchain-core/messages";
6
- import { ChatGenerationChunk, type ChatResult } from "langchain-core/outputs";
7
- import { BaseChatModel, type BaseChatModelParams } from "langchain-core/language_models/chat_models";
8
- import { type BaseLanguageModelCallOptions } from "langchain-core/language_models/base";
9
- export { AI_PROMPT, HUMAN_PROMPT, };
4
+ import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager";
5
+ import { type BaseMessage } from "@langchain/core/messages";
6
+ import { ChatGenerationChunk, type ChatResult } from "@langchain/core/outputs";
7
+ import { BaseChatModel, type BaseChatModelParams } from "@langchain/core/language_models/chat_models";
8
+ import { type BaseLanguageModelCallOptions } from "@langchain/core/language_models/base";
9
+ export { AI_PROMPT, HUMAN_PROMPT };
10
10
  export declare const DEFAULT_STOP_SEQUENCES: string[];
11
11
  /**
12
12
  * Input to AnthropicChat class.
@@ -1,9 +1,9 @@
1
1
  import { Anthropic, AI_PROMPT, HUMAN_PROMPT, } from "@anthropic-ai/sdk";
2
- import { AIMessage, AIMessageChunk, ChatMessage, } from "langchain-core/messages";
3
- import { ChatGenerationChunk, } from "langchain-core/outputs";
4
- import { getEnvironmentVariable } from "langchain-core/utils/env";
5
- import { BaseChatModel, } from "langchain-core/language_models/chat_models";
6
- export { AI_PROMPT, HUMAN_PROMPT, };
2
+ import { AIMessage, AIMessageChunk, ChatMessage, } from "@langchain/core/messages";
3
+ import { ChatGenerationChunk, } from "@langchain/core/outputs";
4
+ import { getEnvironmentVariable } from "@langchain/core/utils/env";
5
+ import { BaseChatModel, } from "@langchain/core/language_models/chat_models";
6
+ export { AI_PROMPT, HUMAN_PROMPT };
7
7
  /**
8
8
  * Extracts the custom role of a generic chat message.
9
9
  * @param message The chat message from which to extract the custom role.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/anthropic",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Anthropic integrations for LangChain.js",
5
5
  "type": "module",
6
6
  "engines": {
@@ -18,9 +18,11 @@
18
18
  "build:cjs": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist-cjs/ -p tsconfig.cjs.json && node scripts/move-cjs-to-dist.js && rimraf dist-cjs",
19
19
  "build:watch": "node scripts/create-entrypoints.js && tsc --outDir dist/ --watch",
20
20
  "build:scripts": "node scripts/create-entrypoints.js && node scripts/check-tree-shaking.js",
21
- "lint": "NODE_OPTIONS=--max-old-space-size=4096 eslint src && dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
22
- "lint:fix": "yarn lint --fix",
23
- "clean": "rimraf dist/ && NODE_OPTIONS=--max-old-space-size=4096 node scripts/create-entrypoints.js pre",
21
+ "lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint src",
22
+ "lint:dpdm": "dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
23
+ "lint": "yarn lint:eslint && yarn lint:dpdm",
24
+ "lint:fix": "yarn lint:eslint --fix && yarn lint:dpdm",
25
+ "clean": "rimraf .turbo/ dist/ && NODE_OPTIONS=--max-old-space-size=4096 node scripts/create-entrypoints.js pre",
24
26
  "prepack": "yarn build",
25
27
  "release": "release-it --only-version --config .release-it.json",
26
28
  "test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
@@ -33,7 +35,7 @@
33
35
  "license": "MIT",
34
36
  "dependencies": {
35
37
  "@anthropic-ai/sdk": "^0.10.0",
36
- "langchain-core": "^0.0.3"
38
+ "@langchain/core": "~0.1.0"
37
39
  },
38
40
  "devDependencies": {
39
41
  "@jest/globals": "^29.5.0",
@@ -44,15 +46,15 @@
44
46
  "eslint-config-airbnb-base": "^15.0.0",
45
47
  "eslint-config-prettier": "^8.6.0",
46
48
  "eslint-plugin-import": "^2.27.5",
49
+ "eslint-plugin-jest": "^27.6.0",
47
50
  "eslint-plugin-no-instanceof": "^1.0.1",
48
51
  "eslint-plugin-prettier": "^4.2.1",
49
52
  "jest": "^29.5.0",
50
53
  "jest-environment-node": "^29.6.4",
51
- "langchain-core": "workspace:*",
52
54
  "prettier": "^2.8.3",
53
55
  "release-it": "^15.10.1",
54
56
  "rimraf": "^5.0.1",
55
- "typescript": "^5.0.0"
57
+ "typescript": "~5.1.6"
56
58
  },
57
59
  "publishConfig": {
58
60
  "access": "public"
@@ -67,7 +69,7 @@
67
69
  "chatgpt",
68
70
  "machine learning",
69
71
  "ml",
70
- "openai",
72
+ "anthropic",
71
73
  "embeddings",
72
74
  "vectorstores"
73
75
  ],