INNER CODE UNIT · Python

_is_terminal_stage

concierge-hq/concierge · __init__.py:198

    def _is_terminal_stage(self, stage: str) -> bool:
        """A stage is terminal if it has no outgoing transitions."""
        return not self._transitions.get(stage, [])

    def _get_session_stage(self, session_id: Optional[str]) -> str:
        """Get current stage for a session. Returns default stage for new/unknown sessions."""
        if session_id:
            stage = self._state.get_session_stage(session_id)
            if stage:
                return stage
        return self._default_stage or list(self._stages.keys())[0]

    def _set_session_stage(self, session_id: Optional[str], stage: str) -> None:
        """Set current stage for a session."""
        if session_id:
            self._state.set_session_stage(session_id, stage)

    @property

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…