Commit 65f80bbd by 杨林龙

暂时屏蔽数据库的使用

1 parent f733b087
#!/bin/bash
kill -9 `ps -ef|grep Sales|grep -v grep |awk '{print($2)}'`
processName=Sales_FastApi.py
pid=$(ps -ef | grep $processName | grep -v 'grep' | awk '{print $2;}')
echo "当前kill进程为$processName 进程号为:$pid"
kill -9 $pid
processName=Sales_Chat.py
pid=$(ps -ef | grep $processName | grep -v 'grep' | awk '{print $2;}')
echo "当前kill进程为$processName 进程号为:$pid"
kill -9 $pid
echo "Stop Sales_AI DONE"
......@@ -141,7 +141,7 @@ class LLMHelper:
self.DB_PASSWORD = os.getenv("MYSQL_PASSWORD_PRO", "df234fl")
self.DB_NAME = os.getenv("MYSQL_DATABASE_PRO", "sqlchat")
self.conn_db = pymysql.Connect(host=self.DB_HOST, port=self.DB_PORT, user=self.DB_USER, passwd=self.DB_PASSWORD, db=self.DB_NAME, charset='utf8')
# self.conn_db = pymysql.Connect(host=self.DB_HOST, port=self.DB_PORT, user=self.DB_USER, passwd=self.DB_PASSWORD, db=self.DB_NAME, charset='utf8')
self.client = AzureOpenAI(
# https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#rest-api-versioning
api_version="2023-07-01-preview",
......@@ -417,12 +417,12 @@ class LLMHelper:
else:
return self.llm(prompt)
def save_question_to_db(self, question):
try:
cursor = self.conn_db.cursor()
sql = f"INSERT INTO question_table(question,union_id,into_status,createtime,updatetime) VALUES('{question}',{self.ALLIANCE_ID},0,now(),now());"
cursor.execute(sql)
self.conn_db.commit()
except Exception as e:
self.logger.info(f"{sql}")
self.logger.error(e)
# def save_question_to_db(self, question):
# try:
# cursor = self.conn_db.cursor()
# sql = f"INSERT INTO question_table(question,union_id,into_status,createtime,updatetime) VALUES('{question}',{self.ALLIANCE_ID},0,now(),now());"
# cursor.execute(sql)
# self.conn_db.commit()
# except Exception as e:
# self.logger.info(f"{sql}")
# self.logger.error(e)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!