peterpeter8585 commited on
Commit
2ec7f88
Β·
verified Β·
1 Parent(s): fbe00d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -227,7 +227,11 @@ agent = initialize_agent(
227
  # βœ… Chat ν•¨μˆ˜ (Memory μœ μ§€)
228
  # ──────────────────────────────
229
  def chat(message, history):
230
- raw = agent.invoke(message)["output"]
 
 
 
 
231
  try:
232
  # λŒ€ν™” 기둝을 LangChain memory에 반영
233
  # JSON ν˜•νƒœλ‘œ λ°˜ν™˜ μ‹œ νŒŒμ‹±
 
227
  # βœ… Chat ν•¨μˆ˜ (Memory μœ μ§€)
228
  # ──────────────────────────────
229
  def chat(message, history):
230
+ ab=[]
231
+ for I in history:
232
+ ab.append({"role":"user","content":I[0]})
233
+ ab.append({"role":"assistant","content":I[1]})
234
+ raw = agent.invoke(ab)["output"]
235
  try:
236
  # λŒ€ν™” 기둝을 LangChain memory에 반영
237
  # JSON ν˜•νƒœλ‘œ λ°˜ν™˜ μ‹œ νŒŒμ‹±