Bläddra i källkod

dev:去除目录审查模块的dedug代码;

ChenJiSheng 1 månad sedan
förälder
incheckning
dd879a961b

+ 4 - 4
core/construction_review/component/reviewers/utils/llm_chain_client/implementations/chains/async_chain_executor.py

@@ -82,10 +82,10 @@ class AsyncChainExecutor(ChainExecutor):
             if prompt_data["system"]:
                 messages.append({"role": "system", "content": prompt_data["system"]})
             messages.append({"role": "user", "content": user_prompt})
-            # 【推荐位置】在这里添加保存代码
-            with open('prompts.txt', 'w', encoding='utf-8') as f:
-                contents = [msg["content"] for msg in messages]
-                f.write('\n'.join(contents))
+            # # 【推荐位置】在这里添加保存代码
+            # with open('prompts.txt', 'w', encoding='utf-8') as f:
+            #     contents = [msg["content"] for msg in messages]
+            #     f.write('\n'.join(contents))
 
             # 调用API
             response = await self.llm_client.chat_completion(

+ 5 - 3
core/construction_review/workflows/ai_review_workflow.py

@@ -345,7 +345,9 @@ class AIReviewWorkflow:
             outline_results = pd.DataFrame(outline_results)
             # outline_results[['title', 'chapter_classification', 'missing_items']].to_csv(r"temp/document_temp/outline_results.csv", encoding='utf-8-sig', index=False)
             
-            outline_results['miss_outline'] = None
+            # 初始化 miss_outline 和 common_elements_dict 列为空列表的 JSON 字符串
+            outline_results['miss_outline'] = outline_results.get('miss_outline', '[]')
+            outline_results['common_elements_dict'] = outline_results.get('common_elements_dict', '[]')
             # outline_results['chapter_label'] = outline_results['title']
             outline_results.to_csv(r"temp/document_temp/outline_results11.csv", encoding='utf-8-sig', index=False)
             
@@ -422,8 +424,8 @@ class AIReviewWorkflow:
             chapter_chunks_map["catalogue"] = catalogue
             review_item_dict_sorted["catalogue"] = ["check_completeness"]
             logger.info(f"内容分组完成,共 {len(chapter_chunks_map)} 个章节")
-            with open("temp/filtered_chunks/chapter_chunks_map.json", "w", encoding="utf-8") as f:
-                json.dump(chapter_chunks_map, f, ensure_ascii=False, indent=4)
+            # with open("temp/filtered_chunks/chapter_chunks_map.json", "w", encoding="utf-8") as f:
+            #     json.dump(chapter_chunks_map, f, ensure_ascii=False, indent=4)
             await self.core_fun._send_start_review_progress(state,total_chunks, chapter_names)
             # 6️ 按章节处理
             for chapter_idx, (chapter_code, func_names) in enumerate(review_item_dict_sorted.items()):