(modelId: string)
| 197 | * And foundation model ARNs: arn:aws:bedrock:<region>::foundation-model/<model-id> |
| 198 | */ |
| 199 | export function extractModelIdFromArn(modelId: string): string { |
| 200 | if (!modelId.startsWith('arn:')) { |
| 201 | return modelId |
| 202 | } |
| 203 | const lastSlashIndex = modelId.lastIndexOf('/') |
| 204 | if (lastSlashIndex === -1) { |
| 205 | return modelId |
| 206 | } |
| 207 | return modelId.substring(lastSlashIndex + 1) |
| 208 | } |
| 209 | |
| 210 | export type BedrockRegionPrefix = (typeof BEDROCK_REGION_PREFIXES)[number] |
| 211 |
no outgoing calls
no test coverage detected