langchain/templates/summarize-anthropic/summarize_anthropic/chain.py

9 lines
300 B
Python
Raw Normal View History

from langchain import hub
from langchain.chat_models import ChatAnthropic
from langchain.schema.output_parser import StrOutputParser
# Create chain
prompt = hub.pull("hwchase17/anthropic-paper-qa")
model = ChatAnthropic(model="claude-2", max_tokens=10000)
2023-10-29 22:50:09 +00:00
chain = prompt | model | StrOutputParser()