MCPcopy Create free account
hub / github.com/InferCore/InferCore / firstString

Function firstString

internal/retrieval/opensearch_kb.go:135–147  ·  view source on GitHub ↗
(m map[string]any, keys ...string)

Source from the content-addressed store, hash-verified

133}
134
135func firstString(m map[string]any, keys ...string) string {
136 for _, k := range keys {
137 if v, ok := m[k]; ok {
138 switch t := v.(type) {
139 case string:
140 if s := strings.TrimSpace(t); s != "" {
141 return s
142 }
143 }
144 }
145 }
146 return ""
147}

Callers 2

parseMeilisearchHitsFunction · 0.85
parseOpenSearchHitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected