KorWoody commited on
Commit
e1d8fa1
1 Parent(s): 7e1ccfe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -29,20 +29,20 @@ def respond(message, chat_history):
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 = """
 
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 = """