MCPcopy Index your code
hub / github.com/coder/coder / collectContextLimitValues

Function collectContextLimitValues

coderd/x/chatd/chatloop/chatloop.go:2048–2064  ·  view source on GitHub ↗
(value any, onValue func(int64))

Source from the content-addressed store, hash-verified

2046}
2047
2048func collectContextLimitValues(value any, onValue func(int64)) {
2049 switch typed := value.(type) {
2050 case map[string]any:
2051 for key, child := range typed {
2052 if isContextLimitKey(key) {
2053 if numeric, ok := numericContextLimitValue(child); ok {
2054 onValue(numeric)
2055 }
2056 }
2057 collectContextLimitValues(child, onValue)
2058 }
2059 case []any:
2060 for _, child := range typed {
2061 collectContextLimitValues(child, onValue)
2062 }
2063 }
2064}
2065
2066func isContextLimitKey(key string) bool {
2067 normalized := normalizeMetadataKey(key)

Callers 2

findContextLimitValueFunction · 0.85

Calls 2

isContextLimitKeyFunction · 0.85
numericContextLimitValueFunction · 0.85

Tested by 1