Jido.Browser.WebFetch.Backend behaviour (Jido Browser v2.2.0)

Copy Markdown View Source

HTTP transport behaviour for Jido.Browser.WebFetch.

Backends fetch bytes and response metadata only. Jido.Browser.WebFetch remains responsible for URL policy, content-type handling, document extraction, filtering, citations, truncation, and cache storage.

Summary

Types

response()

@type response() :: %{
  status: non_neg_integer(),
  headers: %{optional(String.t()) => [String.t()] | String.t()},
  body: binary(),
  final_url: String.t()
}

Callbacks

fetch(t, keyword)

@callback fetch(
  String.t(),
  keyword()
) :: {:ok, response()} | {:error, Exception.t()}