2023-01-23 06:23:14 +00:00
|
|
|
# Description of PAL Prompts
|
2023-01-21 15:40:24 +00:00
|
|
|
|
2023-01-23 06:23:14 +00:00
|
|
|
Prompts to be used with the [PAL](https://arxiv.org/pdf/2211.10435.pdf) chain.
|
|
|
|
These prompts should convert a natural language problem into a series of code snippets to be run to give an answer.
|
2023-01-21 15:40:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Inputs
|
|
|
|
|
|
|
|
This is a description of the inputs that the prompt expects.
|
|
|
|
|
2023-01-23 06:23:14 +00:00
|
|
|
1. `question`: The question to be answered.
|
2023-01-21 15:40:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Below is a code snippet for how to use the prompt.
|
|
|
|
|
|
|
|
```python
|
2023-01-24 03:02:52 +00:00
|
|
|
from langchain.prompts import load_prompt
|
2023-01-21 15:40:24 +00:00
|
|
|
from langchain.chains import PALChain
|
|
|
|
|
|
|
|
llm = ...
|
|
|
|
stop = ...
|
|
|
|
get_answer_expr = ...
|
2023-01-24 03:02:52 +00:00
|
|
|
prompt = load_prompt('lc://prompts/pal/<file-name>')
|
2023-01-21 15:40:24 +00:00
|
|
|
chain = PALChain(llm=llm, prompt=prompt, stop=stop, get_answer_expr=get_answer_expr)
|
|
|
|
```
|
2023-01-20 06:15:13 +00:00
|
|
|
|