Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -29,20 +29,20 @@ def respond(message, chat_history):
|
|
29 |
|
30 |
return "", chat_history
|
31 |
|
32 |
-
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
#
|
37 |
-
|
38 |
|
39 |
-
|
40 |
|
41 |
-
#
|
42 |
-
|
43 |
-
|
44 |
|
45 |
-
|
46 |
|
47 |
# 챗봇 설명
|
48 |
title = """
|
|
|
29 |
|
30 |
return "", chat_history
|
31 |
|
32 |
+
def historySave(message, answer):
|
33 |
|
34 |
+
conn = pymssql.connect(host=r"(local)", database='Chatbot_Manage', charset='utf8')
|
35 |
+
conn.autocommit(True) # 오토 커밋 활성화
|
36 |
+
# Connection 으로부터 Cursor 생성
|
37 |
+
cursor = conn.cursor()
|
38 |
|
39 |
+
SystemType = "SentenceModel"
|
40 |
|
41 |
+
# SQL문 실행'
|
42 |
+
_sql = "EXEC ChatHistory_InsUpd '" + SystemType + "','" + message + "', '" + answer + "'"
|
43 |
+
cursor.execute(_sql)
|
44 |
|
45 |
+
conn.close() ## 연결 끊기
|
46 |
|
47 |
# 챗봇 설명
|
48 |
title = """
|