我们已完成 1.25 亿美元的 B 轮融资,用于构建代理工程平台。阅读更多。
Python
NLP Cloud
pip install -qU nlpcloud
# get a token: https://docs.nlpcloud.com/#authentication from getpass import getpass NLPCLOUD_API_KEY = getpass()
········
import os os.environ["NLPCLOUD_API_KEY"] = NLPCLOUD_API_KEY
from langchain.chains import LLMChain from langchain_community.llms import NLPCloud from langchain_core.prompts import PromptTemplate
template = """Question: {question} Answer: Let's think step by step.""" prompt = PromptTemplate.from_template(template)
llm = NLPCloud()
llm_chain = LLMChain(prompt=prompt, llm=llm)
question = "What NFL team won the Super Bowl in the year Justin Beiber was born?" llm_chain.run(question)
' Justin Bieber was born in 1994, so the team that won the Super Bowl that year was the San Francisco 49ers.'
此页面有帮助吗?