in aidial_sdk/chat_completion/stage.py [0:0]
def close(self, status: Status = Status.COMPLETED):
if not self._opened:
raise runtime_error("Trying to close an unopened stage")
if self._closed:
raise runtime_error("The stage is already closed")
self._closed = True
self._queue.put_nowait(
FinishStageChunk(self._choice_index, self._stage_index, status)
)