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

Function countTokensFromJson

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

Source from the content-addressed store, hash-verified

152)
153
154func countTokensFromJson(bytes []byte, contentLoc string) (int, error) {
155 content := getContentFromJson(bytes, contentLoc)
156 return custom.Count(content)
157}
158
159func getContentFromJson(bytes []byte, contentLoc string) string {
160 result := gjson.Get(string(bytes), contentLoc)

Callers 1

decorateEventMethod · 0.85

Calls 2

CountFunction · 0.92
getContentFromJsonFunction · 0.70

Tested by

no test coverage detected