@langchain/core 0.1.50 → 0.1.51
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/runnables/base.cjs +16 -10
- package/dist/runnables/base.js +16 -10
- package/dist/runnables/config.cjs +3 -0
- package/dist/runnables/config.d.ts +3 -0
- package/dist/runnables/config.js +3 -0
- package/dist/runnables/remote.cjs +1 -1
- package/dist/runnables/remote.js +1 -1
- package/package.json +1 -1
package/dist/runnables/base.cjs
CHANGED
|
@@ -165,16 +165,22 @@ class Runnable extends serializable_js_1.Serializable {
|
|
|
165
165
|
await wrappedGenerator.setup;
|
|
166
166
|
return stream_js_1.IterableReadableStream.fromAsyncGenerator(wrappedGenerator);
|
|
167
167
|
}
|
|
168
|
-
_separateRunnableConfigFromCallOptions(options
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
168
|
+
_separateRunnableConfigFromCallOptions(options) {
|
|
169
|
+
let runnableConfig;
|
|
170
|
+
if (options === undefined) {
|
|
171
|
+
runnableConfig = (0, config_js_1.ensureConfig)(options);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
runnableConfig = (0, config_js_1.ensureConfig)({
|
|
175
|
+
callbacks: options.callbacks,
|
|
176
|
+
tags: options.tags,
|
|
177
|
+
metadata: options.metadata,
|
|
178
|
+
runName: options.runName,
|
|
179
|
+
configurable: options.configurable,
|
|
180
|
+
recursionLimit: options.recursionLimit,
|
|
181
|
+
maxConcurrency: options.maxConcurrency,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
178
184
|
const callOptions = { ...options };
|
|
179
185
|
delete callOptions.callbacks;
|
|
180
186
|
delete callOptions.tags;
|
package/dist/runnables/base.js
CHANGED
|
@@ -158,16 +158,22 @@ export class Runnable extends Serializable {
|
|
|
158
158
|
await wrappedGenerator.setup;
|
|
159
159
|
return IterableReadableStream.fromAsyncGenerator(wrappedGenerator);
|
|
160
160
|
}
|
|
161
|
-
_separateRunnableConfigFromCallOptions(options
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
161
|
+
_separateRunnableConfigFromCallOptions(options) {
|
|
162
|
+
let runnableConfig;
|
|
163
|
+
if (options === undefined) {
|
|
164
|
+
runnableConfig = ensureConfig(options);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
runnableConfig = ensureConfig({
|
|
168
|
+
callbacks: options.callbacks,
|
|
169
|
+
tags: options.tags,
|
|
170
|
+
metadata: options.metadata,
|
|
171
|
+
runName: options.runName,
|
|
172
|
+
configurable: options.configurable,
|
|
173
|
+
recursionLimit: options.recursionLimit,
|
|
174
|
+
maxConcurrency: options.maxConcurrency,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
171
177
|
const callOptions = { ...options };
|
|
172
178
|
delete callOptions.callbacks;
|
|
173
179
|
delete callOptions.tags;
|
|
@@ -84,6 +84,9 @@ exports.mergeConfigs = mergeConfigs;
|
|
|
84
84
|
const PRIMITIVES = new Set(["string", "number", "boolean"]);
|
|
85
85
|
/**
|
|
86
86
|
* Ensure that a passed config is an object with all required keys present.
|
|
87
|
+
*
|
|
88
|
+
* Note: To make sure async local storage loading works correctly, this
|
|
89
|
+
* should not be called with a default or prepopulated config argument.
|
|
87
90
|
*/
|
|
88
91
|
function ensureConfig(config) {
|
|
89
92
|
const loadedConfig = config ?? index_js_1.AsyncLocalStorageProviderSingleton.getInstance().getStore();
|
|
@@ -17,6 +17,9 @@ export declare function getCallbackManagerForConfig(config?: RunnableConfig): Pr
|
|
|
17
17
|
export declare function mergeConfigs<CallOptions extends RunnableConfig>(...configs: (CallOptions | RunnableConfig | undefined | null)[]): Partial<CallOptions>;
|
|
18
18
|
/**
|
|
19
19
|
* Ensure that a passed config is an object with all required keys present.
|
|
20
|
+
*
|
|
21
|
+
* Note: To make sure async local storage loading works correctly, this
|
|
22
|
+
* should not be called with a default or prepopulated config argument.
|
|
20
23
|
*/
|
|
21
24
|
export declare function ensureConfig<CallOptions extends RunnableConfig>(config?: CallOptions): CallOptions;
|
|
22
25
|
/**
|
package/dist/runnables/config.js
CHANGED
|
@@ -79,6 +79,9 @@ export function mergeConfigs(...configs) {
|
|
|
79
79
|
const PRIMITIVES = new Set(["string", "number", "boolean"]);
|
|
80
80
|
/**
|
|
81
81
|
* Ensure that a passed config is an object with all required keys present.
|
|
82
|
+
*
|
|
83
|
+
* Note: To make sure async local storage loading works correctly, this
|
|
84
|
+
* should not be called with a default or prepopulated config argument.
|
|
82
85
|
*/
|
|
83
86
|
export function ensureConfig(config) {
|
|
84
87
|
const loadedConfig = config ?? AsyncLocalStorageProviderSingleton.getInstance().getStore();
|
package/dist/runnables/remote.js
CHANGED