Socket
Socket
Sign inDemoInstall

@langchain/core

Package Overview
Dependencies
Maintainers
11
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@langchain/core - npm Package Compare versions

Comparing version 0.3.10-rc.0 to 0.3.10

12

dist/context.js
/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */
import { AsyncLocalStorage } from "node:async_hooks";
import { RunTree } from "langsmith";
import { isRunTree } from "langsmith/run_trees";
import { _CONTEXT_VARIABLES_KEY, AsyncLocalStorageProviderSingleton, } from "./singletons/index.js";

@@ -60,7 +62,9 @@ AsyncLocalStorageProviderSingleton.initializeGlobalInstance(new AsyncLocalStorage());

contextVars[name] = value;
let newValue = {};
if (isRunTree(runTree)) {
newValue = new RunTree(runTree);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
AsyncLocalStorageProviderSingleton.getInstance().enterWith({
...runTree,
[_CONTEXT_VARIABLES_KEY]: contextVars,
});
newValue[_CONTEXT_VARIABLES_KEY] = contextVars;
AsyncLocalStorageProviderSingleton.getInstance().enterWith(newValue);
}

@@ -67,0 +71,0 @@ /**

export interface AsyncLocalStorageInterface {
getStore: () => any | undefined;
run: <T>(store: any, callback: () => T) => T;
enterWith: (store: any) => void;
}

@@ -8,2 +9,3 @@ export declare class MockAsyncLocalStorage implements AsyncLocalStorageInterface {

run<T>(_store: any, callback: () => T): T;
enterWith(_store: any): undefined;
}

@@ -10,0 +12,0 @@ export declare const _CONTEXT_VARIABLES_KEY: unique symbol;

@@ -11,2 +11,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

}
enterWith(_store) {
return undefined;
}
}

@@ -13,0 +16,0 @@ const mockAsyncLocalStorage = new MockAsyncLocalStorage();

{
"name": "@langchain/core",
"version": "0.3.10-rc.0",
"version": "0.3.10",
"description": "Core LangChain.js abstractions and schemas",

@@ -40,3 +40,3 @@ "type": "module",

"js-tiktoken": "^1.0.12",
"langsmith": "^0.1.64",
"langsmith": "^0.1.65",
"mustache": "^4.2.0",

@@ -43,0 +43,0 @@ "p-queue": "^6.6.2",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc