🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
feat: Add 'id' to 'Message' according to Section 2.2.3.1.1 of RFC 135.
莘权 马eff1cb7dc1ef
diff --git a/metagpt/schema.py b/metagpt/schema.pyindex 9e5854997..d1174799a 100644--- a/metagpt/schema.py+++ b/metagpt/schema.py@@ -10,12 +10,14 @@1. Add `Document` and `Documents` for `FileRepository` in Section 2.2.3.4 of RFC 135.2. Encapsulate the common key-values set to pydantic structures to standardize and unify parameter passingbetween actions.+ 3. Add `id` to `Message` according to Section 2.2.3.1.1 of RFC 135."""from __future__ import annotationsimport asyncioimport jsonimport os.path+import uuidfrom asyncio import Queue, QueueEmpty, wait_forfrom json import JSONDecodeErrorfrom pathlib import Path@@ -86,6 +88,7 @@ class Documents(BaseModel):class Message(BaseModel):"""list[<role>: <content>]"""+ id: str # According to Section 2.2.3.1.1 of RFC 135content: strinstruct_content: BaseModel = Field(default=None)role: str = "user" # system / user / assistant@@ -113,6 +116,7 @@ class Message(BaseModel)::param role: Message meta info tells who sent this message."""super().__init__(+ id=uuid.uuid4().hex,content=content,instruct_content=instruct_content,role=role,