langchain 0.1.20 → 0.1.22

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.
package/README.md CHANGED
@@ -51,7 +51,7 @@ The LangChain libraries themselves are made up of several different packages.
51
51
 
52
52
  Integrations may also be split into their own compatible packages.
53
53
 
54
- ![LangChain Stack](https://github.com/langchain-ai/langchainjs/blob/main/docs/core_docs/static/img/langchain_stack.png)
54
+ ![LangChain Stack](https://github.com/langchain-ai/langchainjs/blob/main/docs/core_docs/static/img/langchain_stack_feb_2024.webp)
55
55
 
56
56
  This library aims to assist in the development of those types of applications. Common examples of these applications include:
57
57
 
@@ -47,7 +47,8 @@ class BaseChain extends base_1.BaseLangChain {
47
47
  * @param config Optional configuration for the Runnable.
48
48
  * @returns Promise that resolves with the output of the chain run.
49
49
  */
50
- async invoke(input, config) {
50
+ async invoke(input, options) {
51
+ const [config] = this._getOptionsList(options ?? {}, 1);
51
52
  const fullValues = await this._formatValues(input);
52
53
  const callbackManager_ = await manager_1.CallbackManager.configure(config?.callbacks, this.callbacks, config?.tags, this.tags, config?.metadata, this.metadata, { verbose: this.verbose });
53
54
  const runManager = await callbackManager_?.handleChainStart(this.toJSON(), fullValues, undefined, undefined, undefined, undefined, config?.runName);
@@ -1,7 +1,7 @@
1
1
  import { BaseMemory } from "@langchain/core/memory";
2
2
  import { ChainValues } from "@langchain/core/utils/types";
3
3
  import { CallbackManagerForChainRun, CallbackManager, Callbacks } from "@langchain/core/callbacks/manager";
4
- import type { RunnableConfig } from "@langchain/core/runnables";
4
+ import { type RunnableConfig } from "@langchain/core/runnables";
5
5
  import { BaseLangChain, BaseLangChainParams } from "@langchain/core/language_models/base";
6
6
  import { SerializedBaseChain } from "./serde.js";
7
7
  export type LoadValues = Record<string, any>;
@@ -31,7 +31,7 @@ export declare abstract class BaseChain<RunInput extends ChainValues = ChainValu
31
31
  * @param config Optional configuration for the Runnable.
32
32
  * @returns Promise that resolves with the output of the chain run.
33
33
  */
34
- invoke(input: RunInput, config?: RunnableConfig): Promise<RunOutput>;
34
+ invoke(input: RunInput, options?: RunnableConfig): Promise<RunOutput>;
35
35
  private _validateOutputs;
36
36
  prepOutputs(inputs: Record<string, unknown>, outputs: Record<string, unknown>, returnOnlyOutputs?: boolean): Promise<Record<string, unknown>>;
37
37
  /**
@@ -44,7 +44,8 @@ export class BaseChain extends BaseLangChain {
44
44
  * @param config Optional configuration for the Runnable.
45
45
  * @returns Promise that resolves with the output of the chain run.
46
46
  */
47
- async invoke(input, config) {
47
+ async invoke(input, options) {
48
+ const [config] = this._getOptionsList(options ?? {}, 1);
48
49
  const fullValues = await this._formatValues(input);
49
50
  const callbackManager_ = await CallbackManager.configure(config?.callbacks, this.callbacks, config?.tags, this.tags, config?.metadata, this.metadata, { verbose: this.verbose });
50
51
  const runManager = await callbackManager_?.handleChainStart(this.toJSON(), fullValues, undefined, undefined, undefined, undefined, config?.runName);
@@ -49,6 +49,8 @@ function getAnthropicPromptFromMessage(message) {
49
49
  }
50
50
  exports.DEFAULT_STOP_SEQUENCES = [sdk_1.HUMAN_PROMPT];
51
51
  /**
52
+ * @deprecated Install and import from the "@langchain/anthropic" integration package instead.
53
+ *
52
54
  * Wrapper around Anthropic large language models.
53
55
  *
54
56
  * To use you should have the `@anthropic-ai/sdk` package installed, with the
@@ -10,6 +10,7 @@ export { AI_PROMPT, HUMAN_PROMPT };
10
10
  export declare const DEFAULT_STOP_SEQUENCES: string[];
11
11
  /**
12
12
  * Input to AnthropicChat class.
13
+ * @deprecated Install and import from the "@langchain/anthropic" integration package instead.
13
14
  */
14
15
  export interface AnthropicInput {
15
16
  /** Amount of randomness injected into the response. Ranges
@@ -61,6 +62,8 @@ export interface AnthropicInput {
61
62
  */
62
63
  type Kwargs = Record<string, any>;
63
64
  /**
65
+ * @deprecated Install and import from the "@langchain/anthropic" integration package instead.
66
+ *
64
67
  * Wrapper around Anthropic large language models.
65
68
  *
66
69
  * To use you should have the `@anthropic-ai/sdk` package installed, with the
@@ -45,6 +45,8 @@ function getAnthropicPromptFromMessage(message) {
45
45
  }
46
46
  export const DEFAULT_STOP_SEQUENCES = [HUMAN_PROMPT];
47
47
  /**
48
+ * @deprecated Install and import from the "@langchain/anthropic" integration package instead.
49
+ *
48
50
  * Wrapper around Anthropic large language models.
49
51
  *
50
52
  * To use you should have the `@anthropic-ai/sdk` package installed, with the
@@ -34,6 +34,7 @@ export declare class OllamaFunctions extends BaseChatModel<ChatOllamaFunctionsCa
34
34
  invocationParams(): {
35
35
  model: string;
36
36
  format: import("@langchain/core/utils/types").StringWithAutocomplete<"json"> | undefined;
37
+ keep_alive: string;
37
38
  options: {
38
39
  embedding_only: boolean | undefined;
39
40
  f16_kv: boolean | undefined;
@@ -17,5 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.cjs");
18
18
  /* #__PURE__ */ (0, entrypoint_deprecation_js_1.logVersion010MigrationWarning)({
19
19
  oldEntrypointName: "stores/message/mongodb",
20
+ newEntrypointName: "",
21
+ newPackageName: "@langchain/mongodb",
20
22
  });
21
23
  __exportStar(require("@langchain/community/stores/message/mongodb"), exports);
@@ -1,5 +1,7 @@
1
1
  import { logVersion010MigrationWarning } from "../../util/entrypoint_deprecation.js";
2
2
  /* #__PURE__ */ logVersion010MigrationWarning({
3
3
  oldEntrypointName: "stores/message/mongodb",
4
+ newEntrypointName: "",
5
+ newPackageName: "@langchain/mongodb",
4
6
  });
5
7
  export * from "@langchain/community/stores/message/mongodb";
@@ -17,5 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  const entrypoint_deprecation_js_1 = require("../util/entrypoint_deprecation.cjs");
18
18
  /* #__PURE__ */ (0, entrypoint_deprecation_js_1.logVersion010MigrationWarning)({
19
19
  oldEntrypointName: "vectorstores/mongodb_atlas",
20
+ newEntrypointName: "",
21
+ newPackageName: "@langchain/mongodb",
20
22
  });
21
23
  __exportStar(require("@langchain/community/vectorstores/mongodb_atlas"), exports);
@@ -1,5 +1,7 @@
1
1
  import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
2
2
  /* #__PURE__ */ logVersion010MigrationWarning({
3
3
  oldEntrypointName: "vectorstores/mongodb_atlas",
4
+ newEntrypointName: "",
5
+ newPackageName: "@langchain/mongodb",
4
6
  });
5
7
  export * from "@langchain/community/vectorstores/mongodb_atlas";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langchain",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Typescript bindings for langchain",
5
5
  "type": "module",
6
6
  "engines": {
@@ -1293,8 +1293,7 @@
1293
1293
  "ts-jest": "^29.1.0",
1294
1294
  "typeorm": "^0.3.12",
1295
1295
  "typescript": "~5.1.6",
1296
- "vectordb": "^0.1.4",
1297
- "weaviate-ts-client": "^1.4.0",
1296
+ "weaviate-ts-client": "^2.0.0",
1298
1297
  "web-auth-library": "^1.0.3",
1299
1298
  "wikipedia": "^2.1.2",
1300
1299
  "youtube-transcript": "^1.0.6",
@@ -1333,7 +1332,7 @@
1333
1332
  "ioredis": "^5.3.2",
1334
1333
  "jsdom": "*",
1335
1334
  "mammoth": "^1.6.0",
1336
- "mongodb": "^5.2.0",
1335
+ "mongodb": ">=5.2.0",
1337
1336
  "node-llama-cpp": "*",
1338
1337
  "notion-to-md": "^3.1.0",
1339
1338
  "officeparser": "^4.0.4",
@@ -1346,8 +1345,7 @@
1346
1345
  "sonix-speech-recognition": "^2.1.1",
1347
1346
  "srt-parser-2": "^1.2.3",
1348
1347
  "typeorm": "^0.3.12",
1349
- "vectordb": "^0.1.4",
1350
- "weaviate-ts-client": "^1.4.0",
1348
+ "weaviate-ts-client": "*",
1351
1349
  "web-auth-library": "^1.0.3",
1352
1350
  "ws": "^8.14.2",
1353
1351
  "youtube-transcript": "^1.0.6",
@@ -1492,9 +1490,6 @@
1492
1490
  "typeorm": {
1493
1491
  "optional": true
1494
1492
  },
1495
- "vectordb": {
1496
- "optional": true
1497
- },
1498
1493
  "weaviate-ts-client": {
1499
1494
  "optional": true
1500
1495
  },
@@ -1513,8 +1508,8 @@
1513
1508
  },
1514
1509
  "dependencies": {
1515
1510
  "@anthropic-ai/sdk": "^0.9.1",
1516
- "@langchain/community": "~0.0.29",
1517
- "@langchain/core": "~0.1.29",
1511
+ "@langchain/community": "~0.0.32",
1512
+ "@langchain/core": "~0.1.34",
1518
1513
  "@langchain/openai": "~0.0.14",
1519
1514
  "binary-extensions": "^2.2.0",
1520
1515
  "expr-eval": "^2.0.2",