20 lines
1.2 KiB
Python
Raw Normal View History

2024-08-29 16:37:09 +08:00
import json
2024-09-09 15:21:07 +08:00
2024-09-26 18:06:23 +08:00
from flask_app.main.json_utils import extract_content_from_json
from flask_app.main.多线程提问 import multi_threading
from flask_app.货物标.资格审查main import update_json_data
ques=["关于'资格要求',本采购文件第一章第二款要求的内容是怎样的请按json格式给我提供信息键名为'资格性审查.资格要求',你不能回答而键值需要完全与原文保持一致,不要擅自总结、删减,如果存在未知信息,请在对应键值处填'未知'"]
knowledge_name="6.2视频会议docx"
results = multi_threading(ques, knowledge_name) # 无序号的直接问大模型
first_response_list = []
for _, response in results:
try:
if response and len(response) > 1: # 检查response存在且有至少两个元素
temp = extract_content_from_json(response[1])
first_response_list.append(temp)
else:
print(f"形式响应评审Warning: Missing or incomplete response data for query index {_}.")
except Exception as e:
print(f"形式响应评审Error processing response for query index {_}: {e}")
print(first_response_list)