.rst
.pdf
Utility Chains
Utility Chains#
A chain is made up of links, which can be either primitives or other chains.
Primitives can be either prompts, llms, utils, or other chains.
The examples here are all end-to-end chains for specific applications, focused on interacting an LLMChain with a specific utility.
LLMMath
Links Used: Python REPL, LLMChain
Notes: This chain takes user input (a math question), uses an LLMChain to convert it to python code snippet to run in the Python REPL, and then returns that as the result.
Example Notebook
PAL
Links Used: Python REPL, LLMChain
Notes: This chain takes user input (a reasoning question), uses an LLMChain to convert it to python code snippet to run in the Python REPL, and then returns that as the result.
Paper
Example Notebook
SQLDatabase Chain
Links Used: SQLDatabase, LLMChain
Notes: This chain takes user input (a question), uses a first LLM chain to construct a SQL query to run against the SQL database, and then uses another LLMChain to take the results of that query and use it to answer the original question.
Example Notebook
API Chain
Links Used: LLMChain, Requests
Notes: This chain first uses a LLM to construct the url to hit, then makes that request with the Requests wrapper, and finally runs that result through the language model again in order to product a natural language response.
Example Notebook
LLMBash Chain
Links Used: BashProcess, LLMChain
Notes: This chain takes user input (a question), uses an LLM chain to convert it to a bash command to run in the terminal, and then returns that as the result.
Example Notebook
LLMChecker Chain
Links Used: LLMChain