def create_stage()

in aidial_sdk/chat_completion/choice.py [0:0]


    def create_stage(self, name: Optional[str] = None) -> Stage:
        if not self._opened:
            raise runtime_error("Trying to create stage to an unopened choice")
        if self._closed:
            raise runtime_error("Trying to create stage to a closed choice")

        stage = Stage(self._queue, self._index, self._last_stage_index, name)
        self._last_stage_index += 1

        return stage