Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -62,7 +62,12 @@ query = "행복한 인생이란?"
|
|
62 |
result = chain({"question": query, "chat_history": chat_history})
|
63 |
|
64 |
def respond(message, chat_history):
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
bot_message = result['answer']
|
68 |
|
|
|
62 |
result = chain({"question": query, "chat_history": chat_history})
|
63 |
|
64 |
def respond(message, chat_history):
|
65 |
+
# chat_history를 적절한 형식으로 변환
|
66 |
+
formatted_history = []
|
67 |
+
for human_msg, ai_msg in chat_history:
|
68 |
+
formatted_history.append({"human": human_msg, "ai": ai_msg})
|
69 |
+
|
70 |
+
result = chain({"question": message, "chat_history": formatted_history})
|
71 |
|
72 |
bot_message = result['answer']
|
73 |
|