MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / parseBaseModelId

Method parseBaseModelId

src/api/providers/bedrock.ts:1058–1079  ·  view source on GitHub ↗
(modelId: string)

Source from the content-addressed store, hash-verified

1056
1057 //This strips any region prefix that used on cross-region model inference ARNs
1058 private parseBaseModelId(modelId: string): string {
1059 if (!modelId) {
1060 return modelId
1061 }
1062
1063 // Remove AWS cross-region inference profile prefixes
1064 // as defined in AWS_INFERENCE_PROFILE_MAPPING
1065 for (const [_, inferenceProfile] of AWS_INFERENCE_PROFILE_MAPPING) {
1066 if (modelId.startsWith(inferenceProfile)) {
1067 // Remove the inference profile prefix from the model ID
1068 return modelId.substring(inferenceProfile.length)
1069 }
1070 }
1071
1072 // Also strip Global Inference profile prefix if present
1073 if (modelId.startsWith("global.")) {
1074 return modelId.substring("global.".length)
1075 }
1076
1077 // Return the model ID as-is for all other cases
1078 return modelId
1079 }
1080
1081 //Prompt Router responses come back in a different sequence and the model used is in the response and must be fetched by name
1082 getModelById(modelId: string, modelType?: string): { id: BedrockModelId | string; info: ModelInfo } {

Callers 5

createMessageMethod · 0.95
parseArnMethod · 0.95
getModelByIdMethod · 0.95
getModelMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected