Update app.py
Browse files
app.py
CHANGED
@@ -68,11 +68,11 @@ def is_greeting(user_query):
|
|
68 |
def query_with_llama(user_query, db_sample, chat_history):
|
69 |
initial_context = generate_initial_context(db_sample)
|
70 |
|
71 |
-
formatted_history = "" # N茫o inclui hist贸rico temporariamente
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
|
77 |
full_prompt = f"{initial_context}\n\nHist贸rico recente:\n{formatted_history}\n\nPergunta do usu谩rio:\n{user_query}"
|
78 |
|
|
|
68 |
def query_with_llama(user_query, db_sample, chat_history):
|
69 |
initial_context = generate_initial_context(db_sample)
|
70 |
|
71 |
+
#formatted_history = "" # N茫o inclui hist贸rico temporariamente
|
72 |
|
73 |
+
formatted_history = "\n".join(
|
74 |
+
[f"{msg['role'].capitalize()}: {msg['content']}" for msg in chat_history[-1:]]
|
75 |
+
)
|
76 |
|
77 |
full_prompt = f"{initial_context}\n\nHist贸rico recente:\n{formatted_history}\n\nPergunta do usu谩rio:\n{user_query}"
|
78 |
|