27 lines
814 B
Python
27 lines
814 B
Python
from marshmallow import Schema, fields
|
|
|
|
|
|
class MemorySchema(Schema):
|
|
id = fields.Integer(dump_only=True)
|
|
workspace_id = fields.Integer()
|
|
agent_id = fields.Integer(allow_none=True)
|
|
type = fields.String(required=True)
|
|
content = fields.String(required=True)
|
|
tags = fields.List(fields.String(), allow_none=True)
|
|
importance = fields.Integer()
|
|
created_at = fields.DateTime(dump_only=True)
|
|
updated_at = fields.DateTime(dump_only=True)
|
|
|
|
|
|
class MemoryCreateSchema(Schema):
|
|
type = fields.String(required=True)
|
|
content = fields.String(required=True)
|
|
tags = fields.List(fields.String(), allow_none=True)
|
|
importance = fields.Integer()
|
|
|
|
|
|
class MemoryUpdateSchema(Schema):
|
|
content = fields.String()
|
|
tags = fields.List(fields.String())
|
|
importance = fields.Integer()
|