File size: 757 Bytes
8fb8b32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

---
tags:
- langchain
- prompt
---

# Description of QA Refine

Prompts designed to be used to refine original answers during question answering chains using the refine method.

## Inputs

This is a description of the inputs that the prompt expects.

1. question: Original question to be answered.
2. existing_answer: Existing answer from previous documents.
3. context_str: New piece of context to use to refine the existing answer.

## Usage

Below is a code snippet for how to use the prompt.

```python
from langchain.prompts import load_prompt
from langchain.chains.question_answering import load_qa_chain

llm = ...
prompt = load_prompt('lc://prompts/qa/refine/<file-name>')
chain = load_qa_chain(llm, chain_type="refine", refine_prompt=prompt)
```