A caller could not tell a complete answer from one the model stopped writing
because it ran out of output budget: GenerateContent returns err == nil either
way, and the only signal is ContentChoice.StopReason, which carries whatever
the vendor called it — "length" (OpenAI, Mistral, Ollama, three Bedrock
families), "LENGTH" (Bedrock Amazon), "max_tokens" (Anthropic, Bedrock
Converse) or "MAX_TOKENS" (Google, Bedrock Cohere). Asking "is this answer
whole?" meant knowing every spelling.
Add ContentChoice.Truncated, derived from the vendor string, and
WithFailOnTruncation for callers who would rather have an error. StopReason
keeps the vendor's own spelling, so code already comparing it is unaffected,
and the option is off by default.
Adapters are wired in following commits.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* all: add broad httprr coverage, update dependencies, organize go.mod file, bump to 1.23
update go version to 1.23
add lots of test coverage via httprr recordings
update dependencies and organize go.mod
add testutil/testctr which helps work around a testcontainers-go+colima bug
expand the huggingface implementation and tests
expand capabilities of the ollama package