Documentation
¶
Overview ¶
Package anthropic implements agent.LLMProvider for Anthropic's Claude models via the Messages API, including prompt caching, extended thinking, and structured output (synthesized-tool JSON mode).
Index ¶
Constants ¶
const DefaultMaxTokens int64 = 8192
DefaultMaxTokens is the per-call Anthropic MaxTokens used when no override is provided. 8192 catches typical chat + tool-use turns without truncating most code-gen workloads. Bump via WithMaxTokens for long structured outputs (HTML5 playables, full schema dumps, inline charts) — Sonnet 4.6 supports up to 64K.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Provider)
Option configures a Provider at construction.
func WithMaxTokens ¶
WithMaxTokens overrides the per-call Anthropic MaxTokens. Use for code-generation, long structured output, or any workload where the default truncates mid-stream.
func WithTemperature ¶
WithTemperature pins the sampling temperature (0.0–1.0 for Anthropic). Use 0 for maximally reproducible classification/extraction turns; unset keeps the provider default. Ignored while extended thinking is enabled — the API rejects sampling overrides alongside thinking. Anthropic exposes no seed parameter, so temperature 0 is best-effort reproducibility, not bit-exact.