1 篇文章带有标签 “chaining”

LangChain - Chain

Chain

链允许我们将多个组件组合在一起以创建一个单一的、连续的应用程序。我们可以通过将多个链组合在一起,或者通过将链与其他组件组合来构建更复杂的链。

LLMChain

LLMChain 是一个简单的链,它接受一个提示模板,用用户输入格式化它并返回来自 LLM 的响应。

语言模型(text-davinci-003) from langchain.chains import LLMChain from langchain.llms import OpenAI from langchain.prompts import PromptTemplate llm = OpenAI(temperature=0.9) prompt = PromptTemplate(input_variables=["product"], template="What is a good name for a company that makes {product}?