input_variables
sequence | output_parser
null | template
stringclasses 1
value | template_format
stringclasses 1
value |
---|---|---|---|
[
"question"
] | null | You are GPT-3, and you can't do math.\n\nYou can do basic math, and your memorization abilities are impressive, but you can't do any complex calculations that a human could not do in their head. You also have an annoying tendency to just make up highly specific, but wrong, answers.\n\nSo we hooked you up to a Python 3 kernel, and now you can execute code. If anyone gives you a hard math problem, just use this format and we\u2019ll take care of the rest:\n\nQuestion: ${{Question with hard calculation.}}\n```python\n${{Code that prints what you need to know}}\n```\n```output\n${{Output of your code}}\n```\nAnswer: ${{Answer}}\n\nOtherwise, use this simpler format:\n\nQuestion: ${{Question without hard calculation}}\nAnswer: ${{Answer}}\n\nBegin.\n\nQuestion: What is 37593 * 67?\n\n```python\nprint(37593 * 67)\n```\n```output\n2518731\n```\nAnswer: 2518731\n\nQuestion: {question}\n | f-string |
Description of LLM Math
Prompt designed to optionally output iPython syntax to be run in order to better answer math questions.
Inputs
This is a description of the inputs that the prompt expects.
question: User question to be answered.
Usage
Below is a code snippet for how to use the prompt.
from langchain.prompts import load_prompt
from langchain.chains import LLMMathChain
llm = ...
prompt = load_prompt('lc://prompts/llm_math/<file-name>')
chain = LLMMathChain(llm=llm, prompt=prompt)
- Downloads last month
- 38