Update app.py
Browse files
app.py
CHANGED
|
@@ -118,6 +118,12 @@ def initialize_LLM(vector_db):
|
|
| 118 |
qa_chain = initialize_llmchain(vector_db)
|
| 119 |
return qa_chain
|
| 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
|
| 122 |
def conversation(qa_chain, message, history):
|
| 123 |
formatted_chat_history = format_chat_history(message, history)
|
|
|
|
| 118 |
qa_chain = initialize_llmchain(vector_db)
|
| 119 |
return qa_chain
|
| 120 |
|
| 121 |
+
def format_chat_history(message, chat_history):
|
| 122 |
+
formatted_chat_history = []
|
| 123 |
+
for user_message, bot_message in chat_history:
|
| 124 |
+
formatted_chat_history.append(f"User: {user_message}")
|
| 125 |
+
formatted_chat_history.append(f"Assistant: {bot_message}")
|
| 126 |
+
return formatted_chat_history
|
| 127 |
|
| 128 |
def conversation(qa_chain, message, history):
|
| 129 |
formatted_chat_history = format_chat_history(message, history)
|