-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConversationChain Validation Error #2024
Comments
In your memory function, you can define:
It looks like your prompt's You can either adjust your memory, like so:
|
yep, it is defined exactly the sameway. still it persists the same |
I have same issue. I've digged the class to know about. I also use ChatPromptTemplate to create prompts with ChatOpenAI class. I've noticed that the ConversationChain validator will collect all input keys from prompts but the validator refers only its input key and memory key. Other words, how to add some keys that are hold on prompts to the ConversationChain class? If the class accepts input keys as an array, I can adjust the keys to that I want. |
Me too - all kinds of issues trying to get memory to work with a prompt template with lots of variables. I'm generally finding it easier to not use all of the langchain helpers and do all of the prompt compilation custom and just send in the precompiled prompt to a very simple chain call. This is one of many variations i've tried below. it gives variables not found errors until i add both input and history to chatPrompt.format, and then finally it throws an error
|
Like instead of all of that above, i'll precompile long/short term memory into a system prompt and just do this instead:
I keep going back to langchain to try to make all the helpers work b/c i feel there will be a long term benefit to using the framework... but keep running into these various probs... |
Hi, @hussamsayeed! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale. From what I understand, the issue is about a validation error when using variable data in the prompt and sending it to ConversationChain. L4rryFisherman suggested adjusting the memory keys to resolve the issue, but you mentioned that the keys are already defined correctly. edom18 also reported facing the same issue and suggested adding input keys as an array to the ConversationChain class. Additionally, bigrig2212 shared their experience and suggested customizing the prompt compilation instead of relying on langchain helpers, along with an alternative approach using precompiled prompts. Before we close this issue, we wanted to check if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days. Thank you for your understanding and contributions to the LangChain repository! |
II'm using some variable data in my prompt, and sending that prompt to ConversationChain and there I'm getting some validation error.
![Screenshot (1225)](https://user-images.githubusercontent.com/46478199/227850617-e22658f1-5ebf-41d4-a672-209dd92f5674.png)
what changes we can make it to work as expected?
The text was updated successfully, but these errors were encountered: