Commit d9c9e149 authored by Yaowentong's avatar Yaowentong

fix

parent 9e2baa4f
...@@ -136,6 +136,35 @@ class BaseConfig: ...@@ -136,6 +136,35 @@ class BaseConfig:
} }
} }
def get_sec_id(user_id):
import requests
url = f"https://api.douchacha.com/open/d/hx/user/user_info?user_id={user_id}"
payload = {}
headers = {
'Authorization': 'eyJhbGciOiJIUzI1NiJ9.eyJ0eXBlIjoiUEMiLCJ1c2VySWQiOjEzOTE2OTMxOTU3NTQyMjU2NjQsImNyZWF0ZURhdGUiOiIyMDI2LTA2LTAzIDE3OjE4OjEzIiwiZXhwIjoxNzgzMDcwMjkzfQ.S12OckXnT7PZot-dnQHPFoFmL3GTZ8M1IDL6x2aWeKU'
}
response = requests.request("GET", url, headers=headers, data=payload)
return response.json().get('data').get('sec_uid')
def get_user_info(secUid):
import requests
url = f"http://172.16.1.37:8873/collect_user_info?secUid={secUid}"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
if __name__ == '__main__': if __name__ == '__main__':
key_list = ['BDAI:geo:stream_batch:list', key_list = ['BDAI:geo:stream_batch:list',
'BDAI:geo:batch:list', 'BDAI:geo:batch:list',
...@@ -163,11 +192,25 @@ if __name__ == '__main__': ...@@ -163,11 +192,25 @@ if __name__ == '__main__':
'WXYY:geo:batch:list', 'WXYY:geo:batch:list',
'geo:task_commit:list'] 'geo:task_commit:list']
t = init_redis() t = init_redis()
# # print(t.scard('mt_third_task'))
# aa = list(aa)
# for a in aa:
# sec_uid = get_sec_id(a)
# get_user_info(sec_uid)
# print(t.scard('third_hx_user_id'))
while 1: while 1:
for k in key_list: for k in key_list:
print(f"{k}----{t.llen(k)}") print(f"{k}----{t.llen(k)}")
time.sleep(10) time.sleep(10)
# key = "third_cx_user_id"
# #
# print(len(t.smembers(key))) # print(len(t.smembers(key)))
\ No newline at end of file
This diff is collapsed.
...@@ -141,6 +141,8 @@ def send_message(message): ...@@ -141,6 +141,8 @@ def send_message(message):
def get_task(): def get_task():
all_items = [] all_items = []
page_token = None page_token = None
...@@ -818,7 +820,7 @@ def runner_thread(): ...@@ -818,7 +820,7 @@ def runner_thread():
for cn in (0, 1, 2): for cn in (0, 1, 2):
try: try:
rows = bh_utils.query_data( rows = bh_utils.query_data(
f"select reqId,prompt,rank from geo_third_task_log where cn = {cn} and pt = {pt_today}" f"select reqId,prompt,rank,pt from geo_third_task_log where cn = {cn} and pt = {pt_today}"
) or [] ) or []
for row in rows: for row in rows:
row["thinking_enabled"] = "1" row["thinking_enabled"] = "1"
...@@ -1076,8 +1078,8 @@ def webhook_snipaste(promp_list): ...@@ -1076,8 +1078,8 @@ def webhook_snipaste(promp_list):
if __name__ == "__main__": if __name__ == "__main__":
# t1 = threading.Thread(target=scheduler_thread, daemon=True) t1 = threading.Thread(target=scheduler_thread, daemon=True)
# t2 = threading.Thread(target=runner_thread, daemon=True) t2 = threading.Thread(target=runner_thread, daemon=True)
# t1.start() # t1.start()
# t2.start() # t2.start()
# t1.join() # t1.join()
......
This diff is collapsed.
This diff is collapsed.
import json import json
import traceback
from aidso_geo.models import spider_save_tos from aidso_geo.models import spider_save_tos
from aidso_geo.utils import robot_utils, tos_utils, bh_utils from aidso_geo.utils import robot_utils, tos_utils, bh_utils
...@@ -137,6 +138,7 @@ def doubao_process_original_data(file_path): ...@@ -137,6 +138,7 @@ def doubao_process_original_data(file_path):
suggestions,rich_media_block) suggestions,rich_media_block)
return (file_path, search_keyword, url_list, think_content, response_content, suggestions) return (file_path, search_keyword, url_list, think_content, response_content, suggestions)
except Exception as e: except Exception as e:
traceback.print_exc()
parts = file_path.split('/') parts = file_path.split('/')
platform = parts[2] platform = parts[2]
task_id = parts[1] task_id = parts[1]
...@@ -162,7 +164,7 @@ def doubao_process_original_data(file_path): ...@@ -162,7 +164,7 @@ def doubao_process_original_data(file_path):
if __name__ == '__main__': if __name__ == '__main__':
file_path = 'geo/21430906-2656-4ba4-b884-5f937745734c/DB/original.text' file_path = 'geo/50adc4fd-40de-4352-bb63-649207718036/DB/original.text'
doubao_process_original_data(file_path) doubao_process_original_data(file_path)
......
import json import json
import traceback
import aidso_geo.utils.bh_utils as bh_utils import aidso_geo.utils.bh_utils as bh_utils
import time import time
...@@ -1084,6 +1085,10 @@ def mark_source_mentioned(source_list, word_list): ...@@ -1084,6 +1085,10 @@ def mark_source_mentioned(source_list, word_list):
return result return result
def norm_source_id(v):
if v is None:
return ""
return str(v).strip()
def merge_mentioned(snippet_mention, quotes): def merge_mentioned(snippet_mention, quotes):
mentioned_map = {item["sourceId"]: item["hasBrand"] for item in snippet_mention} mentioned_map = {item["sourceId"]: item["hasBrand"] for item in snippet_mention}
...@@ -1093,9 +1098,11 @@ def merge_mentioned(snippet_mention, quotes): ...@@ -1093,9 +1098,11 @@ def merge_mentioned(snippet_mention, quotes):
def merge_sentiment(snippet_mention, quotes): def merge_sentiment(snippet_mention, quotes):
mentioned_map = {item["sourceId"]: item["sentiment"] for item in snippet_mention} mentioned_map = {norm_source_id(item.get("sourceId")): item.get("sentiment", "NEUTRAL")for item in snippet_mention}
for item in quotes: for item in quotes:
item["sentiment"] = mentioned_map.get(item["sourceId"], "NEUTRAL") sid = norm_source_id(item.get("sourceId"))
item["sentiment"] = mentioned_map.get(sid, "NEUTRAL")
return quotes return quotes
...@@ -1629,6 +1636,7 @@ def platform_process(data): ...@@ -1629,6 +1636,7 @@ def platform_process(data):
return True return True
except Exception as e: except Exception as e:
traceback.print_exc()
logger.exception( logger.exception(
f"{data['reqId']}--{data['platform']}--{data['prompt']}--PROCESS_FAIL" f"{data['reqId']}--{data['platform']}--{data['prompt']}--PROCESS_FAIL"
) )
...@@ -1838,21 +1846,25 @@ if __name__ == '__main__': ...@@ -1838,21 +1846,25 @@ if __name__ == '__main__':
from concurrent.futures import ThreadPoolExecutor, as_completed from concurrent.futures import ThreadPoolExecutor, as_completed
# #
# begin = '2026-05-23' # begin = '2026-05-28'
# end = '2026-05-29' # end = '2026-06-04'
# req_list = get_req_id(15100000026,begin,end) # req_list = get_req_id(18900000004,begin,end)
# # b = "开云集团"
# req_ids = [] # req_ids = []
# for item in req_list: # for item in req_list:
# req_id = item.get("req_id") # if item.get('brand_name') == b:
# req_ids.append(req_id) # req_id = item.get("req_id")
# req_ids.append(req_id)
# req_id_sql = ",".join([f"'{req_id}'" for req_id in req_ids]) # req_id_sql = ",".join([f"'{req_id}'" for req_id in req_ids])
# print(req_id_sql)
# # print(len(req_ids))
query_sql = f"select * from geo_commit_task where reqId in ('e436cdd6-9342-4c67-b894-82bc8dc337a5')"
query_sql = f"select * from geo_commit_task where type = 'stream_batch' and status != 'SUCCESS'"
data_list = bh_utils.query_data(query_sql)
# print(len(data_list)) # print(len(data_list))
# #
# data_list = bh_utils.query_data(f"select * from geo_commit_task where status !='SUCCESS' and type = 'stream_batch' ") # data_list = bh_utils.query_data(f"select * from geo_commit_task where status ='ING' and type = 'stream_batch' ")
data_list = bh_utils.query_data(query_sql)
# print(data_list)
# # # # # #
# # # # # #
# # # # # # # # # #
......
...@@ -29,7 +29,6 @@ def yuanbao_process_original_data(file_path): ...@@ -29,7 +29,6 @@ def yuanbao_process_original_data(file_path):
# 提取并解析JSON数据 # 提取并解析JSON数据
data_str = i.split("data: ")[1] data_str = i.split("data: ")[1]
json_data = json.loads(data_str) json_data = json.loads(data_str)
except (IndexError, json.JSONDecodeError): except (IndexError, json.JSONDecodeError):
continue # 跳过格式错误的数据 continue # 跳过格式错误的数据
...@@ -75,6 +74,6 @@ def yuanbao_process_original_data(file_path): ...@@ -75,6 +74,6 @@ def yuanbao_process_original_data(file_path):
if __name__ == '__main__': if __name__ == '__main__':
# https://tcdn.aidso.com/geo/c7581554-435b-47ca-a2e5-d52bea763b8a/DOUBA/search_keyword.txt?secret=11049cbfb1c7018597a2085455505304520f0507080c0c4b514e09 # https://tcdn.aidso.com/geo/c7581554-435b-47ca-a2e5-d52bea763b8a/DOUBA/search_keyword.txt?secret=11049cbfb1c7018597a2085455505304520f0507080c0c4b514e09
file_path = 'geo/5582d220-f032-4095-ad39-1dbc33a536c3/TXYB/original.text' file_path = 'geo/b55be837-48a9-476a-8290-1339ea2ce3f9/TXYB/original.text'
yuanbao_process_original_data(file_path) yuanbao_process_original_data(file_path)
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment