( modelId: string, )
| 220 | * - "claude-sonnet-4-5-20250929" → undefined (first-party format) |
| 221 | */ |
| 222 | export function getBedrockRegionPrefix( |
| 223 | modelId: string, |
| 224 | ): BedrockRegionPrefix | undefined { |
| 225 | // Extract the inference profile ID from ARN format if present |
| 226 | // ARN format: arn:aws:bedrock:<region>:<account>:inference-profile/<profile-id> |
| 227 | const effectiveModelId = extractModelIdFromArn(modelId) |
| 228 | |
| 229 | for (const prefix of BEDROCK_REGION_PREFIXES) { |
| 230 | if (effectiveModelId.startsWith(`${prefix}.anthropic.`)) { |
| 231 | return prefix |
| 232 | } |
| 233 | } |
| 234 | return undefined |
| 235 | } |
| 236 | |
| 237 | /** |
| 238 | * Apply a region prefix to a Bedrock model ID. |
no test coverage detected