yao/yao/models/history.mod.yao
Max c74916296a Enhance model definitions and loading process for system models
- Added new system models for assistant, attachment, audit, chat, config, dsl, history, and kb with metadata including tags, built-in status, read-only attributes, and sort order.
- Refactored the model loading process to include a dedicated function for loading system models, improving organization and maintainability.
- Updated the application loading logic to set a default prefix for system tables, ensuring consistent naming conventions.
- Improved error handling during model loading and migration processes for better reliability.
2025-07-15 16:33:14 +08:00

130 lines
2.8 KiB
Text

{
"name": "history",
"label": "Chat History",
"description": "Chat history table for storing detailed chat message information",
"tags": ["system"],
"builtin": true,
"readonly": true,
"sort": 9999,
"table": {
"name": "history",
"comment": "Chat history table"
},
"columns": [
{
"name": "id",
"type": "ID",
"label": "Record ID",
"comment": "Unique record identifier"
},
{
"name": "sid",
"type": "string",
"label": "Session ID",
"comment": "Session identifier",
"length": 255,
"nullable": false,
"index": true
},
{
"name": "cid",
"type": "string",
"label": "Chat ID",
"comment": "Chat identifier",
"length": 200,
"nullable": true,
"index": true
},
{
"name": "uid",
"type": "string",
"label": "User ID",
"comment": "User identifier",
"length": 255,
"nullable": true,
"index": true
},
{
"name": "role",
"type": "string",
"label": "Role",
"comment": "Message role (user/assistant/system)",
"length": 200,
"nullable": true,
"index": true
},
{
"name": "name",
"type": "string",
"label": "Role Name",
"comment": "Role display name",
"length": 200,
"nullable": true
},
{
"name": "content",
"type": "text",
"label": "Message Content",
"comment": "Text content of the message",
"nullable": true
},
{
"name": "context",
"type": "json",
"label": "Context",
"comment": "Message context data",
"nullable": true
},
{
"name": "assistant_id",
"type": "string",
"label": "Assistant ID",
"comment": "Assistant identifier",
"length": 200,
"nullable": true,
"index": true
},
{
"name": "assistant_name",
"type": "string",
"label": "Assistant Name",
"comment": "Assistant display name",
"length": 200,
"nullable": true
},
{
"name": "assistant_avatar",
"type": "string",
"label": "Assistant Avatar",
"comment": "Assistant avatar URL",
"length": 200,
"nullable": true
},
{
"name": "mentions",
"type": "json",
"label": "Mentions",
"comment": "Mention information in the message",
"nullable": true
},
{
"name": "silent",
"type": "boolean",
"label": "Silent Mode",
"comment": "Whether this is a silent message",
"default": false,
"index": true
},
{
"name": "expired_at",
"type": "timestamp",
"label": "Expired At",
"comment": "Record expiration time",
"nullable": true,
"index": true
}
],
"relations": {},
"indexes": [],
"option": { "timestamps": true, "soft_deletes": false }
}