validate_modality {rsynthbio}R Documentation

Validate Query Modality

Description

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.

Usage

validate_modality(query)

Arguments

query

A list containing the query data.

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
## Not run: 
invalid_query <- get_valid_query()
invalid_query$modality <- "unsupported_modality"
validate_modality(invalid_query) # Throws error for invalid modality

## End(Not run)

[Package rsynthbio version 2.0.0 Index]