[Misc] mv chat_utils.py to renderers. (#60522)

Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
This commit is contained in:
wang.yuqi
2026-10-10 06:50:34 +00:00
committed by GitHub
parent 699c892dd5
commit c1692c85f1
101 changed files with 185 additions and 187 deletions
+3 -3
View File
@@ -94,13 +94,13 @@ from enum import Enum
from typing import Any
from vllm.config import VllmConfig
from vllm.entrypoints.chat_utils import (
from vllm.logger import init_logger
from vllm.renderers.chat_utils import (
ChatCompletionMessageParam,
ConversationMessage,
parse_chat_messages,
parse_chat_messages_async,
)
from vllm.logger import init_logger
from vllm.tokenizers.hf import HfTokenizer
from vllm.utils.async_utils import make_async
@@ -165,7 +165,7 @@ POSITION_TO_SOURCE_KEY = "_position_to_source"
# melody-shape content list the renderer emits.
#
# Motivation: OpenAI's ``ChatCompletionContentPartParam`` union (in
# ``vllm/entrypoints/chat_utils.py``) only allows ``text`` / ``image_url``
# ``vllm/renderers/chat_utils.py``) only allows ``text`` / ``image_url``
# / ``audio`` / ``video`` / ``file`` content parts on tool messages, so
# ``{"type": "document", "document": {...}}`` blocks -- valid in Cohere
# v2 -- get rejected by vLLM's shared chat validator before they can