diff --git a/python/sglang/srt/constrained/reasoner_grammar_backend.py b/python/sglang/srt/constrained/reasoner_grammar_backend.py index 5fe7b0c8c00a..0179d3426001 100644 --- a/python/sglang/srt/constrained/reasoner_grammar_backend.py +++ b/python/sglang/srt/constrained/reasoner_grammar_backend.py @@ -51,6 +51,9 @@ def accept_token(self, token: int): self.grammar.accept_token(token) self.transfer_state(token) + def is_terminated(self): + return self.grammar.is_terminated() + def rollback(self, k): steps_after_think = min(k, self.tokens_after_think_end) if steps_after_think > 0: