Replies: 4 comments 7 replies
-
From what ive seen in the code, this isn't possible as there are a lot of prompts that happen in the background. What you could do is to set up a basic sequential chain that essentially rewords this current chain output to the system prompt that you feed it. Say you have |
Beta Was this translation helpful? Give feedback.
-
You can try overwriting the default system template. See my answer here for #3975. Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
So couple things here. Since we are using the chat models, you should update the chat history like this: memory = ConversationBufferMemory(
memory_key="chat_history",
return_messages=True,
)
memory.chat_memory.add_user_message("my name is David, what is your name?")
memory.chat_memory.add_ai_message("Hello, David! My name is Roboto. How can I help you today?") Then when you create your chain = ConversationalRetrievalChain.from_llm(
...
memory=memory,
...
) Then you can run your query with just chain.run("do you know my name?") Secondly, I would recommend setting chain.verbose = True
chain.combine_docs_chain.verbose = True
chain.combine_docs_chain.llm_chain.verbose = True
chain.combine_docs_chain.llm_chain.llm.verbose = True
chain.question_generator.verbose = True
chain.question_generator.llm.verbose = True There are two different LLM calls happening under the hood. First, the So how to solve this? Well, you might consider using a different chain or adjusting the chain so that the chat history is passed every time. Or you can consider using a conversational agent instead with a |
Beta Was this translation helpful? Give feedback.
-
When intializing the |
Beta Was this translation helpful? Give feedback.
-
Hi guys, I'm working on a chatbot that answers based on one document, it's based on a ConversationalRetrievalChain. I wanna know if there's a way to give "identity" to the bot and some instructions with a SystemsMessage or maybe with other aproach. This is my testing code:
Beta Was this translation helpful? Give feedback.
All reactions