Nuno Campos

Results 249 comments of Nuno Campos

The langchain package is now ESM only. You can fix that by adding `"type": "module"` to your `package.json`. You can find more information here https://hwchase17.github.io/langchainjs/docs/getting-started/

@irl-dan we converted the package to ESM so that we can support other environments outside of Node, which are ESM only, discussion here https://github.com/hwchase17/langchainjs/discussions/152 You also have the option to...

Some more information on your issue here https://stackoverflow.com/questions/65265420/how-to-prevent-typescript-from-transpiling-dynamic-imports-into-require A solution for you appears to be "moduleResolution": "node16", see here https://github.com/microsoft/TypeScript/issues/43329#issuecomment-1315512792

I think the issue might be an `s` missing on `input_document` on the last line, should be `input_documents`

Ah, `input_documents` is expected to be an array of `Document`, see eg the second code block in this page https://hwchase17.github.io/langchainjs/docs/modules/chains/summarization You can get an array of Documents from eg a...

Updated link https://js.langchain.com/docs/getting-started/install

@imrank1 the reason we made the library ESM only is that allows us to use ESM-only dependencies. To add a commonjs export you'd have to review every existing dependency to...

@imrank1 see an example here https://github.com/sullivan-sean/chat-langchainjs/ Or maybe better to look at my branch updating it to latest langchain version https://github.com/nfcampos/chat-langchainjs/tree/nc/lc0037