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

Function renderObservedUsage

plugins/plugin-eval/src/renderers/html.js:72–95  ·  view source on GitHub ↗
(observedUsage)

Source from the content-addressed store, hash-verified

70}
71
72function renderObservedUsage(observedUsage) {
73 if (!observedUsage) {
74 return "<p>No observed usage supplied.</p>";
75 }
76
77 const items = [
78 `Samples: ${observedUsage.sampleCount}`,
79 `Observed input avg: ${observedUsage.inputTokens.average}`,
80 `Observed output avg: ${observedUsage.outputTokens.average}`,
81 `Observed total avg: ${observedUsage.totalTokens.average}`,
82 ];
83
84 if (observedUsage.cachedTokens.total > 0) {
85 items.push(`Observed cached avg: ${observedUsage.cachedTokens.average}`);
86 }
87
88 if (observedUsage.estimateComparison) {
89 items.push(`Estimated active tokens: ${observedUsage.estimateComparison.estimatedActiveTokens}`);
90 items.push(`Estimate delta: ${observedUsage.estimateComparison.deltaTokens}`);
91 items.push(`Estimate ratio: ${observedUsage.estimateComparison.deltaRatio} (${observedUsage.estimateComparison.band})`);
92 }
93
94 return renderList(items);
95}
96
97function renderMeasurementPlan(plan) {
98 if (!plan) {

Callers 1

renderHtmlFunction · 0.70

Calls 1

renderListFunction · 0.85

Tested by

no test coverage detected