AI重构
This commit is contained in:
17
backend_service/src/pipeline/orchestrator.py
Normal file
17
backend_service/src/pipeline/orchestrator.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
from .stages import PipelineStages
|
||||
|
||||
|
||||
class GenerationOrchestrator:
|
||||
def __init__(self, generator: Any):
|
||||
self.stages = PipelineStages(generator)
|
||||
|
||||
async def generate(self, user_prompt: str) -> Dict:
|
||||
understanding = self.stages.stage1_task_understanding(user_prompt)
|
||||
context = self.stages.stage2_context_binding(user_prompt, understanding)
|
||||
draft = self.stages.stage3_bt_planning(user_prompt, understanding, context)
|
||||
return self.stages.stage4_validate_and_postprocess(user_prompt, understanding, context, draft)
|
||||
|
||||
Reference in New Issue
Block a user