diff --git a/app.py b/app.py index 2694481..1f5a318 100644 --- a/app.py +++ b/app.py @@ -4,6 +4,9 @@ app = Flask(__name__) # 全局变量,存储传递进来的嵌套字典数据 customer_data = [] +buf = {} +key = "ZbIF9jKqzDyChwiB" + @app.route('/') def index(): @@ -47,8 +50,6 @@ def update_customers(index): if 0 <= index < len(customer_data): customer = customer_data[index] for domain, info in customer.items(): - print(f"..........domain={domain}") - print(f"..........info={info}") if 'customer industry' in info: info['customer industry'] = updated_data.get(f'{domain}_industry', [info['customer industry']])[0] diff --git a/caller.py b/caller.py index 88740d3..12f762d 100644 --- a/caller.py +++ b/caller.py @@ -1,4 +1,5 @@ import app +from app import key, buf import json from elasticsearch import Elasticsearch from elasticsearch.exceptions import ApiError, TransportError @@ -107,8 +108,7 @@ def load_indices_from_es(key: str, index: str, buf: Dict[str, Any]) -> Any: # 传递数据并启动 Flask 应用 # store_to_es(key, buf, 'customer') -buf = {} -key = "ZbIF9jKqzDyChwiB" + ret = load_indices_from_es(key, 'customer', buf) if not ret: exit("客服AI员工不能拥有数据库。")