JUNGU commited on
Commit
ba17fe0
1 Parent(s): 985bf4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
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
- result = chain({"question": message, "chat_history": chat_history})
 
 
 
 
 
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