All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

0.2.1

Changed

  • Loosened req dependency to allow for easier upgrades

0.2.0

Added

  • ReqAnthropic.RateLimit struct — parsed from anthropic-ratelimit-requests-remaining, anthropic-ratelimit-tokens-remaining, and retry-after headers on every response. Access it on successful responses via ReqAnthropic.rate_limit/1.
  • ReqAnthropic.RateLimited exception — returned as {:error, %RateLimited{retry_after: n}} when the API responds with HTTP 429. The retry_after field (seconds) is promoted to the top level for ergonomic pattern matching.
  • ReqAnthropic.rate_limit/1 — extracts the %RateLimit{} from a %Req.Response{}'s private data.
  • ReqAnthropic.Error now carries a :rate_limit field (%RateLimit{} | nil) populated from response headers on all non-2xx errors.

Changed

  • Breaking: HTTP 429 responses now return {:error, %ReqAnthropic.RateLimited{}} instead of {:error, %ReqAnthropic.Error{type: "rate_limit_error"}}. Callers that pattern-match on %Error{status: 429} or %Error{type: "rate_limit_error"} should update to match %RateLimited{}. The catch-all {:error, exception} pattern is unaffected.

0.1.1

Fixed

  • Fixed base URL not being applied to requests. The auth_step was appended after Req's built-in put_base_url step, so relative paths like /v1/messages were sent to Finch without a scheme, producing ArgumentError: scheme is required for url. The step is now prepended so the base URL is set before Req resolves it.
  • Set a default receive_timeout of 120 seconds in Client.build/1. Finch's 15-second default was too short for LLM API calls, causing Req.TransportError (:closed) on longer requests.

Added

  • Tools.custom/1 now accepts an optional :function (1-arity) that Messages.run/1 will call automatically when the model invokes the tool.
  • Tools.function_map/1 — builds a %{name => function} lookup from a list of tool maps.
  • Messages.run/1 — sends a message and automatically executes tool calls that have a registered :function, looping until the model produces a final response. Accepts :max_rounds (default 10) to cap the number of round-trips.

0.1.0

Initial release.

Added