MCPcopy
hub / github.com/mudler/LocalAI / formatChatModelList

Function formatChatModelList

core/cli/chat/models.go:5–17  ·  view source on GitHub ↗
(models []string, current string)

Source from the content-addressed store, hash-verified

3import "strings"
4
5func formatChatModelList(models []string, current string) string {
6 var b strings.Builder
7 for _, model := range models {
8 prefix := " "
9 if model == current {
10 prefix = "* "
11 }
12 b.WriteString(prefix)
13 b.WriteString(model)
14 b.WriteByte('\n')
15 }
16 return b.String()
17}

Callers 2

resolveChatModelFunction · 0.85
printChatModelsFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected