我们已完成 1.25 亿美元的 B 轮融资,用于构建代理工程平台。阅读更多。
Python
Anthropic
pip install -qU langchain-anthropic
ANTHROPIC_API_KEY
import os from getpass import getpass if "ANTHROPIC_API_KEY" not in os.environ: os.environ["ANTHROPIC_API_KEY"] = getpass()
from langchain_anthropic import AnthropicLLM from langchain_core.prompts import PromptTemplate template = """Question: {question} Answer: Let's think step by step.""" prompt = PromptTemplate.from_template(template) model = AnthropicLLM(model="claude-2.1") chain = prompt | model chain.invoke({"question": "What is LangChain?"})
'\nLangChain is a decentralized blockchain network that leverages AI and machine learning to provide language translation services.'
此页面有帮助吗?