Skip to content

Commit 079ae0d

Browse files
committed
add nested "data"
Signed-off-by: ixlmar <[email protected]>
1 parent 703df33 commit 079ae0d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tensorrt_llm/serve/chat_utils.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,16 @@ class ChatCompletionContentPartVideoParam(TypedDict, total=False):
3434
type: Required[Literal["video_url"]]
3535

3636

37+
class ImageEmbedsData(TypedDict):
38+
"""Type definition for serialized image embeddings structure."""
39+
data: Required[str]
40+
41+
3742
class ChatCompletionContentPartImageEmbedsParam(TypedDict, total=False):
3843
"""Type definition for image embeddings passed in base64-encoded PyTorch tensor format."""
39-
image_embeds: Required[str]
44+
image_embeds: Required[
45+
# NB: Besides "data", could support "url" and "ipc_handle" in the future.
46+
ImageEmbedsData]
4047
type: Required[Literal["image_embeds"]]
4148

4249

@@ -75,7 +82,8 @@ class ChatCompletionContentPartImageEmbedsParam(TypedDict, total=False):
7582
"audio_url":
7683
lambda part: _AudioParser(part).get("audio_url", {}).get("url", None),
7784
"image_embeds":
78-
lambda part: _ImageEmbedsParser(part).get("image_embeds", None),
85+
lambda part: _ImageEmbedsParser(part).get("image_embeds", {}).get(
86+
"data", None),
7987
}
8088

8189
# Map from content part tags used to directly provide embeddings

0 commit comments

Comments
 (0)