import pickle
from typing import Optional, Dict, Any, List, cast
from enum import Enum

import orjson

from fastapi import APIRouter, Depends, Query
from pydantic import validator
from sqlmodel import Session, Field, select  # type: ignore[import]
from sqlalchemy import distinct  # type: ignore[import]


from app.db import get_db, FeedModel, FeedBase

router = APIRouter()


class FeedRead(FeedBase):
    # parse from the backend to data structures
    tags: List[str] = 