Module: LLM::HTTPClient

Included in:
Provider
Defined in:
lib/llm/http_client.rb

Instance Method Summary collapse

Instance Method Details

#request(http, req) ⇒ Net::HTTPResponse

Initiates a HTTP request

Parameters:

  • http (Net::HTTP)

    The HTTP object to use for the request

  • req (Net::HTTPRequest)

    The request to send

Returns:

  • (Net::HTTPResponse)

    The response from the server

Raises:



22
23
24
25
26
27
# File 'lib/llm/http_client.rb', line 22

def request(http, req)
  res = http.request(req)
  res.tap(&:value)
rescue Net::HTTPClientException
  error_handler.new(res).raise_error!
end