@langchain/core 0.0.11-rc.1 → 0.0.11
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/load/index.cjs +6 -8
- package/dist/load/index.js +6 -8
- package/dist/runnables/base.cjs +4 -1
- package/dist/runnables/base.d.ts +2 -0
- package/dist/runnables/base.js +2 -0
- package/dist/runnables/index.cjs +2 -1
- package/dist/runnables/index.d.ts +1 -1
- package/dist/runnables/index.js +1 -1
- package/package.json +1 -1
package/dist/load/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.load = void 0;
|
|
27
27
|
const serializable_js_1 = require("./serializable.cjs");
|
|
28
28
|
const import_constants_js_1 = require("./import_constants.cjs");
|
|
29
|
-
const
|
|
29
|
+
const coreImportMap = __importStar(require("./import_map.cjs"));
|
|
30
30
|
const map_keys_js_1 = require("./map_keys.cjs");
|
|
31
31
|
const env_js_1 = require("../utils/env.cjs");
|
|
32
32
|
function combineAliasesAndInvert(constructor) {
|
|
@@ -91,7 +91,7 @@ async function reviver(value) {
|
|
|
91
91
|
const str = JSON.stringify(serialized);
|
|
92
92
|
const [name, ...namespaceReverse] = serialized.id.slice().reverse();
|
|
93
93
|
const namespace = namespaceReverse.reverse();
|
|
94
|
-
const
|
|
94
|
+
const importMaps = { langchain_core: coreImportMap, langchain: importMap };
|
|
95
95
|
let module = null;
|
|
96
96
|
const optionalImportNamespaceAliases = [namespace.join("/")];
|
|
97
97
|
if (namespace[0] === "langchain_community") {
|
|
@@ -110,12 +110,10 @@ async function reviver(value) {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
else {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
namespace[0]
|
|
117
|
-
namespace[0] === "langchain_anthropic" ||
|
|
118
|
-
namespace[0] === "langchain_openai") {
|
|
113
|
+
let finalImportMap;
|
|
114
|
+
// Currently, we only support langchain and langchain_core imports.
|
|
115
|
+
if (namespace[0] === "langchain" || namespace[0] === "langchain_core") {
|
|
116
|
+
finalImportMap = importMaps[namespace[0]];
|
|
119
117
|
namespace.shift();
|
|
120
118
|
}
|
|
121
119
|
else {
|
package/dist/load/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { get_lc_unique_name, } from "./serializable.js";
|
|
2
2
|
import { optionalImportEntrypoints as defaultOptionalImportEntrypoints } from "./import_constants.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as coreImportMap from "./import_map.js";
|
|
4
4
|
import { keyFromJson, mapKeys } from "./map_keys.js";
|
|
5
5
|
import { getEnvironmentVariable } from "../utils/env.js";
|
|
6
6
|
function combineAliasesAndInvert(constructor) {
|
|
@@ -65,7 +65,7 @@ async function reviver(value) {
|
|
|
65
65
|
const str = JSON.stringify(serialized);
|
|
66
66
|
const [name, ...namespaceReverse] = serialized.id.slice().reverse();
|
|
67
67
|
const namespace = namespaceReverse.reverse();
|
|
68
|
-
const
|
|
68
|
+
const importMaps = { langchain_core: coreImportMap, langchain: importMap };
|
|
69
69
|
let module = null;
|
|
70
70
|
const optionalImportNamespaceAliases = [namespace.join("/")];
|
|
71
71
|
if (namespace[0] === "langchain_community") {
|
|
@@ -84,12 +84,10 @@ async function reviver(value) {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
namespace[0]
|
|
91
|
-
namespace[0] === "langchain_anthropic" ||
|
|
92
|
-
namespace[0] === "langchain_openai") {
|
|
87
|
+
let finalImportMap;
|
|
88
|
+
// Currently, we only support langchain and langchain_core imports.
|
|
89
|
+
if (namespace[0] === "langchain" || namespace[0] === "langchain_core") {
|
|
90
|
+
finalImportMap = importMaps[namespace[0]];
|
|
93
91
|
namespace.shift();
|
|
94
92
|
}
|
|
95
93
|
else {
|
package/dist/runnables/base.cjs
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports._coerceToRunnable = exports.RunnableWithFallbacks = exports.RunnableLambda = exports.RunnableMap = exports.RunnableSequence = exports.RunnableRetry = exports.RunnableEach = exports.RunnableBinding = exports.Runnable = void 0;
|
|
6
|
+
exports._coerceToRunnable = exports.RunnableWithFallbacks = exports.RunnableParallel = exports.RunnableLambda = exports.RunnableMap = exports.RunnableSequence = exports.RunnableRetry = exports.RunnableEach = exports.RunnableBinding = exports.Runnable = void 0;
|
|
7
7
|
const p_retry_1 = __importDefault(require("p-retry"));
|
|
8
8
|
const manager_js_1 = require("../callbacks/manager.cjs");
|
|
9
9
|
const log_stream_js_1 = require("../tracers/log_stream.cjs");
|
|
@@ -1011,6 +1011,9 @@ class RunnableLambda extends Runnable {
|
|
|
1011
1011
|
}
|
|
1012
1012
|
}
|
|
1013
1013
|
exports.RunnableLambda = RunnableLambda;
|
|
1014
|
+
class RunnableParallel extends RunnableMap {
|
|
1015
|
+
}
|
|
1016
|
+
exports.RunnableParallel = RunnableParallel;
|
|
1014
1017
|
/**
|
|
1015
1018
|
* A Runnable that can fallback to other Runnables if it fails.
|
|
1016
1019
|
*/
|
package/dist/runnables/base.d.ts
CHANGED
|
@@ -385,6 +385,8 @@ export declare class RunnableLambda<RunInput, RunOutput> extends Runnable<RunInp
|
|
|
385
385
|
_invoke(input: RunInput, config?: Partial<BaseCallbackConfig>, runManager?: CallbackManagerForChainRun): Promise<RunOutput>;
|
|
386
386
|
invoke(input: RunInput, options?: Partial<BaseCallbackConfig>): Promise<RunOutput>;
|
|
387
387
|
}
|
|
388
|
+
export declare class RunnableParallel<RunInput> extends RunnableMap<RunInput> {
|
|
389
|
+
}
|
|
388
390
|
/**
|
|
389
391
|
* A Runnable that can fallback to other Runnables if it fails.
|
|
390
392
|
*/
|
package/dist/runnables/base.js
CHANGED
|
@@ -998,6 +998,8 @@ export class RunnableLambda extends Runnable {
|
|
|
998
998
|
return this._callWithConfig(this._invoke, input, options);
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
|
+
export class RunnableParallel extends RunnableMap {
|
|
1002
|
+
}
|
|
1001
1003
|
/**
|
|
1002
1004
|
* A Runnable that can fallback to other Runnables if it fails.
|
|
1003
1005
|
*/
|
package/dist/runnables/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RunnableWithMessageHistory = exports.RunnableBranch = exports.RouterRunnable = exports.RunnableAssign = exports.RunnablePassthrough = exports._coerceToRunnable = exports.RunnableWithFallbacks = exports.RunnableLambda = exports.RunnableMap = exports.RunnableSequence = exports.RunnableRetry = exports.RunnableEach = exports.RunnableBinding = exports.Runnable = void 0;
|
|
3
|
+
exports.RunnableWithMessageHistory = exports.RunnableBranch = exports.RouterRunnable = exports.RunnableAssign = exports.RunnablePassthrough = exports._coerceToRunnable = exports.RunnableWithFallbacks = exports.RunnableLambda = exports.RunnableParallel = exports.RunnableMap = exports.RunnableSequence = exports.RunnableRetry = exports.RunnableEach = exports.RunnableBinding = exports.Runnable = void 0;
|
|
4
4
|
var base_js_1 = require("./base.cjs");
|
|
5
5
|
Object.defineProperty(exports, "Runnable", { enumerable: true, get: function () { return base_js_1.Runnable; } });
|
|
6
6
|
Object.defineProperty(exports, "RunnableBinding", { enumerable: true, get: function () { return base_js_1.RunnableBinding; } });
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "RunnableEach", { enumerable: true, get: function
|
|
|
8
8
|
Object.defineProperty(exports, "RunnableRetry", { enumerable: true, get: function () { return base_js_1.RunnableRetry; } });
|
|
9
9
|
Object.defineProperty(exports, "RunnableSequence", { enumerable: true, get: function () { return base_js_1.RunnableSequence; } });
|
|
10
10
|
Object.defineProperty(exports, "RunnableMap", { enumerable: true, get: function () { return base_js_1.RunnableMap; } });
|
|
11
|
+
Object.defineProperty(exports, "RunnableParallel", { enumerable: true, get: function () { return base_js_1.RunnableParallel; } });
|
|
11
12
|
Object.defineProperty(exports, "RunnableLambda", { enumerable: true, get: function () { return base_js_1.RunnableLambda; } });
|
|
12
13
|
Object.defineProperty(exports, "RunnableWithFallbacks", { enumerable: true, get: function () { return base_js_1.RunnableWithFallbacks; } });
|
|
13
14
|
Object.defineProperty(exports, "_coerceToRunnable", { enumerable: true, get: function () { return base_js_1._coerceToRunnable; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type RunnableFunc, type RunnableLike, type RunnableBatchOptions, type RunnableRetryFailedAttemptHandler, Runnable, type RunnableBindingArgs, RunnableBinding, RunnableEach, RunnableRetry, RunnableSequence, RunnableMap, RunnableLambda, RunnableWithFallbacks, _coerceToRunnable, } from "./base.js";
|
|
1
|
+
export { type RunnableFunc, type RunnableLike, type RunnableBatchOptions, type RunnableRetryFailedAttemptHandler, Runnable, type RunnableBindingArgs, RunnableBinding, RunnableEach, RunnableRetry, RunnableSequence, RunnableMap, RunnableParallel, RunnableLambda, RunnableWithFallbacks, _coerceToRunnable, } from "./base.js";
|
|
2
2
|
export type { RunnableConfig, getCallbackMangerForConfig } from "./config.js";
|
|
3
3
|
export { RunnablePassthrough, RunnableAssign } from "./passthrough.js";
|
|
4
4
|
export { type RouterInput, RouterRunnable } from "./router.js";
|
package/dist/runnables/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Runnable, RunnableBinding, RunnableEach, RunnableRetry, RunnableSequence, RunnableMap, RunnableLambda, RunnableWithFallbacks, _coerceToRunnable, } from "./base.js";
|
|
1
|
+
export { Runnable, RunnableBinding, RunnableEach, RunnableRetry, RunnableSequence, RunnableMap, RunnableParallel, RunnableLambda, RunnableWithFallbacks, _coerceToRunnable, } from "./base.js";
|
|
2
2
|
export { RunnablePassthrough, RunnableAssign } from "./passthrough.js";
|
|
3
3
|
export { RouterRunnable } from "./router.js";
|
|
4
4
|
export { RunnableBranch } from "./branch.js";
|