KorWoody commited on
Commit
e9c36ef
1 Parent(s): e1d8fa1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -24,25 +24,25 @@ def respond(message, chat_history):
24
 
25
  chat_history.append([message, answer['answer']])
26
 
27
- historySave(message=message, answer=str(answer['answer']).replace("'",""))
28
  # historySave(message=message, answer="")
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 = """
 
24
 
25
  chat_history.append([message, answer['answer']])
26
 
27
+ # historySave(message=message, answer=str(answer['answer']).replace("'",""))
28
  # historySave(message=message, answer="")
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 = """