peterpeter8585 commited on
Commit
ca0fdb0
Β·
verified Β·
1 Parent(s): 28489c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -102,10 +102,10 @@ agent = initialize_agent(
102
  # βœ… Chat ν•¨μˆ˜ (Memory μœ μ§€)
103
  # ──────────────────────────────
104
  def chat(message, history):
 
105
  try:
106
  # λŒ€ν™” 기둝을 LangChain memory에 반영
107
  memory.chat_memory.add_user_message(message)
108
- raw = agent.run(message)
109
  # JSON ν˜•νƒœλ‘œ λ°˜ν™˜ μ‹œ νŒŒμ‹±
110
  text = str(raw)
111
  match = re.search(r"\{.*\}", text, re.DOTALL)
@@ -118,7 +118,7 @@ def chat(message, history):
118
  # AI 응닡을 memory에 μΆ”κ°€
119
  memory.chat_memory.add_ai_message(text)
120
  except Exception as e:
121
- text = f"⚠️ 였λ₯˜: {e}"
122
 
123
  history = history + [(message, text)]
124
  return history, history, ""
 
102
  # βœ… Chat ν•¨μˆ˜ (Memory μœ μ§€)
103
  # ──────────────────────────────
104
  def chat(message, history):
105
+ raw = agent.run(message)
106
  try:
107
  # λŒ€ν™” 기둝을 LangChain memory에 반영
108
  memory.chat_memory.add_user_message(message)
 
109
  # JSON ν˜•νƒœλ‘œ λ°˜ν™˜ μ‹œ νŒŒμ‹±
110
  text = str(raw)
111
  match = re.search(r"\{.*\}", text, re.DOTALL)
 
118
  # AI 응닡을 memory에 μΆ”κ°€
119
  memory.chat_memory.add_ai_message(text)
120
  except Exception as e:
121
+ text = str(raw)
122
 
123
  history = history + [(message, text)]
124
  return history, history, ""