langchain 0.1.21 → 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/dist/chains/base.cjs
CHANGED
|
@@ -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,
|
|
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);
|
package/dist/chains/base.d.ts
CHANGED
|
@@ -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
|
|
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,
|
|
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
|
/**
|
package/dist/chains/base.js
CHANGED
|
@@ -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,
|
|
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langchain",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Typescript bindings for langchain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -1509,7 +1509,7 @@
|
|
|
1509
1509
|
"dependencies": {
|
|
1510
1510
|
"@anthropic-ai/sdk": "^0.9.1",
|
|
1511
1511
|
"@langchain/community": "~0.0.32",
|
|
1512
|
-
"@langchain/core": "~0.1.
|
|
1512
|
+
"@langchain/core": "~0.1.34",
|
|
1513
1513
|
"@langchain/openai": "~0.0.14",
|
|
1514
1514
|
"binary-extensions": "^2.2.0",
|
|
1515
1515
|
"expr-eval": "^2.0.2",
|