LLM_Powered_Legal_RAG / app /summary_chain.py
nanfangwuyu21's picture
Update the chatbot to an LangGraph agent, handling four tasks including RAG, summary, translate and email. Update prompts. Update Gradio UI.
6861e2a
raw
history blame contribute delete
500 Bytes
from langchain.chains.combine_documents import create_stuff_documents_chain
from langchain_core.prompts import ChatPromptTemplate
from app.models.model import LLM
from app.managers import vector_manager as vm
from app.utils.prompts import summary_prompts
def get_summary_chain(language: str = "Deutsch"):
system_prompt = summary_prompts[language]
prompt = ChatPromptTemplate.from_messages([
("system", system_prompt),
("human", "{input}"),
])
return LLM, prompt