memoryscope.scheme.message

pydantic model memoryscope.scheme.message.Message[源代码]

基类:BaseModel

Represents a structured message object with details about the sender, content, and metadata.

role

The role of the message sender (e.g., 'user', 'assistant', 'system').

Type:

str

role_name

Optional name associated with the role of the message sender.

Type:

str

content

The actual content or text of the message.

Type:

str

time_created

Timestamp indicating when the message was created.

Type:

int

memorized

Flag to indicate if the message has been saved or remembered.

Type:

bool

meta_data

Additional data or context attached to the message.

Type:

Dict[str, str]

Show JSON schema
{
   "title": "Message",
   "description": "Represents a structured message object with details about the sender, content, and metadata.\n\nAttributes:\n    role (str): The role of the message sender (e.g., 'user', 'assistant', 'system').\n    role_name (str): Optional name associated with the role of the message sender.\n    content (str): The actual content or text of the message.\n    time_created (int): Timestamp indicating when the message was created.\n    memorized (bool): Flag to indicate if the message has been saved or remembered.\n    meta_data (Dict[str, str]): Additional data or context attached to the message.",
   "type": "object",
   "properties": {
      "role": {
         "description": "The role of the message sender (user, assistant, system)",
         "title": "Role",
         "type": "string"
      },
      "role_name": {
         "default": "",
         "description": "Name describing the role of the message sender",
         "title": "Role Name",
         "type": "string"
      },
      "content": {
         "description": "The primary content of the message",
         "title": "Content",
         "type": "string"
      },
      "time_created": {
         "description": "Timestamp marking the message creation time",
         "title": "Time Created",
         "type": "integer"
      },
      "memorized": {
         "default": false,
         "description": "Indicates if the message is flagged for memory retention",
         "title": "Memorized",
         "type": "boolean"
      },
      "meta_data": {
         "additionalProperties": {
            "type": "string"
         },
         "default": {},
         "description": "Supplementary data attached to the message",
         "title": "Meta Data",
         "type": "object"
      }
   },
   "required": [
      "role",
      "content"
   ]
}

Fields:
field role: str [Required]

The role of the message sender (user, assistant, system)

field role_name: str = ''

Name describing the role of the message sender

field content: str [Required]

The primary content of the message

field time_created: int [Optional]

Timestamp marking the message creation time

field memorized: bool = False

Indicates if the message is flagged for memory retention

field meta_data: Dict[str, str] = {}

Supplementary data attached to the message