Skip to content

Commit

Permalink
Remove CustomChatCompletionContentPartParam
Browse files Browse the repository at this point in the history
Signed-off-by: Zifei Tong <[email protected]>
  • Loading branch information
zifeitong committed Nov 5, 2024
1 parent 09d3550 commit 6670105
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions vllm/entrypoints/chat_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
ChatCompletionToolMessageParam)
# yapf: enable
# pydantic needs the TypedDict from typing_extensions
from pydantic import ConfigDict
from transformers import PreTrainedTokenizer, PreTrainedTokenizerFast
from typing_extensions import Required, TypeAlias, TypedDict

Expand Down Expand Up @@ -52,17 +51,10 @@ class ChatCompletionContentPartAudioParam(TypedDict, total=False):
"""The type of the content part."""


class CustomChatCompletionContentPartParam(TypedDict, total=False):
__pydantic_config__ = ConfigDict(extra="allow") # type: ignore

type: Required[str]
"""The type of the content part."""


class CustomChatCompletionContentSimpleImageParam(TypedDict, total=False):
"""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"
Expand All @@ -73,7 +65,7 @@ class CustomChatCompletionContentSimpleImageParam(TypedDict, total=False):

class CustomChatCompletionContentSimpleAudioParam(TypedDict, total=False):
"""A simpler version of the param that only accepts a plain audio_url.
Example:
{
"audio_url": "https://example.com/audio.mp3"
Expand All @@ -85,7 +77,6 @@ class CustomChatCompletionContentSimpleAudioParam(TypedDict, total=False):
ChatCompletionContentPartParam: TypeAlias = Union[
OpenAIChatCompletionContentPartParam, ChatCompletionContentPartAudioParam,
ChatCompletionContentPartRefusalParam,
CustomChatCompletionContentPartParam,
CustomChatCompletionContentSimpleImageParam,
CustomChatCompletionContentSimpleAudioParam, str]

Expand Down

0 comments on commit 6670105

Please sign in to comment.