chore: Upstream Cohere parser fixes + tests (#51998)

Signed-off-by: Jason Ozuzu <jasonozuzu@cohere.com>
This commit is contained in:
JasonCohere
2026-08-13 05:05:36 -07:00
committed by GitHub
parent 443fa5aca0
commit 5fee0a872d
10 changed files with 533 additions and 54 deletions
@@ -9,7 +9,7 @@ except ImportError as e:
raise ImportError(
"The Cohere tool parser requires the `cohere_melody` "
"package, which is not installed. Install it with:\n"
" pip install cohere_melody"
" pip install 'cohere-melody>=0.11.1'"
) from e
from vllm.entrypoints.openai.chat_completion.protocol import (
@@ -130,8 +130,8 @@ class CohereCommand3ToolParser(BaseCohereCommandToolParser):
):
super().__init__(
tokenizer,
streaming_opts=PyFilterOptions().cmd3(),
unary_opts=PyFilterOptions().cmd3(),
streaming_opts=PyFilterOptions().cmd3().start_in_answer(),
unary_opts=PyFilterOptions().cmd3().start_in_answer(),
)
@@ -143,6 +143,6 @@ class CohereCommand4ToolParser(BaseCohereCommandToolParser):
):
super().__init__(
tokenizer,
streaming_opts=PyFilterOptions().cmd4(),
unary_opts=PyFilterOptions().cmd4(),
streaming_opts=PyFilterOptions().cmd4().start_in_answer(),
unary_opts=PyFilterOptions().cmd4().start_in_answer(),
)