Mimir.RouterClient.HTTP (Mimir v0.1.0)

Copy Markdown View Source

RouterClient implementation that calls POST /v1/route over HTTP via Req. Normalizes the JSON response to atom-keyed maps so the shape is identical to an in-process implementation.

Options

  • :base_url (required) — e.g. "https://gateway.example.com".
  • :bearer_token (required) — the caller's bearer token.
  • :plug (optional) — a plug (module or function) handling the request in-process instead of a live HTTP call — the Req.Test seam; used by this library's own tests and smoke task.

Response normalization

The HTTP response is JSON with string keys. This impl atomizes the top-level keys and the nested placement, grant, and candidates maps so callers can use atom access — matching the in-process response shape.