FalEx.Request (fal_ex v0.1.0)

View Source

HTTP request handling for FalEx client.

Builds URLs, dispatches requests, and handles responses using Tesla.

Summary

Functions

Builds a URL for the given endpoint ID and options.

Dispatches an HTTP request.

Parses an endpoint ID into its components.

Functions

build_url(endpoint_id, opts \\ %{})

Builds a URL for the given endpoint ID and options.

Examples

iex> FalEx.Request.build_url("fal-ai/fast-sdxl", %{})
"https://fal.run/fal-ai/fast-sdxl"

iex> FalEx.Request.build_url("12345", %{subdomain: "queue"})
"https://queue.fal.run/12345"

dispatch_request(opts)

Dispatches an HTTP request.

Options

  • :method - HTTP method (default: :post)
  • :input - Request payload
  • :config - FalEx configuration
  • :options - Additional request options (headers, timeout, etc.)

parse_endpoint_id(endpoint_id)

Parses an endpoint ID into its components.

Examples

iex> FalEx.Request.parse_endpoint_id("fal-ai/fast-sdxl")
%{owner: "fal-ai", alias: "fast-sdxl"}

iex> FalEx.Request.parse_endpoint_id("12345")
%{path: "12345"}