[Bugfix] Support repsonse_format + tool_choice=auto (#56086)

Signed-off-by: Artem Perevedentsev <aperevedents@nvidia.com>
Co-authored-by: Yufeng He <40085740+he-yufeng@users.noreply.github.com>
Co-authored-by: pablopupo <145598901+pablopupo@users.noreply.github.com>
Co-authored-by: hubunt <150658615+hubunt@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Artem Perevedentsev
2026-09-27 21:17:34 +04:00
committed by GitHub
co-authored by Yufeng He pablopupo hubunt Claude Sonnet 5
parent 0376f81530
commit 2b9b55c7f1
6 changed files with 472 additions and 62 deletions
+9
View File
@@ -563,6 +563,15 @@ class CohereCommandParser(DelegatingParser):
request.response_format = None
return request
def _apply_structural_tag(
self, request: ChatCompletionRequest | ResponsesRequest
) -> ChatCompletionRequest | ResponsesRequest:
# Note(arpera):
# No need to go through _apply_structural_tag in abstract_parser.py
# since we have already go through _apply_structural_tags here
# So, override this method to return request as is
return request
def count_reasoning_tokens(self, token_ids: Sequence[int]) -> int:
count = 0
depth = 0