cm/caller.py

20 lines
505 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import app
from app import key, buf, load_indices_from_es
from datetime import datetime, timedelta
import threading
from datetime import datetime, timezone
# 传递数据并启动 Flask 应用
# store_to_es(key, buf, 'customer')
# key全局变量在app.py中定义
ret = load_indices_from_es(key, 'customer', buf)
if not ret:
exit("客服AI员工不能拥有数据库。")
customer_data=buf[key]['customer database']
app.set_customer_data(customer_data)
app.app.run(host="0.0.0.0", port=5001)