feat(memoir): 回忆录分段两阶段管线(Phase1 分类 / Phase2 叙事)与配置、测试
This commit is contained in:
@@ -33,6 +33,8 @@ class PreparedMemoirBatches:
|
||||
category_to_segments: Dict[str, List[Segment]]
|
||||
#: segment id 在「LLM 判 none 且 extraction slots 为空」时加入;batch 级短路见 memoir_tasks
|
||||
segment_skip_story_ids: Set[str]
|
||||
#: 每个 segment → Phase 1 分类 chapter_category(持久化到 Segment.topic_category)
|
||||
segment_chapter_category: Dict[str, str]
|
||||
|
||||
|
||||
class MemoirOrchestrator:
|
||||
@@ -64,6 +66,7 @@ class MemoirOrchestrator:
|
||||
state = get_or_create_state()
|
||||
category_to_segments: Dict[str, List[Segment]] = {}
|
||||
segment_skip_story_ids: Set[str] = set()
|
||||
segment_chapter_category: Dict[str, str] = {}
|
||||
classify_extract_llm = llm_fast if llm_fast is not None else llm
|
||||
|
||||
for segment in segments:
|
||||
@@ -103,6 +106,7 @@ class MemoirOrchestrator:
|
||||
chapter_category = classify_result.category
|
||||
if (not result.slots) and classify_result.llm_said_none:
|
||||
segment_skip_story_ids.add(str(segment.id))
|
||||
segment_chapter_category[str(segment.id)] = chapter_category
|
||||
|
||||
if agent_summary_enabled():
|
||||
logger.info(
|
||||
@@ -126,6 +130,7 @@ class MemoirOrchestrator:
|
||||
state=state,
|
||||
category_to_segments=category_to_segments,
|
||||
segment_skip_story_ids=segment_skip_story_ids,
|
||||
segment_chapter_category=segment_chapter_category,
|
||||
)
|
||||
|
||||
def run(
|
||||
|
||||
Reference in New Issue
Block a user