You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/templates/summarize-anthropic/summarize_anthropic/chain.py

9 lines
309 B
Python

from langchain import hub
from langchain_community.chat_models import ChatAnthropic
from langchain_core.output_parsers import StrOutputParser
# Create chain
prompt = hub.pull("hwchase17/anthropic-paper-qa")
model = ChatAnthropic(model="claude-2", max_tokens=10000)
chain = prompt | model | StrOutputParser()