(toolName: string)
| 73 | * AWS Bedrock requires toolUseId to be 1-64 characters, pattern [a-zA-Z0-9_-]+ |
| 74 | */ |
| 75 | export function generateToolUseId(toolName: string): string { |
| 76 | const timestamp = Date.now().toString(36) // Base36 timestamp (9 chars) |
| 77 | const random = randomFloat().toString(36).substring(2, 7) // 5 random chars |
| 78 | const suffix = `-${timestamp}-${random}` // ~15 chars |
| 79 | const maxNameLength = 64 - suffix.length |
| 80 | const truncatedName = toolName.substring(0, maxNameLength).replace(/[^a-zA-Z0-9_-]/g, '_') |
| 81 | return `${truncatedName}${suffix}` |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Models whose AWS model cards state geo/cross-region inference profiles are |
no test coverage detected