Spaces:
Sleeping
Sleeping
| """Base orchestrator — abstract interface for all chat orchestrators.""" | |
| from __future__ import annotations | |
| from abc import ABC, abstractmethod | |
| from pathlib import Path | |
| from typing import TYPE_CHECKING | |
| from config.settings import settings | |
| if TYPE_CHECKING: | |
| from agents.agent_flow import ChatTurnResponse | |
| from agents.design_state import DesignState | |
| class BaseOrchestrator(ABC): | |
| """Abstract base for MockChatBackend and CrewOrchestrator.""" | |
| def __init__(self, output_dir: Path | str | None = None): | |
| self.output_dir = Path(output_dir) if output_dir else settings.output_dir | |
| self.output_dir.mkdir(parents=True, exist_ok=True) | |
| def chat_turn( | |
| self, | |
| message: str, | |
| history: list[dict], | |
| mentions: list[str] | None = None, | |
| design_state: DesignState | None = None, | |
| plan_context: bool = False, | |
| model: str | None = None, | |
| ) -> ChatTurnResponse: | |
| """Run one chat turn. Returns ChatTurnResponse.""" | |
| ... | |