Replies: 1 comment 4 replies
-
To resolve the Here is an example of how you can use it: from langchain.chains import ConversationChain
from langchain.chains.conversational_retrieval.prompts import QA_PROMPT
# Initialize the ConversationChain with the correct prompt
conversation_chain = ConversationChain(prompt=QA_PROMPT, llm=llm)
# Now you can run the conversation chain without encountering the KeyError
response = conversation_chain.run(input="Hello, how are you?")
print(response) Make sure that you import |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checked other resources
Commit to Help
Example Code
Description
I am trying to run
ConversationChain
withChatPromptTemplate
, but it's giving me the followingKeyError: 'prompt'
for the lineconversation_sum = ConversationChain(prompt=messages, llm=llm)
Error log:
System Info
langchain==0.2.6
langchain-community==0.2.6
langchain-core==0.2.10
langchain-text-splitters==0.2.2
Beta Was this translation helpful? Give feedback.
All reactions