peterpeter8585 commited on
Commit
fbe00d7
Β·
verified Β·
1 Parent(s): 43d82f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -227,7 +227,7 @@ agent = initialize_agent(
227
  # βœ… Chat ν•¨μˆ˜ (Memory μœ μ§€)
228
  # ──────────────────────────────
229
  def chat(message, history):
230
- raw = agent.invoke(message)
231
  try:
232
  # λŒ€ν™” 기둝을 LangChain memory에 반영
233
  # JSON ν˜•νƒœλ‘œ λ°˜ν™˜ μ‹œ νŒŒμ‹±
@@ -242,8 +242,7 @@ def chat(message, history):
242
  # AI 응닡을 memory에 μΆ”κ°€
243
  except Exception as e:
244
  text = str(raw)
245
- text=json.loads(text)
246
- text=text["outputs"]
247
 
248
  history = history + [(message, text)]
249
  return history, history, ""
 
227
  # βœ… Chat ν•¨μˆ˜ (Memory μœ μ§€)
228
  # ──────────────────────────────
229
  def chat(message, history):
230
+ raw = agent.invoke(message)["output"]
231
  try:
232
  # λŒ€ν™” 기둝을 LangChain memory에 반영
233
  # JSON ν˜•νƒœλ‘œ λ°˜ν™˜ μ‹œ νŒŒμ‹±
 
242
  # AI 응닡을 memory에 μΆ”κ°€
243
  except Exception as e:
244
  text = str(raw)
245
+
 
246
 
247
  history = history + [(message, text)]
248
  return history, history, ""