Merge pull request #466 from zhanghb18/main

fix: unexpected keyword arg audio
This commit is contained in:
Thinkwee 2024-12-17 18:00:53 +08:00 committed by GitHub
commit 5dfb0cf411
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,6 +39,7 @@ class ChatMessage(BaseMessage):
role (str): The role of the message in OpenAI chat system.
content (str): The content of the message. (default: :obj:`""`)
refusal (str): The refusal to build argument.
audio (object): The audio contains data about the audio response from the model.
"""
role_name: str
role_type: RoleType
@ -46,6 +47,7 @@ class ChatMessage(BaseMessage):
role: str
content: str = ""
refusal: str = None
audio: object = None
if openai_new_api:
function_call: Optional[FunctionCall] = None
tool_calls: Optional[ChatCompletionMessageToolCall] = None
@ -76,6 +78,7 @@ class AssistantChatMessage(ChatMessage):
(default: :obj:`"assistant"`)
content (str): The content of the message. (default: :obj:`""`)
refusal (str): The refusal to build argument.
audio (object): The audio contains data about the audio response from the model.
"""
role_name: str
role_type: RoleType = RoleType.ASSISTANT
@ -83,6 +86,7 @@ class AssistantChatMessage(ChatMessage):
role: str = "user"
content: str = ""
refusal: str = None
audio: object = None
@dataclass
@ -98,6 +102,7 @@ class UserChatMessage(ChatMessage):
(default: :obj:`"user"`)
content (str): The content of the message. (default: :obj:`""`)
refusal (str): The refusal to build argument.
audio (object): The audio contains data about the audio response from the model.
"""
role_name: str
role_type: RoleType = RoleType.USER
@ -105,3 +110,4 @@ class UserChatMessage(ChatMessage):
role: str = "user"
content: str = ""
refusal: str = None
audio: object = None