vllm.renderers.chat_utils.types
¶
Classes:
-
ChatCompletionContentPartAudioEmbedsParam– -
ChatCompletionContentPartAudioParam– -
ChatCompletionContentPartImageEmbedsParam– -
ChatCompletionContentPartPromptEmbedsParam– -
ChatCompletionContentPartVideoEmbedsParam– -
ChatCompletionContentPartVideoParam– -
ConversationMessage– -
CustomChatCompletionContentPILImageParam–A simpler version of the param that only accepts a PIL image.
-
CustomChatCompletionContentSimpleAudioParam–A simpler version of the param that only accepts a plain audio_url.
-
CustomChatCompletionContentSimpleImageParam–A simpler version of the param that only accepts a plain image_url.
-
CustomChatCompletionContentSimpleVideoParam–A simpler version of the param that only accepts a plain audio_url.
-
CustomChatCompletionContentToolReferenceParam–A tool reference content param that only accepts a plain tool name.
-
CustomChatCompletionMessageParam–Enables custom roles in the Chat Completion API.
-
CustomThinkCompletionContentParam–A Think Completion Content Param that accepts a plain text and a boolean.
-
PILImage–A PIL.Image.Image object.
AudioURL
¶
Bases: TypedDict
Attributes:
Source code in vllm/renderers/chat_utils/types.py
url
instance-attribute
¶
Either a URL of the audio or a data URL with base64 encoded audio data.
ChatCompletionContentPartAudioEmbedsParam
¶
Bases: TypedDict
Attributes:
-
audio_embeds(MultiModalEmbedsPayload | None) –The audio embeddings. It can be either:
-
type(Required[Literal['audio_embeds']]) –The type of the content part.
-
uuid(str | None) –User-provided UUID of a media. User must guarantee that it is properly
Source code in vllm/renderers/chat_utils/types.py
audio_embeds
instance-attribute
¶
The audio embeddings. It can be either: - A single base64 string representing a serialized torch tensor. - A dictionary of base64 tensors or numeric JSON metadata arrays.
type
instance-attribute
¶
The type of the content part.
uuid
instance-attribute
¶
User-provided UUID of a media. User must guarantee that it is properly generated and unique for different medias.
ChatCompletionContentPartAudioParam
¶
Bases: TypedDict
Attributes:
Source code in vllm/renderers/chat_utils/types.py
type
instance-attribute
¶
The type of the content part.
ChatCompletionContentPartImageEmbedsParam
¶
Bases: TypedDict
Attributes:
-
image_embeds(MultiModalEmbedsPayload | None) –The image embeddings. It can be either:
-
type(Required[Literal['image_embeds']]) –The type of the content part.
-
uuid(str | None) –User-provided UUID of a media. User must guarantee that it is properly
Source code in vllm/renderers/chat_utils/types.py
image_embeds
instance-attribute
¶
The image embeddings. It can be either: - A single base64 string. - A dictionary of base64 tensors or numeric JSON metadata arrays.
type
instance-attribute
¶
The type of the content part.
uuid
instance-attribute
¶
User-provided UUID of a media. User must guarantee that it is properly generated and unique for different medias.
ChatCompletionContentPartPromptEmbedsParam
¶
Bases: TypedDict
Attributes:
-
data(Required[str]) –Base64-encoded bytes of a serialized
torch.Tensorof shape -
type(Required[Literal['prompt_embeds']]) –The type of the content part.
Source code in vllm/renderers/chat_utils/types.py
ChatCompletionContentPartVideoEmbedsParam
¶
Bases: TypedDict
Attributes:
-
type(Required[Literal['video_embeds']]) –The type of the content part.
-
uuid(str | None) –User-provided UUID of a media. User must guarantee that it is properly
-
video_embeds(MultiModalEmbedsPayload | None) –The video embeddings. It can be either:
Source code in vllm/renderers/chat_utils/types.py
type
instance-attribute
¶
The type of the content part.
uuid
instance-attribute
¶
User-provided UUID of a media. User must guarantee that it is properly generated and unique for different medias.
video_embeds
instance-attribute
¶
The video embeddings. It can be either: - A single base64 string representing a serialized torch tensor. - A dictionary of base64 tensors or numeric JSON metadata arrays.
ChatCompletionContentPartVideoParam
¶
Bases: TypedDict
Attributes:
Source code in vllm/renderers/chat_utils/types.py
type
instance-attribute
¶
The type of the content part.
ConversationMessage
¶
Bases: TypedDict
Attributes:
-
content(str | None | list[dict[str, str]]) –The contents of the message
-
name(str | None) –The name of the function to call
-
reasoning(str | None) –The reasoning content for interleaved thinking.
-
reasoning_content(str | None) –Deprecated: The reasoning content for interleaved thinking.
-
role(Required[str]) –The role of the message's author.
-
task(str | None) –Model-specific task marker. Currently passed through for DeepSeek V4.
-
tool_call_id(str | None) –Tool call that this message is responding to.
-
tool_calls(list[ChatCompletionMessageToolCallParam] | None) –The tool calls generated by the model, such as function calls.
-
tools(list[ChatCompletionFunctionToolParam] | None) –The tools for developer role.
Source code in vllm/renderers/chat_utils/types.py
content
instance-attribute
¶
The contents of the message
name
instance-attribute
¶
The name of the function to call
reasoning
instance-attribute
¶
The reasoning content for interleaved thinking.
reasoning_content
instance-attribute
¶
Deprecated: The reasoning content for interleaved thinking.
role
instance-attribute
¶
The role of the message's author.
task
instance-attribute
¶
Model-specific task marker. Currently passed through for DeepSeek V4.
tool_call_id
instance-attribute
¶
Tool call that this message is responding to.
tool_calls
instance-attribute
¶
The tool calls generated by the model, such as function calls.
tools
instance-attribute
¶
The tools for developer role.
CustomChatCompletionContentPILImageParam
¶
Bases: TypedDict
A simpler version of the param that only accepts a PIL image.
Example: { "image_pil": ImageAsset('cherry_blossom').pil_image }
Attributes:
Source code in vllm/renderers/chat_utils/types.py
uuid
instance-attribute
¶
User-provided UUID of a media. User must guarantee that it is properly generated and unique for different medias.
CustomChatCompletionContentSimpleAudioParam
¶
Bases: TypedDict
A simpler version of the param that only accepts a plain audio_url.
Example: { "audio_url": "https://example.com/audio.mp3" }
Source code in vllm/renderers/chat_utils/types.py
CustomChatCompletionContentSimpleImageParam
¶
Bases: TypedDict
A simpler version of the param that only accepts a plain image_url. This is supported by OpenAI API, although it is not documented.
Example: { "image_url": "https://example.com/image.jpg" }
Attributes:
Source code in vllm/renderers/chat_utils/types.py
uuid
instance-attribute
¶
User-provided UUID of a media. User must guarantee that it is properly generated and unique for different medias.
CustomChatCompletionContentSimpleVideoParam
¶
Bases: TypedDict
A simpler version of the param that only accepts a plain audio_url.
Example: { "video_url": "https://example.com/video.mp4" }
Attributes:
Source code in vllm/renderers/chat_utils/types.py
uuid
instance-attribute
¶
User-provided UUID of a media. User must guarantee that it is properly generated and unique for different medias.
CustomChatCompletionContentToolReferenceParam
¶
Bases: TypedDict
A tool reference content param that only accepts a plain tool name.
Example: { "name": "get_weather", "type": "tool_reference" }
Attributes:
-
name(str) –The name of the tool being referenced.
-
type(Literal['tool_reference']) –The content type.
Source code in vllm/renderers/chat_utils/types.py
CustomChatCompletionMessageParam
¶
Bases: TypedDict
Enables custom roles in the Chat Completion API.
Attributes:
-
content(str | list[ChatCompletionContentPartParam]) –The contents of the message.
-
name(str) –An optional name for the participant.
-
reasoning(str | None) –The reasoning content for interleaved thinking.
-
role(Required[str]) –The role of the message's author.
-
task(str | None) –Model-specific task marker. Currently passed through for DeepSeek V4.
-
tool_call_id(str | None) –Tool call that this message is responding to.
-
tool_calls(list[ChatCompletionMessageToolCallParam] | None) –The tool calls generated by the model, such as function calls.
-
tools(list[ChatCompletionFunctionToolParam] | None) –The tools for developer role.
Source code in vllm/renderers/chat_utils/types.py
content
instance-attribute
¶
The contents of the message.
name
instance-attribute
¶
An optional name for the participant.
Provides the model information to differentiate between participants of the same role.
reasoning
instance-attribute
¶
The reasoning content for interleaved thinking.
role
instance-attribute
¶
The role of the message's author.
task
instance-attribute
¶
Model-specific task marker. Currently passed through for DeepSeek V4.
tool_call_id
instance-attribute
¶
Tool call that this message is responding to.
tool_calls
instance-attribute
¶
The tool calls generated by the model, such as function calls.
tools
instance-attribute
¶
The tools for developer role.
CustomThinkCompletionContentParam
¶
Bases: TypedDict
A Think Completion Content Param that accepts a plain text and a boolean.
Example: { "thinking": "I am thinking about the answer", "closed": True, "type": "thinking" }
Attributes:
-
closed(bool) –Whether the thinking is closed.
-
thinking(Required[str]) –The thinking content.
-
type(Required[Literal['thinking']]) –The thinking type.