Skip to content

How to answer prompt with the previous questions context, using langchain. #15159

Answered by dosubot bot
Opperessor asked this question in Q&A
Discussion options

You must be logged in to vote

🤖

Hi @Opperessor,

I'm Dosu, a friendly bot here to help you out while we're waiting for a human maintainer. I'll assist you with bug resolutions, further questions, and even guide you to contribute. Let's crack this issue together!

Based on the issues and solutions I found in the LangChain repository, it seems like you might need to modify the PROMPT template to include previous questions and their answers in the context. This can be done by adding a new input variable, say previous_qa, to the input_variables list and including it in the prompt_template.

Here's how you can do it:

prompt_template = """Use the following pieces of context and previous questions and answers to answer the ques…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Opperessor
Comment options

@dosubot
Comment options

Answer selected by Opperessor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant