View Source Anthropic.Messages.Request (anthropic_community v0.5.0)
Builds and validates the wire params for a POST /v1/messages request from a Client and
caller-supplied options. This is the single place where client defaults, call-site opts,
and wire-shape validation are merged for Anthropic.Messages.create/2 and stream/2.
Summary
Functions
@spec build(Anthropic.Client.t(), keyword() | map(), [{:stream, boolean()}]) :: {:ok, map()} | {:error, Anthropic.Error.t()}
@spec build_count_tokens(Anthropic.Client.t(), keyword() | map()) :: {:ok, map()} | {:error, Anthropic.Error.t()}
Like build/3, but for POST /v1/messages/count_tokens: same shape minus max_tokens
(not accepted by that endpoint) and without a stream field.