Closed engeman2008 closed 1 year ago
🤖
Hello,
The error you're encountering is due to the fact that the call
or run
method of the ConstitutionalChain
class is expecting a single key-value pair in the values
parameter, but it is receiving an object with more than one key-value pair.
To resolve this issue, you need to specify an inputKey
when creating your memory instance. This inputKey
should match the key of the input you're passing to the call
or run
method. Here's an example of how to do it:
const memory = new BufferMemory({
inputKey: "input",
chatHistory: new DynamoDBChatMessageHistory({
tableName: "langchain",
partitionKey: "id",
sessionId: new Date().toISOString(), // Or some other unique identifier for the conversation
config: {
region: "us-east-2",
credentials: {
accessKeyId: "<your AWS access key id>",
secretAccessKey: "<your AWS secret access key>",
},
},
}),
});
This solution was suggested in a similar issue: Error: input values have 2 keys
when using abort signal mid streaming for ConversationChain
As for the memory placement, the context provided does not include any reference to memory or its management. Therefore, it's not possible to provide a specific location for memory placement based on the provided context.
I hope this helps! If you have any other questions, feel free to ask.
Best, Dosu
Error: input values have 2 keys
when using abort signal mid streaming for ConversationChainThis 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.
Thank you, this solved my issue !
I have prompt
and chain
and constitution chain
when i try to cal the constitution chain
or
I get the following error when using call or run
am I missing something ? where should i put the memory and why i am getting that error