Skip to content

Commit

Permalink
fix: unexpected keyword arg refusal
Browse files Browse the repository at this point in the history
  • Loading branch information
TheChronicMonster committed Aug 11, 2024
1 parent 386fd21 commit a4b1b0d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions camel/messages/chat_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ class ChatMessage(BaseMessage):
for the message.
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.
"""
role_name: str
role_type: RoleType
meta_dict: Optional[Dict[str, str]]
role: str
content: str = ""
refusal: str = None
if openai_new_api:
function_call: Optional[FunctionCall] = None
tool_calls: Optional[ChatCompletionMessageToolCall] = None
Expand All @@ -55,6 +57,7 @@ def set_user_role_at_backend(self: BaseMessage):
meta_dict=self.meta_dict,
role="user",
content=self.content,
refusal=self.refusal,
)


Expand All @@ -72,12 +75,14 @@ class AssistantChatMessage(ChatMessage):
role (str): The role of the message in OpenAI chat system.
(default: :obj:`"assistant"`)
content (str): The content of the message. (default: :obj:`""`)
refusal (str): The refusal to build argument.
"""
role_name: str
role_type: RoleType = RoleType.ASSISTANT
meta_dict: Optional[Dict[str, str]] = None
role: str = "user"
content: str = ""
refusal: str = None


@dataclass
Expand All @@ -92,9 +97,11 @@ class UserChatMessage(ChatMessage):
role (str): The role of the message in OpenAI chat system.
(default: :obj:`"user"`)
content (str): The content of the message. (default: :obj:`""`)
refusal (str): The refusal to build argument.
"""
role_name: str
role_type: RoleType = RoleType.USER
meta_dict: Optional[Dict[str, str]] = None
role: str = "user"
content: str = ""
refusal: str = None

0 comments on commit a4b1b0d

Please sign in to comment.