IREE.Tokenizers.HTTPClient (iree_tokenizers v0.6.0)

Copy Markdown View Source

Minimal HTTP client used by IREE.Tokenizers.Tokenizer.from_pretrained/2.

This module follows the same lightweight callback shape used by elixir-nx/tokenizers:

{:ok, %{status: integer(), headers: [{binary(), binary()}], body: binary()}}
{:error, term()}

It is public so callers can provide a compatible replacement through the :http_client option.

Summary

Functions

Performs a single HTTP request.

Types

response()

@type response() :: %{
  status: non_neg_integer(),
  headers: [{binary(), binary()}],
  body: binary()
}

Functions

request(opts)

@spec request(keyword()) :: {:ok, response()} | {:error, term()}

Performs a single HTTP request.

Expected options:

  • :url - absolute URL or path
  • :method - :get or :head
  • :base_url - optional base URL for relative paths
  • :headers - optional request headers as {binary(), binary()} tuples