chore/ 删除无用文件

This commit is contained in:
Kevin
2026-03-19 14:36:14 +08:00
parent 2f60858c9c
commit c6e07ce5ca
135 changed files with 2111 additions and 4510 deletions

View File

@@ -2,6 +2,7 @@
ExtractionAgent从用户消息中提取 5-stage 状态与 slots。
对应现有逻辑get_state_extraction_prompt + JSON 解析
"""
from __future__ import annotations
import json
@@ -19,6 +20,7 @@ logger = get_logger(__name__)
@dataclass
class ExtractionResult:
"""状态提取结果"""
detected_stage: str
slots: Dict[str, str]
@@ -41,7 +43,9 @@ class ExtractionAgent:
extracted_slots: Dict[str, str] = {}
if not llm:
return ExtractionResult(detected_stage=detected_stage, slots=extracted_slots)
return ExtractionResult(
detected_stage=detected_stage, slots=extracted_slots
)
try:
prompt = get_state_extraction_prompt(
@@ -61,8 +65,7 @@ class ExtractionAgent:
detected_stage = parsed.get("detected_stage", detected_stage)
raw_slots = parsed.get("slots", {}) or {}
extracted_slots = {
k: v if isinstance(v, str) else str(v)
for k, v in raw_slots.items()
k: v if isinstance(v, str) else str(v) for k, v in raw_slots.items()
}
except (json.JSONDecodeError, Exception) as e:
logger.warning("ExtractionAgent LLM 解析失败: %s", e)