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

Function getBedrockModelStrings

src/utils/model/modelStrings.ts:33–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31}
32
33async function getBedrockModelStrings(): Promise<ModelStrings> {
34 const fallback = getBuiltinModelStrings('bedrock')
35 let profiles: string[] | undefined
36 try {
37 profiles = await getBedrockInferenceProfiles()
38 } catch (error) {
39 logError(error as Error)
40 return fallback
41 }
42 if (!profiles?.length) {
43 return fallback
44 }
45 // Each config's firstParty ID is the canonical substring we search for in the
46 // user's inference profile list (e.g. "claude-opus-4-6" matches
47 // "eu.anthropic.claude-opus-4-6-v1"). Fall back to the hardcoded bedrock ID
48 // when no matching profile is found.
49 const out = {} as ModelStrings
50 for (const key of MODEL_KEYS) {
51 const needle = ALL_MODEL_CONFIGS[key].firstParty
52 out[key] = findFirstMatch(profiles, needle) || fallback[key]
53 }
54 return out
55}
56
57/**
58 * Layer user-configured modelOverrides (from settings.json) on top of the

Callers 1

modelStrings.tsFile · 0.85

Calls 3

getBuiltinModelStringsFunction · 0.85
findFirstMatchFunction · 0.85
logErrorFunction · 0.50

Tested by

no test coverage detected