from analogai.foundation.modules.notion.notion import Notion
from analogai.foundation.common.dtos.notion_expression import NotionExpression


def generate_expression(notion: Notion):
    try:
        attributes = notion.attributes
    except AttributeError:
        attributes = None
    return NotionExpression(caption=notion.caption, attributes=attributes)
