Geoeasy commited on
Commit
fc89b40
·
verified ·
1 Parent(s): 196628e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -279,8 +279,9 @@ def rag_answer(db: FAISS, llm: ChatNVIDIA, question: str, k: int = 4, max_contex
279
  f"### Pergunta\n{question}"
280
  )
281
 
282
- msg = [("system", system_msg), ("user", user_prompt)]
283
- llm_text = llm.invoke(msg).content
 
284
  return format_answer(question, docs, llm_text)
285
 
286
  # ----------------------------
 
279
  f"### Pergunta\n{question}"
280
  )
281
 
282
+ from langchain_core.messages import SystemMessage, HumanMessage
283
+ messages = [SystemMessage(content=system_msg), HumanMessage(content=user_prompt)]
284
+ llm_text = llm.invoke(messages).content
285
  return format_answer(question, docs, llm_text)
286
 
287
  # ----------------------------