Skip to content

Latest commit

History

History
22 lines (15 loc) 路 876 Bytes

File metadata and controls

22 lines (15 loc) 路 876 Bytes
sidebar_position
0

Prompt templates

Language models take text as input - that text is commonly referred to as a prompt. Typically this is not simply a hardcoded string but rather a combination of a template, some examples, and user input. LangChain provides several classes and functions to make constructing and working with prompts easy.

What is a prompt template?

A prompt template refers to a reproducible way to generate a prompt. It contains a text string ("the template"), that can take in a set of parameters from the end user and generates a prompt.

A prompt template can contain:

  • instructions to the language model,
  • a set of few shot examples to help the language model generate a better response,
  • a question to the language model.

import GetStarted from "@snippets/modules/model_io/prompts/prompt_templates/get_started.mdx"