From 85e4dd7fc3285012defee3b0ffd902b978ea8ba8 Mon Sep 17 00:00:00 2001 From: Bao Nguyen Date: Sun, 19 Mar 2023 10:03:45 -0700 Subject: [PATCH] Fix wrong prompt in refine chain (#1770) I got this during testing ``` ValueError: Missing some input keys: {'existing_answer'} ``` Upon review, the initial prompt should be `QUESTION_PROMPT_SELECTOR`. Co-authored-by: Bao Nguyen --- langchain/chains/question_answering/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langchain/chains/question_answering/__init__.py b/langchain/chains/question_answering/__init__.py index 5e697500..522f7906 100644 --- a/langchain/chains/question_answering/__init__.py +++ b/langchain/chains/question_answering/__init__.py @@ -155,7 +155,7 @@ def _load_refine_chain( **kwargs: Any, ) -> RefineDocumentsChain: _question_prompt = ( - question_prompt or refine_prompts.REFINE_PROMPT_SELECTOR.get_prompt(llm) + question_prompt or refine_prompts.QUESTION_PROMPT_SELECTOR.get_prompt(llm) ) _refine_prompt = refine_prompt or refine_prompts.REFINE_PROMPT_SELECTOR.get_prompt( llm