Spaces:
Runtime error
Runtime error
Update kadiApy_ragchain.py
Browse files- kadiApy_ragchain.py +2 -2
kadiApy_ragchain.py
CHANGED
|
@@ -167,7 +167,7 @@ class KadiApyRagchain:
|
|
| 167 |
"""
|
| 168 |
Generate a response using the retrieved contexts and the LLM.
|
| 169 |
"""
|
| 170 |
-
formatted_history = format_history(chat_history)
|
| 171 |
|
| 172 |
# Update the prompt with history included
|
| 173 |
prompt = f"""
|
|
@@ -224,7 +224,7 @@ class KadiApyRagchain:
|
|
| 224 |
|
| 225 |
return formatted_docs
|
| 226 |
|
| 227 |
-
def format_history(chat_history):
|
| 228 |
formatted_history = []
|
| 229 |
for i, entry in enumerate(chat_history, start=1):
|
| 230 |
user_query = entry.get("query", "No query provided")
|
|
|
|
| 167 |
"""
|
| 168 |
Generate a response using the retrieved contexts and the LLM.
|
| 169 |
"""
|
| 170 |
+
formatted_history = self.format_history(chat_history)
|
| 171 |
|
| 172 |
# Update the prompt with history included
|
| 173 |
prompt = f"""
|
|
|
|
| 224 |
|
| 225 |
return formatted_docs
|
| 226 |
|
| 227 |
+
def format_history(self, chat_history):
|
| 228 |
formatted_history = []
|
| 229 |
for i, entry in enumerate(chat_history, start=1):
|
| 230 |
user_query = entry.get("query", "No query provided")
|