MCPcopy Create free account
hub / github.com/openai/plugins / collectUsageCandidate

Function collectUsageCandidate

plugins/plugin-eval/src/core/benchmark-events.js:35–55  ·  view source on GitHub ↗
(value, matches)

Source from the content-addressed store, hash-verified

33}
34
35function collectUsageCandidate(value, matches) {
36 if (!value || typeof value !== "object") {
37 return;
38 }
39
40 const normalized = normalizeUsageCandidate(value);
41 if (normalized) {
42 matches.push(normalized);
43 }
44
45 if (Array.isArray(value)) {
46 for (const item of value) {
47 collectUsageCandidate(item, matches);
48 }
49 return;
50 }
51
52 for (const nested of Object.values(value)) {
53 collectUsageCandidate(nested, matches);
54 }
55}
56
57function extractLatestUsage(events) {
58 const matches = [];

Callers 1

extractLatestUsageFunction · 0.85

Calls 2

normalizeUsageCandidateFunction · 0.85
valuesMethod · 0.80

Tested by

no test coverage detected