From 073da08edc0ef1987cc502f077fd6bc7c5a4269a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 17 Dec 2025 17:18:10 +0000 Subject: [PATCH] Docs: Update benchmark for google/gemini-3-flash-preview TEMP:0.35 test 7 --- ...google_gemini-3-flash-preview TEMP_0.35.js | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/7_scheduler/outputs/google_gemini-3-flash-preview TEMP_0.35.js diff --git a/tests/7_scheduler/outputs/google_gemini-3-flash-preview TEMP_0.35.js b/tests/7_scheduler/outputs/google_gemini-3-flash-preview TEMP_0.35.js new file mode 100644 index 0000000..7b68d86 --- /dev/null +++ b/tests/7_scheduler/outputs/google_gemini-3-flash-preview TEMP_0.35.js @@ -0,0 +1,57 @@ +export async function findAvailableSlots(cal1, cal2, { durationMinutes: dur, searchRange: range, workHours: work }) { + const { default: dayjs } = await import('https://cdn.skypack.dev/dayjs'); + const { default: utc } = await import('https://cdn.skypack.dev/dayjs/plugin/utc'); + dayjs.extend(utc); + + const setTime = (date, timeStr) => { + const [h, m] = timeStr.split(':'); + return date.utc().set('h', h).set('m', m).set('s', 0).set('ms', 0); + }; + + const busy = [...cal1, ...cal2] + .map(b => ({ s: dayjs.utc(b.start), e: dayjs.utc(b.end) })) + .sort((a, b) => a.s - b.s) + .reduce((acc, cur) => { + const last = acc[acc.length - 1]; + last && cur.s <= last.e ? (last.e = cur.e > last.e ? cur.e : last.e) : acc.push(cur); + return acc; + }, []); + + const slots = []; + let curr = dayjs.utc(range.start); + const limit = dayjs.utc(range.end); + + while (curr.add(dur, 'm') <= limit) { + const start = curr; + const end = curr.add(dur, 'm'); + const workStart = setTime(start, work.start); + const workEnd = setTime(start, work.end); + + if (start < workStart) { + curr = workStart; + continue; + } + + if (end > workEnd) { + curr = setTime(start.add(1, 'd'), work.start); + continue; + } + + const conflict = busy.find(b => start < b.e && end > b.s); + if (conflict) { + curr = conflict.e; + continue; + } + + slots.push({ + start: start.toISOString(), + end: end.toISOString() + }); + curr = end; + } + + return slots; +} +export default findAvailableSlots; +// Generation time: 41.040s +// Result: PASS \ No newline at end of file