fix(bedrock): keep skipping a non-string runtime endpoint

Backport to lts/1.108.x ahead of its main PR.
Cherry-picked from ec312bb5e9 (litellm_fix_bedrock_empty_api_base).
This commit is contained in:
mateo-berri 2026-11-06 14:31:42 -08:00
parent 534aeb2d88
commit 03fc76ed8d

View file

@ -1526,7 +1526,10 @@ class BaseAWSLLM(SignsRequestsWithAWS):
aws_region_name: str,
endpoint_type: Literal["runtime", "agent", "agentcore"] | None = "runtime",
) -> tuple[str, str]:
runtime_endpoint: Final = aws_bedrock_runtime_endpoint or get_secret_str("AWS_BEDROCK_RUNTIME_ENDPOINT")
configured_endpoint: Final = (
aws_bedrock_runtime_endpoint if isinstance(aws_bedrock_runtime_endpoint, str) else None
)
runtime_endpoint: Final = configured_endpoint or get_secret_str("AWS_BEDROCK_RUNTIME_ENDPOINT")
endpoint_url: Final = (
api_base
or runtime_endpoint