add few shot example (#148)

This commit is contained in:
Harrison Chase
2022-11-19 20:32:45 -08:00
committed by GitHub
parent 8869b0ab0e
commit c02eb199b6
68 changed files with 2494 additions and 713 deletions

View File

@@ -68,12 +68,12 @@ llm_math.run("How many of the integers between 0 and 99 inclusive are divisible
You can also use this for simple prompting pipelines, as in the below example and this [example notebook](https://github.com/hwchase17/langchain/blob/master/docs/examples/demos/simple_prompts.ipynb).
```python
from langchain import Prompt, OpenAI, LLMChain
from langchain import PromptTemplate, OpenAI, LLMChain
template = """Question: {question}
Answer: Let's think step by step."""
prompt = Prompt(template=template, input_variables=["question"])
prompt = PromptTemplate(template=template, input_variables=["question"])
llm = OpenAI(temperature=0)
llm_chain = LLMChain(prompt=prompt, llm=llm)