Docs: Update Gemini benchmark results

This commit is contained in:
github-actions[bot]
2025-11-18 22:04:41 +00:00
parent 31a18dd4ee
commit 33b8150958
220 changed files with 3256 additions and 1491 deletions
@@ -1,22 +1,19 @@
const processCSV = async (csvString, { filterColumn: fc, filterValue: fv, groupBy: gb, aggregateColumn: ac, operation: op }) => {
const { parse } = await import('https://cdn.jsdelivr.net/npm/papaparse@5.4.1/+esm')
const { data } = parse(csvString, { header: true, skipEmptyLines: true })
const processCSV = async (csv, { filterColumn: fc, filterValue: fv, groupBy: gb, aggregateColumn: ac, operation: op }) => {
const { csvParse } = await import('https://esm.run/d3-dsv')
const groups = new Map()
for (const row of data) {
csvParse(csv).forEach(row => {
if (row[fc] == fv) {
const key = row[gb]
const val = +row[ac] || 0
const acc = groups.get(key) || { sum: 0, count: 0 }
acc.sum += val
acc.count += 1
groups.set(key, acc)
const curr = groups.get(key) || { s: 0, n: 0 }
groups.set(key, { s: curr.s + val, n: curr.n + 1 })
}
}
})
return Array.from(groups, ([key, { sum, count }]) => ({
return [...groups].map(([key, { s, n }]) => ({
[gb]: key,
result: op === 'count' ? count : op === 'sum' ? sum : sum / count
result: op === 'count' ? n : op === 'sum' ? s : s / n
}))
}
export default processCSV;