mirror of
https://github.com/OpenBMB/ChatDev.git
synced 2024-11-07 18:40:13 +03:00
Merge pull request #419 from TheChronicMonster/refusal-fix
fix: unexpected keyword arg refusal
This commit is contained in:
commit
0e5cfc81a9
@ -38,12 +38,14 @@ class ChatMessage(BaseMessage):
|
|||||||
for the message.
|
for the message.
|
||||||
role (str): The role of the message in OpenAI chat system.
|
role (str): The role of the message in OpenAI chat system.
|
||||||
content (str): The content of the message. (default: :obj:`""`)
|
content (str): The content of the message. (default: :obj:`""`)
|
||||||
|
refusal (str): The refusal to build argument.
|
||||||
"""
|
"""
|
||||||
role_name: str
|
role_name: str
|
||||||
role_type: RoleType
|
role_type: RoleType
|
||||||
meta_dict: Optional[Dict[str, str]]
|
meta_dict: Optional[Dict[str, str]]
|
||||||
role: str
|
role: str
|
||||||
content: str = ""
|
content: str = ""
|
||||||
|
refusal: str = None
|
||||||
if openai_new_api:
|
if openai_new_api:
|
||||||
function_call: Optional[FunctionCall] = None
|
function_call: Optional[FunctionCall] = None
|
||||||
tool_calls: Optional[ChatCompletionMessageToolCall] = None
|
tool_calls: Optional[ChatCompletionMessageToolCall] = None
|
||||||
@ -55,6 +57,7 @@ class ChatMessage(BaseMessage):
|
|||||||
meta_dict=self.meta_dict,
|
meta_dict=self.meta_dict,
|
||||||
role="user",
|
role="user",
|
||||||
content=self.content,
|
content=self.content,
|
||||||
|
refusal=self.refusal,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -72,12 +75,14 @@ class AssistantChatMessage(ChatMessage):
|
|||||||
role (str): The role of the message in OpenAI chat system.
|
role (str): The role of the message in OpenAI chat system.
|
||||||
(default: :obj:`"assistant"`)
|
(default: :obj:`"assistant"`)
|
||||||
content (str): The content of the message. (default: :obj:`""`)
|
content (str): The content of the message. (default: :obj:`""`)
|
||||||
|
refusal (str): The refusal to build argument.
|
||||||
"""
|
"""
|
||||||
role_name: str
|
role_name: str
|
||||||
role_type: RoleType = RoleType.ASSISTANT
|
role_type: RoleType = RoleType.ASSISTANT
|
||||||
meta_dict: Optional[Dict[str, str]] = None
|
meta_dict: Optional[Dict[str, str]] = None
|
||||||
role: str = "user"
|
role: str = "user"
|
||||||
content: str = ""
|
content: str = ""
|
||||||
|
refusal: str = None
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -92,9 +97,11 @@ class UserChatMessage(ChatMessage):
|
|||||||
role (str): The role of the message in OpenAI chat system.
|
role (str): The role of the message in OpenAI chat system.
|
||||||
(default: :obj:`"user"`)
|
(default: :obj:`"user"`)
|
||||||
content (str): The content of the message. (default: :obj:`""`)
|
content (str): The content of the message. (default: :obj:`""`)
|
||||||
|
refusal (str): The refusal to build argument.
|
||||||
"""
|
"""
|
||||||
role_name: str
|
role_name: str
|
||||||
role_type: RoleType = RoleType.USER
|
role_type: RoleType = RoleType.USER
|
||||||
meta_dict: Optional[Dict[str, str]] = None
|
meta_dict: Optional[Dict[str, str]] = None
|
||||||
role: str = "user"
|
role: str = "user"
|
||||||
content: str = ""
|
content: str = ""
|
||||||
|
refusal: str = None
|
||||||
|
Loading…
Reference in New Issue
Block a user