|
@@ -69,6 +69,19 @@ from foundation.ai.rag.retrieval.query_rewrite import query_rewrite_manager
|
|
|
from foundation.infrastructure.config.config import config_handler
|
|
from foundation.infrastructure.config.config import config_handler
|
|
|
from foundation.observability.logger.loggering import server_logger as logger
|
|
from foundation.observability.logger.loggering import server_logger as logger
|
|
|
|
|
|
|
|
|
|
+from pathlib import Path
|
|
|
|
|
+import sys
|
|
|
|
|
+import json
|
|
|
|
|
+
|
|
|
|
|
+# # 导入check_completeness组件
|
|
|
|
|
+# check_completeness_dir = Path(__file__).parent / "check_completeness"
|
|
|
|
|
+# if str(check_completeness_dir) not in sys.path:
|
|
|
|
|
+# sys.path.insert(0, str(check_completeness_dir))
|
|
|
|
|
+
|
|
|
|
|
+from .check_completeness.components.data_loader import CSVDataLoader
|
|
|
|
|
+from .check_completeness.components.prompt_builder import PromptBuilder
|
|
|
|
|
+from .check_completeness.components.llm_client import LLMClient
|
|
|
|
|
+from .check_completeness.components.result_processor import ResultProcessor
|
|
|
|
|
|
|
|
@dataclass
|
|
@dataclass
|
|
|
class ReviewResult:
|
|
class ReviewResult:
|
|
@@ -292,7 +305,8 @@ class AIReviewEngine(BaseReviewer):
|
|
|
if result_index < len(results):
|
|
if result_index < len(results):
|
|
|
grammar_result = self._process_review_result(results[result_index])
|
|
grammar_result = self._process_review_result(results[result_index])
|
|
|
result_index += 1
|
|
result_index += 1
|
|
|
-
|
|
|
|
|
|
|
+ with open('temp/grammar_check_result.json','w',encoding='utf-8') as f:
|
|
|
|
|
+ json.dump(grammar_result,f,ensure_ascii=False,indent=4)
|
|
|
if 'semantic_logic_check' in self.task_info.get_review_config_list():
|
|
if 'semantic_logic_check' in self.task_info.get_review_config_list():
|
|
|
if result_index < len(results):
|
|
if result_index < len(results):
|
|
|
semantic_result = self._process_review_result(results[result_index])
|
|
semantic_result = self._process_review_result(results[result_index])
|
|
@@ -306,7 +320,8 @@ class AIReviewEngine(BaseReviewer):
|
|
|
if result_index < len(results):
|
|
if result_index < len(results):
|
|
|
completeness_result = self._process_review_result(results[result_index])
|
|
completeness_result = self._process_review_result(results[result_index])
|
|
|
result_index += 1
|
|
result_index += 1
|
|
|
-
|
|
|
|
|
|
|
+ with open('temp/completeness_check_result.json','w',encoding='utf-8') as f:
|
|
|
|
|
+ json.dump(completeness_result,f,ensure_ascii=False,indent=4)
|
|
|
return {
|
|
return {
|
|
|
'grammar_check': grammar_result,
|
|
'grammar_check': grammar_result,
|
|
|
'semantic_check': semantic_result,
|
|
'semantic_check': semantic_result,
|
|
@@ -586,19 +601,7 @@ class AIReviewEngine(BaseReviewer):
|
|
|
Returns:
|
|
Returns:
|
|
|
Dict[str, Any]: 完整性检查结果
|
|
Dict[str, Any]: 完整性检查结果
|
|
|
"""
|
|
"""
|
|
|
- from pathlib import Path
|
|
|
|
|
- import sys
|
|
|
|
|
- import json
|
|
|
|
|
-
|
|
|
|
|
- # 导入check_completeness组件
|
|
|
|
|
- check_completeness_dir = Path(__file__).parent / "check_completeness"
|
|
|
|
|
- if str(check_completeness_dir) not in sys.path:
|
|
|
|
|
- sys.path.insert(0, str(check_completeness_dir))
|
|
|
|
|
-
|
|
|
|
|
- from check_completeness.components.data_loader import CSVDataLoader
|
|
|
|
|
- from check_completeness.components.prompt_builder import PromptBuilder
|
|
|
|
|
- from check_completeness.components.llm_client import LLMClient
|
|
|
|
|
- from check_completeness.components.result_processor import ResultProcessor
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
name = "completeness_check"
|
|
name = "completeness_check"
|
|
|
start_time = time.time()
|
|
start_time = time.time()
|