[Cohere] Remove dead prepare_structured_tag override in Cohere parser (#46099)
Signed-off-by: sfeng33 <4florafeng@gmail.com>
This commit is contained in:
@@ -20,7 +20,6 @@ except ImportError as e:
|
|||||||
) from e
|
) from e
|
||||||
|
|
||||||
|
|
||||||
from vllm.entrypoints.mcp.tool_server import ToolServer
|
|
||||||
from vllm.entrypoints.openai.chat_completion.protocol import (
|
from vllm.entrypoints.openai.chat_completion.protocol import (
|
||||||
ChatCompletionRequest,
|
ChatCompletionRequest,
|
||||||
)
|
)
|
||||||
@@ -481,15 +480,6 @@ class BaseCohereCommandReasoningParser(ReasoningParser):
|
|||||||
def is_reasoning_end(self, input_ids: Sequence[int]) -> bool:
|
def is_reasoning_end(self, input_ids: Sequence[int]) -> bool:
|
||||||
return any(tid == self.end_token_id for tid in reversed(input_ids))
|
return any(tid == self.end_token_id for tid in reversed(input_ids))
|
||||||
|
|
||||||
def prepare_structured_tag(
|
|
||||||
self, original_tag: str | None, tool_server: ToolServer | None
|
|
||||||
) -> str | None:
|
|
||||||
# Responses API replaces ``structural_tag`` via the reasoning parser.
|
|
||||||
# Default ``ReasoningParser.prepare_structured_tag`` returns None, which
|
|
||||||
# would clear a Cohere tag produced in ``adjust_request`` and break
|
|
||||||
# ``StructuredOutputsParams`` validation. Preserve the existing tag.
|
|
||||||
return original_tag
|
|
||||||
|
|
||||||
def adjust_request(
|
def adjust_request(
|
||||||
self, request: ChatCompletionRequest | ResponsesRequest
|
self, request: ChatCompletionRequest | ResponsesRequest
|
||||||
) -> ChatCompletionRequest | ResponsesRequest:
|
) -> ChatCompletionRequest | ResponsesRequest:
|
||||||
|
|||||||
Reference in New Issue
Block a user