MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getBedrockRegionPrefix

Function getBedrockRegionPrefix

src/utils/model/bedrock.ts:222–235  ·  view source on GitHub ↗
(
  modelId: string,
)

Source from the content-addressed store, hash-verified

220 * - "claude-sonnet-4-5-20250929" → undefined (first-party format)
221 */
222export 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.

Callers 3

applyBedrockRegionPrefixFunction · 0.85
getAgentModelFunction · 0.85
applyParentRegionPrefixFunction · 0.85

Calls 1

extractModelIdFromArnFunction · 0.85

Tested by

no test coverage detected