MCPcopy Create free account
hub / github.com/bricks-cloud/BricksLLM / ConvertAnyToStr

Function ConvertAnyToStr

internal/util/util.go:33–53  ·  view source on GitHub ↗
(input any)

Source from the content-addressed store, hash-verified

31}
32
33func 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
55func TranslateBedrockModelToAnthropicModel(model string) string {
56 if strings.HasPrefix(model, "anthropic.claude-v2") {

Calls

no outgoing calls

Tested by

no test coverage detected