Current section
Files
Jump to
Current section
Files
lib/llm/http_client/req.ex
defmodule LLM.HTTPClient.Req do
@moduledoc """
Default Req adapter for `LLM.HTTPClient`.
Wraps the [Req](https://hex.pm/packages/req) library to implement the
`LLM.HTTPClient` behaviour. This is the production HTTP client used
unless overridden via `config :llm, :http_client`.
In tests, swap this out with a Mox mock:
Mox.defmock(LLM.HTTPClient.Mock, for: LLM.HTTPClient)
config :llm, :http_client, LLM.HTTPClient.Mock
"""
@behaviour LLM.HTTPClient
@impl true
def request(req) do
Req.request(req)
end
end