feat: implement pbUpsert helper for streamlined database operations and update related functions

This commit is contained in:
RaymondVerhoef
2026-05-22 19:56:23 +02:00
parent ca8945ea5b
commit 7b6ae265db
7 changed files with 38 additions and 69 deletions

View File

@@ -1,5 +1,5 @@
import * as db from './db';
import { callLLM } from './llm';
import { callLLM, cachedSystem } from './llm';
import { EMIT_QUIZ_QUESTIONS_TOOL } from './llmTools';
import { getCurriculumTopic, getQuarterForWeek } from './curriculumService';
import { shuffle, sample } from './random';
@@ -25,8 +25,6 @@ const BANNED_OPTION_PATTERNS = [
/both a and d/i,
];
const cachedSystem = (text) => [{ type: 'text', text, cache_control: { type: 'ephemeral' } }];
function normalizeQuestionText(text) {
return String(text || '')
.toLowerCase()