MCPcopy Create free account
hub / github.com/Noumena-Network/code / ModelEntry

Function ModelEntry

src/components/Stats.tsx:845–931  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

843 totalTokens: number;
844};
845function ModelEntry(t0) {
846 const $ = _c(21);
847 const {
848 model,
849 usage,
850 totalTokens
851 } = t0;
852 const modelTokens = usage.inputTokens + usage.outputTokens;
853 const t1 = modelTokens / totalTokens * 100;
854 let t2;
855 if ($[0] !== t1) {
856 t2 = t1.toFixed(1);
857 $[0] = t1;
858 $[1] = t2;
859 } else {
860 t2 = $[1];
861 }
862 const percentage = t2;
863 let t3;
864 if ($[2] !== model) {
865 t3 = renderModelName(model);
866 $[2] = model;
867 $[3] = t3;
868 } else {
869 t3 = $[3];
870 }
871 let t4;
872 if ($[4] !== t3) {
873 t4 = <Text bold={true}>{t3}</Text>;
874 $[4] = t3;
875 $[5] = t4;
876 } else {
877 t4 = $[5];
878 }
879 let t5;
880 if ($[6] !== percentage) {
881 t5 = <Text color="subtle">({percentage}%)</Text>;
882 $[6] = percentage;
883 $[7] = t5;
884 } else {
885 t5 = $[7];
886 }
887 let t6;
888 if ($[8] !== t4 || $[9] !== t5) {
889 t6 = <Text>{figures.bullet} {t4}{" "}{t5}</Text>;
890 $[8] = t4;
891 $[9] = t5;
892 $[10] = t6;
893 } else {
894 t6 = $[10];
895 }
896 let t7;
897 if ($[11] !== usage.inputTokens) {
898 t7 = formatNumber(usage.inputTokens);
899 $[11] = usage.inputTokens;
900 $[12] = t7;
901 } else {
902 t7 = $[12];

Callers

nothing calls this directly

Calls 2

renderModelNameFunction · 0.85
formatNumberFunction · 0.85

Tested by

no test coverage detected