Function send_completion_request

Source
pub async fn send_completion_request(
    base_url: &str,
    api_key: &str,
    request: &CompletionRequest,
) -> Result<CompletionResponse, OpenRouterError>
Expand description

Send a completion request to a selected model (text-only format)

§Arguments

  • base_url - The API URL for the request.
  • api_key - The API key for authentication.
  • request - The completion request containing the model, prompt, and other optional parameters.

§Returns

  • Result<CompletionResponse, OpenRouterError> - The response from the completion request, containing the generated text and other details.