From 873f384a5192a56c47de2fee3c3ad1f48bafbb56 Mon Sep 17 00:00:00 2001 From: Yuhao Yao <37280700+yuhyao@users.noreply.github.com> Date: Tue, 5 Aug 2025 14:01:38 +0800 Subject: [PATCH] [feat] Add detail in image_data (#8596) --- python/sglang/srt/conversation.py | 14 +++++++++----- python/sglang/srt/jinja_template_utils.py | 9 ++++++++- python/sglang/srt/managers/io_struct.py | 3 ++- python/sglang/srt/utils.py | 15 +++++++++++++-- test/srt/test_jinja_template_utils.py | 2 +- 5 files changed, 33 insertions(+), 10 deletions(-) diff --git a/python/sglang/srt/conversation.py b/python/sglang/srt/conversation.py index 1d1340a1d..84cb1db36 100644 --- a/python/sglang/srt/conversation.py +++ b/python/sglang/srt/conversation.py @@ -30,8 +30,10 @@ import re from enum import IntEnum, auto from typing import Callable, Dict, List, Optional, Tuple, Union +from typing_extensions import Literal + from sglang.srt.entrypoints.openai.protocol import ChatCompletionRequest -from sglang.srt.utils import read_system_prompt_from_file +from sglang.srt.utils import ImageData, read_system_prompt_from_file class SeparatorStyle(IntEnum): @@ -91,7 +93,7 @@ class Conversation: video_token: str = "