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

Function getContentFromJson

internal/message/handler.go:159–176  ·  view source on GitHub ↗
(bytes []byte, contentLoc string)

Source from the content-addressed store, hash-verified

157}
158
159func getContentFromJson(bytes []byte, contentLoc string) string {
160 result := gjson.Get(string(bytes), contentLoc)
161 content := ""
162
163 if len(result.Str) != 0 {
164 content += result.Str
165 }
166
167 if result.IsArray() {
168 for _, val := range result.Array() {
169 if len(val.Str) != 0 {
170 content += val.Str
171 }
172 }
173 }
174
175 return content
176}
177
178type costLimitError interface {
179 Error() string

Callers 1

countTokensFromJsonFunction · 0.70

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected