66from vllm .lora .request import LoRARequest
77from vllm .sampling_params import SamplingParams
88from vllm .sequence import RequestMetrics
9- from vllm .v1 .engine import EngineCoreRequest , RequestFinishedReason
9+ from vllm .v1 .engine import EngineCoreRequest , FinishReason
1010from vllm .v1 .utils import ConstantList
1111
1212if TYPE_CHECKING :
@@ -109,7 +109,7 @@ def num_output_tokens(self) -> int:
109109 def is_finished (self ) -> bool :
110110 return RequestStatus .is_finished (self .status )
111111
112- def get_finished_reason (self ) -> Union [RequestFinishedReason , None ]:
112+ def get_finished_reason (self ) -> Union [FinishReason , None ]:
113113 return RequestStatus .get_finished_reason (self .status )
114114
115115 def has_encoder_inputs (self ) -> bool :
@@ -150,7 +150,7 @@ def is_finished(status: "RequestStatus") -> bool:
150150
151151 @staticmethod
152152 def get_finished_reason (
153- status : "RequestStatus" ) -> Union [RequestFinishedReason , None ]:
153+ status : "RequestStatus" ) -> Union [FinishReason , None ]:
154154 return _FINISHED_REASON_MAP .get (status )
155155
156156
@@ -159,8 +159,8 @@ def get_finished_reason(
159159# are longer than the model's length cap. Therefore, the stop
160160# reason should also be "length" as in OpenAI API.
161161_FINISHED_REASON_MAP = {
162- RequestStatus .FINISHED_STOPPED : RequestFinishedReason .STOP ,
163- RequestStatus .FINISHED_LENGTH_CAPPED : RequestFinishedReason .LENGTH ,
164- RequestStatus .FINISHED_ABORTED : RequestFinishedReason .ABORT ,
165- RequestStatus .FINISHED_IGNORED : RequestFinishedReason .LENGTH ,
162+ RequestStatus .FINISHED_STOPPED : FinishReason .STOP ,
163+ RequestStatus .FINISHED_LENGTH_CAPPED : FinishReason .LENGTH ,
164+ RequestStatus .FINISHED_ABORTED : FinishReason .ABORT ,
165+ RequestStatus .FINISHED_IGNORED : FinishReason .LENGTH ,
166166}
0 commit comments