Files
langchaingo/internal
Sergey Kozyrenko 058e344d90 fix(vertex,bedrock): saturate max tokens instead of wrapping to a negative limit
WithMaxTokens above MaxInt32 wrapped: 3_000_000_000 became -1294967296 on the
Vertex generation config (max output tokens, candidate count and top-k) and on
the Converse inference config. The googleai adapter already saturated, so the
same call succeeded there and failed on the sibling doors.

The saturating conversion moves to internal/numutil so the three doors share one
implementation. The Vertex generation config is extracted into a function so the
conversion has a seam a test can reach.

Not changed: the thinking-budget conversion in googleai, where GetTokens is
already clamped to MaxReasoningTokens and cannot overflow.

PAGI-132
2026-08-23 00:32:07 +07:00
..
2025-06-16 18:14:02 +02:00
2025-06-16 18:14:02 +02:00