Execute a single embedding request and process the response
Source:R/hf_inference.R
hf_perform_request.RdPerforms a prepared request and returns the response. Since requests use req_error(is_error = ~ FALSE), HTTP error responses (status >= 400) are returned rather than thrown as errors.
Arguments
- request
An httr2 request object created by hf_build_request
- ...
ellipsis is sent to
httr2::req_perform, e.g. forpathandverbosityarguments.
Examples
if (FALSE) { # \dontrun{
# Create and perform request
req <- hf_build_request(
input = "This is a sample text to embed",
endpoint_url = "https://my-endpoint.huggingface.cloud"
)
embeddings <- hf_perform_request(req)
} # }