Usage
Arguments
query: A list representing the query data to send to the API. Useget_example_query()to generate an example. The query supports additional optional fields:total_count(integer): Library size used when converting predicted log CPM back to raw counts. Higher values scale counts up proportionally.deterministic_latents(logical): If TRUE, the model uses the mean of each latent distribution instead of sampling, producing deterministic outputs for the same inputs. Useful for reproducibility.seed(integer): Random seed for reproducibility.model_id: Character string specifying the model ID (e.g., “gem-1-bulk”, “gem-1-sc”). Uselist_models()to see available models.api_base_url: The base URL for the API server. When NULL (default), it is resolved in order from the per-model environment variableSYNTHESIZE_API_BASE_URL__<MODEL>(e.g.SYNTHESIZE_API_BASE_URL__GEM_1_BULK), then the globalSYNTHESIZE_API_BASE_URL, then the production default (API_BASE_URL). The per-model variable lets you point each self-hosted model at its own container once and omitapi_base_urlon every call.poll_interval_seconds: Seconds between polling attempts of the status endpoint. Default is DEFAULT_POLL_INTERVAL_SECONDS (2).poll_timeout_seconds: Maximum total seconds to wait before timing out. Default is DEFAULT_POLL_TIMEOUT_SECONDS (900 = 15 minutes).return_download_url: Logical, if TRUE, returns a list containing the signed download URL instead of parsing into data frames. Default is FALSE.raw_response: Logical, if TRUE, returns the raw (unformatted) response from the API without applying any output transformers. For the production path this is the parsed JSON; forself_hosted = TRUEit is the parsed ArrowTabletogether with its schema metadata. Default is FALSE.self_hosted: Logical, if TRUE, sends a single synchronous request to a self-hosted model container that returns predictions as an Apache Arrow IPC stream (no polling, no download URL). Requires the optionalarrowpackage and anapi_base_urlpointing at the container. Unlike the production path, no API key is required (one is only sent if configured). When NULL (default), it is resolved from theSYNTHESIZE_SELF_HOSTEDenvironment variable (truthy for 1/true/yes/on), defaulting to FALSE....: Additional parameters to include in the query body. These are passed directly to the API and validated server-side.
Returns
A list. For the production path, ifreturn_download_url is FALSE
(default) the list contains metadata and expression data frames;
if TRUE it contains download_url and empty data frames. For
self_hosted = TRUE, the list contains the transformed data frames
(metadata, expression, and latents; plus classifier_probs for
metadata-prediction models) with model_version and request_type
attached as attributes.
Examples
Source
Generated fromR/call_model_api.R and the package help files in man/.