LLM_Powered_Legal_RAG / app /rewrite_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
378 Bytes
from langchain_core.prompts import ChatPromptTemplate
from app.models.model import LLM
from app.utils.prompts import rewrite_prompts
def get_rewrite_chain(language: str = "English"):
system_prompt = rewrite_prompts[language]
prompt = ChatPromptTemplate.from_messages([
("system", system_prompt),
("human", "{input}"),
])
return LLM, prompt