Commit Graph

3 Commits

Author SHA1 Message Date
Sergey Kozyrenko 56437897a3 feat(llms): report an answer cut off at the token limit
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>
2026-08-21 16:33:57 +07:00
Dmitry Ng eee90d9059 fix: multiple linter issues and logic in tests 2025-06-23 13:43:06 +03:00
Travis Cline c544fb77bd all: add broad httprr coverage, update dependencies, organize go.mod file, bump to 1.23 (#1299)
* 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
2025-06-04 11:41:45 -07:00