from typing import List
from typing import Dict
from typing import Any


def build_params_dict(tags: List[str], attribute_type: List[str]) -> Dict[str, Any]:
    """
    Creates a dictionary in the format required by MISP to be used as a query.
    Args:
        tags: List of tags to filter by
        attribute_type: List of types to filter by
    Returns: Dictionary used as a search query for MISP
    """
    params: Dict[str, Any] = {
        'returnFormat': 'json',
        'type': {
            'OR': attribute_type if attribute_type else [],
        },
        'tags': {
            'OR': tags if tags else [],
        },
    }
    return params