Skip to content

Commit

Permalink
fix bug for placeholer
Browse files Browse the repository at this point in the history
  • Loading branch information
DavdGao committed Mar 23, 2024
1 parent fa57086 commit 4e78c48
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/agentscope/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def __init__(
self,
name: str,
content: Any,
role: Literal["system", "user", "assistant"] = "assistant",
url: Optional[Union[Sequence[str], str]] = None,
timestamp: Optional[str] = None,
host: str = None,
Expand All @@ -248,6 +249,10 @@ def __init__(
https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models.
content (`Any`):
The content of the message.
role (`Literal["system", "user", "assistant"]`, defaults to
"assistant"):
The role of the message, which can be one of the `"system"`,
`"user"`, or `"assistant"`.
url (`Optional[Union[list[str], str]]`, defaults to None):
A url to file, image, video, audio or website.
timestamp (`Optional[str]`, defaults to None):
Expand All @@ -264,6 +269,7 @@ def __init__(
super().__init__(
name=name,
content=content,
role=role,
url=url,
timestamp=timestamp,
**kwargs,
Expand Down Expand Up @@ -327,6 +333,7 @@ def serialize(self) -> str:
"__type": "PlaceholderMessage",
"name": self.name,
"content": None,
"role": self.role,
"timestamp": self.timestamp,
"host": self._host,
"port": self._port,
Expand Down

0 comments on commit 4e78c48

Please sign in to comment.