def METHOD_NAME(
    cls,
    relation_map: Dict[str, Any],
    include: Union[Set, Dict] = None,
    exclude: Union[Set, Dict] = None,
) -> Type[pydantic.BaseModel]:
    if include and isinstance(include, Set):
        include = translate_list_to_dict(include)
    if exclude and isinstance(exclude, Set):
        exclude = translate_list_to_dict(exclude)
    fields_dict: Dict[str, Any] = dict()
    defaults: Dict[str, Any] = dict()
    fields_to_process = cls._get_not_excluded_fields(
        fields={*cls.Meta.model_fields.keys()}, include=include, exclude=exclude
    )
    fields_to_process.sort(
        key=lambda x: list(cls.Meta.model_fields.keys()).index(x)
    )
    cache_key = f"{cls.__name__}_{str(include)}_{str(exclude)}"
    if cache_key in cls.__cache__:
        return cls.__cache__[cache_key]
    for name in fields_to_process:
        field = cls._determine_pydantic_field_type(
            name=name,
            defaults=defaults,
            include=include,
            exclude=exclude,
            relation_map=relation_map,
        )
        if field is not None:
            fields_dict[name] = field
    model = type(
        f"{cls.__name__}_{''.join(choices(string.ascii_uppercase, k=3))}",
        (pydantic.BaseModel,),
        {"__annotations__": fields_dict, **defaults},
    )
    model = cast(Type[pydantic.BaseModel], model)
    cls._copy_field_validators(model=model)
    cls.__cache__[cache_key] = model
    return model