Update app.py
Browse files
app.py
CHANGED
|
@@ -262,21 +262,6 @@ class JainArchitectureCore:
|
|
| 262 |
# ์ ์ญ ์ ์ธ ์ธ์คํด์ค ์์ฑ
|
| 263 |
jain_core = JainArchitectureCore()
|
| 264 |
|
| 265 |
-
def chat_with_jain(message: str, history: List[List[str]]) -> Tuple[str, List[List[str]]]:
|
| 266 |
-
"""
|
| 267 |
-
์ ์ธ๊ณผ์ ์ฑํ
์ธํฐํ์ด์ค
|
| 268 |
-
"""
|
| 269 |
-
if not message.strip():
|
| 270 |
-
return "", history
|
| 271 |
-
|
| 272 |
-
# ์ ์ธ์ ์๋ต ์์ฑ
|
| 273 |
-
jain_response = jain_core.process_thought(message)
|
| 274 |
-
|
| 275 |
-
# ํ์คํ ๋ฆฌ ์
๋ฐ์ดํธ
|
| 276 |
-
new_history = history + [[message, jain_response]]
|
| 277 |
-
|
| 278 |
-
return "", new_history
|
| 279 |
-
|
| 280 |
def get_system_info() -> str:
|
| 281 |
"""์์คํ
์ ๋ณด ๋ฐํ"""
|
| 282 |
return f"""
|
|
@@ -392,21 +377,36 @@ def create_jain_interface():
|
|
| 392 |
""")
|
| 393 |
|
| 394 |
# ์ด๋ฒคํธ ํธ๋ค๋ฌ ์ค์
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 395 |
msg.submit(
|
| 396 |
-
|
| 397 |
inputs=[msg, chatbot],
|
| 398 |
outputs=[msg, chatbot]
|
| 399 |
)
|
| 400 |
|
| 401 |
send_btn.click(
|
| 402 |
-
|
| 403 |
inputs=[msg, chatbot],
|
| 404 |
outputs=[msg, chatbot]
|
| 405 |
)
|
| 406 |
|
| 407 |
clear_btn.click(
|
| 408 |
-
|
| 409 |
-
outputs=[chatbot
|
| 410 |
)
|
| 411 |
|
| 412 |
refresh_btn.click(
|
|
|
|
| 262 |
# ์ ์ญ ์ ์ธ ์ธ์คํด์ค ์์ฑ
|
| 263 |
jain_core = JainArchitectureCore()
|
| 264 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
def get_system_info() -> str:
|
| 266 |
"""์์คํ
์ ๋ณด ๋ฐํ"""
|
| 267 |
return f"""
|
|
|
|
| 377 |
""")
|
| 378 |
|
| 379 |
# ์ด๋ฒคํธ ํธ๋ค๋ฌ ์ค์
|
| 380 |
+
def handle_message(message, history):
|
| 381 |
+
if not message.strip():
|
| 382 |
+
return "", history
|
| 383 |
+
|
| 384 |
+
# ์ ์ธ์ ์๋ต ์์ฑ
|
| 385 |
+
jain_response = jain_core.process_thought(message)
|
| 386 |
+
|
| 387 |
+
# ํ์คํ ๋ฆฌ ์
๋ฐ์ดํธ
|
| 388 |
+
new_history = history + [[message, jain_response]]
|
| 389 |
+
|
| 390 |
+
return "", new_history
|
| 391 |
+
|
| 392 |
+
def clear_chat():
|
| 393 |
+
return []
|
| 394 |
+
|
| 395 |
msg.submit(
|
| 396 |
+
handle_message,
|
| 397 |
inputs=[msg, chatbot],
|
| 398 |
outputs=[msg, chatbot]
|
| 399 |
)
|
| 400 |
|
| 401 |
send_btn.click(
|
| 402 |
+
handle_message,
|
| 403 |
inputs=[msg, chatbot],
|
| 404 |
outputs=[msg, chatbot]
|
| 405 |
)
|
| 406 |
|
| 407 |
clear_btn.click(
|
| 408 |
+
clear_chat,
|
| 409 |
+
outputs=[chatbot]
|
| 410 |
)
|
| 411 |
|
| 412 |
refresh_btn.click(
|