# AI审查响应解析配置模板 # JSON解析规则配置 json_parsing_rules: # 直接JSON检测规则 direct_json_patterns: # 单行对象模式 - pattern: "^{.*}$" type: "single_object" description: "直接JSON对象" # 多行对象模式 - pattern: "^\\{[\\s\\S]*\\}$" type: "multiline_object" description: "多行JSON对象" # JSON数组模式(新增) - pattern: "^\\[[\\s\\S]*\\]$" type: "json_array" description: "JSON数组" # 代码块模式 code_block_patterns: - pattern: "```json\\s*([\\s\\S]*?)\\s*```" type: "json_code_block" description: "标准JSON代码块" - pattern: "```JSON\\s*([\\s\\S]*?)\\s*```" type: "json_code_block_upper" description: "大写JSON代码块" - pattern: "```\s*([\\s\\S]*?)\s*```" type: "generic_code_block" description: "通用代码块" # 特殊格式模式 special_patterns: - pattern: '"check_result":\s*"[^"]*\[[\s\S]*?\]"' type: "embedded_array" description: "嵌入式JSON数组" # 必需关键字验证 required_keywords: # 标准检查项关键字 standard: - "issue_point" - "location" - "suggestion" - "reason" - "risk_level" # 可选关键字(有则提取,无则跳过) optional: - "check_item" - "status" - "severity" - "category" # JSON内容验证规则 content_validation: # 最小字段数量 min_fields: 3 # 必需字段 required_fields: ["issue_point", "suggestion"] # 字段长度限制 max_field_length: 1000 # 字符编码验证 encoding_check: true # 解析优先级 parsing_priority: 1: "direct_json_patterns" 2: "code_block_patterns" 3: "special_patterns" 4: "text_fallback" # 风险等级映射 risk_level_mapping: high_risk: - "高风险" - "high" - "严重" - "critical" medium_risk: - "中风险" - "medium" - "中等" - "一般" low_risk: - "低风险" - "low" - "轻微" - "minor" default: "medium_risk" # 错误处理策略 error_handling: # JSON解析失败时的策略 json_parse_failed: - "try_next_pattern" - "extract_keywords_manually" - "fallback_to_text" # 关键字缺失时的策略 missing_keywords: - "extract_from_text" - "use_default_values" - "log_warning"