(input any)
| 31 | } |
| 32 | |
| 33 | func ConvertAnyToStr(input any) (string, error) { |
| 34 | converted := "" |
| 35 | |
| 36 | if str, ok := input.(string); ok { |
| 37 | converted += str |
| 38 | } else if arr, ok := input.([]interface{}); ok { |
| 39 | for _, unknown := range arr { |
| 40 | str, ok := unknown.(string) |
| 41 | if ok { |
| 42 | converted += str |
| 43 | continue |
| 44 | } |
| 45 | |
| 46 | return "", errors.New("input array contains a non string entry") |
| 47 | } |
| 48 | } else { |
| 49 | return "", errors.New("input is neither string nor an array of strings") |
| 50 | } |
| 51 | |
| 52 | return converted, nil |
| 53 | } |
| 54 | |
| 55 | func TranslateBedrockModelToAnthropicModel(model string) string { |
| 56 | if strings.HasPrefix(model, "anthropic.claude-v2") { |
no outgoing calls
no test coverage detected