Validates that the modality specified in the query is allowed for the v2.0 model. This function checks that the `modality` value is one of the supported modalities.
Value
Invisibly returns TRUE if validation passes. Throws an error If the modality key is missing or if the selected modality is not allowed.
Examples
# Create a valid query
query <- get_valid_query()
validate_modality(query) # Passes validation
# Example with invalid modality
if (FALSE) { # \dontrun{
invalid_query <- get_valid_query()
invalid_query$modality <- "unsupported_modality"
validate_modality(invalid_query) # Throws error for invalid modality
} # }