Replies: 1 comment
-
🤖 Hello, The error message "Cannot read properties of undefined (reading 'callKeys')" typically indicates that you're trying to access a property or method on an object that is undefined. In this case, it seems like the error is originating from the Looking at the stack trace, the error is thrown at this line: at LLMChain._call (file:///C:/Users/Edgar/Desktop/Stuff/Acode/nextprojectd/node_modules/langchain/dist/chains/llm_chain.js:114:36) This suggests that the Looking at your code, it seems like the overallChain = new SimpleSequentialChain({
chains: [reviewChain1, vectorChain],
verbose: true,
}); However, To fix this, you could initialize Here's how you could initialize let reviewChain1 = null;
let vectorChain = null;
// ...
if (firstOne) {
// ...
reviewChain1 = new LLMChain({
model1,
prompt: reviewPromptTemplate1,
});
// ...
vectorChain = new RetrievalQAChain({
combineDocumentsChain: loadQAStuffChain(model2),
retriever: vectoreStore.asRetriever(),
returnSourceDocuments: false,
});
}
// ... Then, in the overallChain = new SimpleSequentialChain({
chains: [reviewChain1, vectorChain].filter(chain => chain !== null),
verbose: true,
}); I hope this helps! Let me know if you have any other questions. SourcesThis response is meant to be useful and save you time. 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. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Why am I getting this error and how can I fix it?
The code I have is:
Beta Was this translation helpful? Give feedback.
All reactions