@langchain/core
Advanced tools
Comparing version 0.3.10 to 0.3.11
@@ -51,3 +51,3 @@ /** | ||
*/ | ||
export declare function setContextVariable(name: PropertyKey, value: any): void; | ||
export declare function setContextVariable<T>(name: PropertyKey, value: T): void; | ||
/** | ||
@@ -102,2 +102,2 @@ * Get the value of a previously set context variable. Context variables | ||
*/ | ||
export declare function getContextVariable(name: PropertyKey): any; | ||
export declare function getContextVariable<T = any>(name: PropertyKey): T | undefined; |
@@ -300,5 +300,19 @@ import { z } from "zod"; | ||
`${fields.name} tool`, | ||
// TS doesn't restrict the type here based on the guard above | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
func: func, | ||
func: async (input, runManager, config) => { | ||
return new Promise((resolve, reject) => { | ||
const childConfig = patchConfig(config, { | ||
callbacks: runManager?.getChild(), | ||
}); | ||
void AsyncLocalStorageProviderSingleton.runWithConfig(childConfig, async () => { | ||
try { | ||
// TS doesn't restrict the type here based on the guard above | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
resolve(func(input, childConfig)); | ||
} | ||
catch (e) { | ||
reject(e); | ||
} | ||
}); | ||
}); | ||
}, | ||
}); | ||
@@ -305,0 +319,0 @@ } |
{ | ||
"name": "@langchain/core", | ||
"version": "0.3.10", | ||
"version": "0.3.11", | ||
"description": "Core LangChain.js abstractions and schemas", | ||
@@ -71,3 +71,3 @@ "type": "module", | ||
"typescript": "~5.1.6", | ||
"web-streams-polyfill": "^3.3.3" | ||
"web-streams-polyfill": "^4.0.0" | ||
}, | ||
@@ -74,0 +74,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2216079
55509