View Source Anthropic.HTTPTransport.Adapter behaviour (anthropic_community v0.5.0)

Behaviour for the underlying HTTP transport. Defaults to Finch, swappable via Application.get_env(:anthropic, :http_adapter, Finch) — used in tests to mock the network boundary while exercising the real retry/backoff/SSE-parsing logic in Anthropic.HTTPTransport.

Summary

Callbacks

@callback request(Finch.Request.t(), pool :: atom(), opts :: keyword()) ::
  {:ok, Finch.Response.t()} | {:error, Exception.t()}
Link to this callback

stream(t, pool, acc, fun, opts)

View Source
@callback stream(
  Finch.Request.t(),
  pool :: atom(),
  acc :: any(),
  fun(),
  opts :: keyword()
) ::
  {:ok, any()} | {:error, Exception.t()}