Replies: 2 comments 1 reply
-
Answer generated by a 🤖 AnswerHello, The error you're encountering, "input values have 2 keys, you must specify an input key or pass only 1 key as input", is likely due to the fact that the get inputKeys() {
return [this.inputKey, this.chatHistoryKey];
} If you're not providing these keys when calling the const chainValues = {
question: "Your question here",
chat_history: "Your chat history here"
};
const result = await conversationalRetrievalQAChain._call(chainValues); As for adapting to the schema changes in the latest LangChain update, the In your code, the If the schema changes involve the way chat history is passed, you can also pass the chat history in explicitly by omitting the If you want to further change the chain's behavior, you can change the prompts for both the underlying question generation chain and the QA chain. You can pass an alternative prompt for the question generation chain that also returns parts of the chat history relevant to the answer, allowing the QA chain to answer meta questions with the additional context. In your code, it's also shown that you can use the Additionally, you can override the default prompts used in the chain by passing a Finally, you can use the I hope this helps! If you have any other questions or need further clarification, feel free to ask. Sources
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. |
Beta Was this translation helpful? Give feedback.
-
You have to add memory key chat_history to the buffer memory: const bufferMemory = new BufferMemory({ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I can't use any memory to give the bot the chat_history. The error is:
Also, it seems Langchain is updating and the schema is changing as well. here is my code:
Beta Was this translation helpful? Give feedback.
All reactions