Back to Langchaingo

Getting Started: LLMChain

docs/docs/modules/chains/llm_chain.mdx

0.1.14728 B
Original Source

import CodeBlock from "@theme/CodeBlock"; import ExampleLLM from "@examples/llm-chain-example/llm_chain.go";

Getting Started: LLMChain

:::info Conceptual Guide :::

An LLMChain is a simple chain that adds some functionality around language models. It is used widely throughout LangChain, including in other chains and agents.

An LLMChain consists of a PromptTemplate and a language model (either an LLM or chat model).

Usage with LLMs

We can construct an LLMChain which takes user input, formats it with a PromptTemplate, and then passes the formatted response to an LLM:

<CodeBlock language="go">{ExampleLLM}</CodeBlock>