Closed sinedied closed 9 months ago
Answer generated by a 🤖
Hello,
The error message you're seeing is indicating that TypeScript is unable to locate the import_type.js
module. This module is indeed imported in the langchain/src/load/index.ts
file, which suggests that the module might have been removed, renamed, or moved to a different location in the LangChain version 0.0.125.
As for the load
function, it is used to deserialize data. It takes three parameters: text
, secretsMap
, and optionalImportsMap
. The text
parameter is the serialized data in string format, secretsMap
is an object that maps secret keys to their values, and optionalImportsMap
is an object that maps optional import entry points to their modules.
Here's an example of how you can use the load
function:
import { load } from "langchain/load";
const text = /* serialized data */;
const secretsMap = /* map of secret keys to values */;
const optionalImportsMap = /* map of optional import entry points to modules */;
const data = await load(text, secretsMap, optionalImportsMap);
Please replace the comments with actual values. If this doesn't solve your problem, could you please provide more information about the load
function and the import_type.js
module?
Unfortunately, I wasn't able to find any changes made to the LangChain codebase in version 0.0.125 that could have affected the import_type.js
module. If you have more information about this, it would be helpful.
Let me know if you have any other questions or need further clarification.
Best, Dosu
This response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
Looks like a bug - will have a look tomorrow!
Hey sorry for the delay - just tried with the latest version and it worked fine. Can you give me any other info on your setup?
Hi, @sinedied! I'm Dosu, and I'm here to help the langchainjs team manage their backlog. I wanted to let you know that we are marking this issue as stale.
From what I understand, the issue you reported is related to a TypeScript compilation error when importing from langchain/load
in version 0.0.125
. The error specifically mentions that it cannot find the module ./import_type.js
. Jacoblee93 has confirmed this as a bug and has requested more information about your setup.
Before we proceed, we would like to know if this issue is still relevant to the latest version of the langchainjs repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.
Thank you for your understanding and cooperation!
Using langchain
0.0.125
, if I try to use this import:I get a TS compilation error:
The
import_type.js
file doesn't seem to exists?Or is there another function I should use to deserialize data? Thanks