Unverified Commit 9d59b755 authored by zifeitong's avatar zifeitong Committed by GitHub
Browse files

[Bugfix] Remove CustomChatCompletionContentPartParam multimodal input type (#10054)


Signed-off-by: default avatarZifei Tong <zifeitong@gmail.com>
parent ea928f60
...@@ -22,7 +22,6 @@ from openai.types.chat import (ChatCompletionMessageToolCallParam, ...@@ -22,7 +22,6 @@ from openai.types.chat import (ChatCompletionMessageToolCallParam,
ChatCompletionToolMessageParam) ChatCompletionToolMessageParam)
# yapf: enable # yapf: enable
# pydantic needs the TypedDict from typing_extensions # pydantic needs the TypedDict from typing_extensions
from pydantic import ConfigDict
from transformers import PreTrainedTokenizer, PreTrainedTokenizerFast from transformers import PreTrainedTokenizer, PreTrainedTokenizerFast
from typing_extensions import Required, TypeAlias, TypedDict from typing_extensions import Required, TypeAlias, TypedDict
...@@ -52,17 +51,10 @@ class ChatCompletionContentPartAudioParam(TypedDict, total=False): ...@@ -52,17 +51,10 @@ class ChatCompletionContentPartAudioParam(TypedDict, total=False):
"""The type of the content part.""" """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): class CustomChatCompletionContentSimpleImageParam(TypedDict, total=False):
"""A simpler version of the param that only accepts a plain image_url. """A simpler version of the param that only accepts a plain image_url.
This is supported by OpenAI API, although it is not documented. This is supported by OpenAI API, although it is not documented.
Example: Example:
{ {
"image_url": "https://example.com/image.jpg" "image_url": "https://example.com/image.jpg"
...@@ -73,7 +65,7 @@ class CustomChatCompletionContentSimpleImageParam(TypedDict, total=False): ...@@ -73,7 +65,7 @@ class CustomChatCompletionContentSimpleImageParam(TypedDict, total=False):
class CustomChatCompletionContentSimpleAudioParam(TypedDict, total=False): class CustomChatCompletionContentSimpleAudioParam(TypedDict, total=False):
"""A simpler version of the param that only accepts a plain audio_url. """A simpler version of the param that only accepts a plain audio_url.
Example: Example:
{ {
"audio_url": "https://example.com/audio.mp3" "audio_url": "https://example.com/audio.mp3"
...@@ -85,7 +77,6 @@ class CustomChatCompletionContentSimpleAudioParam(TypedDict, total=False): ...@@ -85,7 +77,6 @@ class CustomChatCompletionContentSimpleAudioParam(TypedDict, total=False):
ChatCompletionContentPartParam: TypeAlias = Union[ ChatCompletionContentPartParam: TypeAlias = Union[
OpenAIChatCompletionContentPartParam, ChatCompletionContentPartAudioParam, OpenAIChatCompletionContentPartParam, ChatCompletionContentPartAudioParam,
ChatCompletionContentPartRefusalParam, ChatCompletionContentPartRefusalParam,
CustomChatCompletionContentPartParam,
CustomChatCompletionContentSimpleImageParam, CustomChatCompletionContentSimpleImageParam,
CustomChatCompletionContentSimpleAudioParam, str] CustomChatCompletionContentSimpleAudioParam, str]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment