mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
Merge pull request #596 from orange-crow/update-Message-instance
Message(msg) -> Message(content=msg)
This commit is contained in:
commit
4bf1844022
1 changed files with 1 additions and 1 deletions
|
|
@ -303,7 +303,7 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter):
|
|||
def _process_message(self, messages: Union[str, Message, list[dict], list[Message], list[str]]) -> list[dict]:
|
||||
"""convert messages to list[dict]."""
|
||||
if isinstance(messages, list):
|
||||
messages = [Message(msg) if isinstance(msg, str) else msg for msg in messages]
|
||||
messages = [Message(content=msg) if isinstance(msg, str) else msg for msg in messages]
|
||||
return [msg if isinstance(msg, dict) else msg.to_dict() for msg in messages]
|
||||
|
||||
if isinstance(messages, Message):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue