[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
@@ -8,7 +8,6 @@ from http import HTTPStatus
from fastapi import Request
from vllm.entrypoints.chat_utils import ConversationMessage
from vllm.entrypoints.generate.base.protocol import RequestResponseMetadata
from vllm.entrypoints.openai.chat_completion.protocol import (
BatchChatCompletionRequest,
@@ -24,6 +23,7 @@ from vllm.inputs import EngineInput
from vllm.logger import init_logger
from vllm.outputs import RequestOutput
from vllm.parser.abstract_parser import Parser
from vllm.renderers.chat_utils import ConversationMessage
from vllm.tokenizers import TokenizerLike
from vllm.utils.async_utils import merge_async_iterators
from vllm.utils.collection_utils import as_list
@@ -19,11 +19,6 @@ from pydantic import (
)
from vllm.config import ModelConfig
from vllm.entrypoints.chat_utils import (
ChatCompletionMessageParam,
ChatTemplateContentFormatOption,
has_non_text_content,
)
from vllm.entrypoints.generate.base.protocol import (
AnyResponseFormat,
DeltaMessage,
@@ -44,6 +39,11 @@ from vllm.exceptions import VLLMValidationError
from vllm.logger import init_logger
from vllm.logprobs import Logprob
from vllm.renderers import ChatParams, TokenizeParams, merge_kwargs
from vllm.renderers.chat_utils import (
ChatCompletionMessageParam,
ChatTemplateContentFormatOption,
has_non_text_content,
)
from vllm.sampling_params import (
BeamSearchParams,
RepetitionDetectionParams,
@@ -11,11 +11,6 @@ from typing import Any, Final, cast
from fastapi import Request
from vllm.engine.protocol import EngineClient
from vllm.entrypoints.chat_utils import (
ChatTemplateContentFormatOption,
ConversationMessage,
make_tool_call_id,
)
from vllm.entrypoints.generate.base.protocol import (
DeltaMessage,
FunctionCall,
@@ -61,6 +56,11 @@ from vllm.logprobs import Logprob
from vllm.outputs import RequestOutput
from vllm.parser import ParserManager
from vllm.parser.abstract_parser import Parser
from vllm.renderers.chat_utils import (
ChatTemplateContentFormatOption,
ConversationMessage,
make_tool_call_id,
)
from vllm.renderers.online_renderer import OnlineRenderer
from vllm.sampling_params import BeamSearchParams, SamplingParams
from vllm.tokenizers import TokenizerLike
+3 -3
View File
@@ -21,9 +21,6 @@ from openai.types.responses.tool import Mcp
from openai_harmony import Author, Message, Role, TextContent
from vllm import envs
from vllm.entrypoints.chat_utils import (
ChatTemplateContentFormatOption,
)
from vllm.entrypoints.mcp.tool import Tool
from vllm.entrypoints.mcp.tool_server import ToolServer
from vllm.entrypoints.openai.parser.harmony_utils import render_for_completion
@@ -41,6 +38,9 @@ from vllm.entrypoints.serve.utils.tool_calls_utils import (
)
from vllm.outputs import RequestOutput
from vllm.parser.abstract_parser import Parser
from vllm.renderers.chat_utils import (
ChatTemplateContentFormatOption,
)
from vllm.tokenizers import TokenizerLike
from vllm.utils import random_uuid
@@ -54,10 +54,6 @@ from pydantic import (
)
from vllm.config import ModelConfig
from vllm.entrypoints.chat_utils import (
ChatCompletionMessageParam,
ChatTemplateContentFormatOption,
)
from vllm.entrypoints.generate.base.protocol import (
PerRequestMetrics,
StopParam,
@@ -68,6 +64,10 @@ from vllm.entrypoints.serve.engine.protocol import OpenAIBaseModel
from vllm.exceptions import VLLMValidationError
from vllm.logger import init_logger
from vllm.renderers import ChatParams, TokenizeParams, merge_kwargs
from vllm.renderers.chat_utils import (
ChatCompletionMessageParam,
ChatTemplateContentFormatOption,
)
from vllm.sampling_params import (
RequestOutputKind,
SamplingParams,
+3 -3
View File
@@ -23,9 +23,6 @@ from pydantic import TypeAdapter
from vllm import envs
from vllm.config.utils import replace
from vllm.engine.protocol import EngineClient
from vllm.entrypoints.chat_utils import (
ChatTemplateContentFormatOption,
)
from vllm.entrypoints.generate.base.protocol import (
DeltaMessage,
RequestResponseMetadata,
@@ -86,6 +83,9 @@ from vllm.lora.request import LoRARequest
from vllm.outputs import CompletionOutput
from vllm.parser import Parser, ParserManager
from vllm.renderers import TokenizeParams
from vllm.renderers.chat_utils import (
ChatTemplateContentFormatOption,
)
from vllm.renderers.online_renderer import (
OnlineRenderer,
ResponsesPreviousMessages,
@@ -62,7 +62,6 @@ from openai.types.responses.response_reasoning_item import (
from openai.types.responses.tool import Tool
from openai_harmony import Message as HarmonyMessage
from vllm.entrypoints.chat_utils import make_tool_call_id
from vllm.entrypoints.generate.base.protocol import DeltaMessage, DeltaToolCall
from vllm.entrypoints.mcp.tool_server import ToolServer
from vllm.entrypoints.openai.parser.harmony_utils import (
@@ -78,6 +77,7 @@ from vllm.entrypoints.openai.responses.utils import (
)
from vllm.outputs import CompletionOutput
from vllm.parser.harmony import Segment
from vllm.renderers.chat_utils import make_tool_call_id
from vllm.utils import random_uuid
TOOL_NAME_TO_MCP_SERVER_LABEL: Final[dict[str, str]] = {
+1 -1
View File
@@ -30,7 +30,6 @@ from openai.types.responses.response_reasoning_item import (
from openai.types.responses.tool import Tool
from vllm import envs
from vllm.entrypoints.chat_utils import make_tool_call_id
from vllm.entrypoints.generate.base.protocol import FunctionCall, FunctionDefinition
from vllm.entrypoints.openai.chat_completion.protocol import (
ChatCompletionMessageParam,
@@ -39,6 +38,7 @@ from vllm.entrypoints.openai.chat_completion.protocol import (
from vllm.entrypoints.openai.responses.protocol import ResponseInputOutputItem
from vllm.exceptions import VLLMValidationError
from vllm.logger import init_logger
from vllm.renderers.chat_utils import make_tool_call_id
from vllm.tool_parsers.utils import (
build_responses_tool_call_name_map,
flat_namespace_tool_name,