This commit is contained in:
mike
2025-12-18 22:15:32 +01:00
parent 12e96ab7ce
commit 5ee765997e
5 changed files with 391956 additions and 5 deletions

View File

@@ -318,8 +318,8 @@ Context: {desc[:260]}
obj = extract_first_json(content)
wc = sanitize_wordcluemap(obj)
# Repair pass (als model toch array/invalid stuff geeft)
if len(wc) < max(6, n_words - 4):
# Aggressive repair for short words
if len(wc) < MIN_ACCEPT_WORDS:
repair = f"""
Zet dit om naar een STRICT JSON OBJECT (geen array) "WOORD":"clue".
KRITIEK:
@@ -370,12 +370,14 @@ def main():
title, desc = rnd.choice(items)
slug = safe_slug(title)
wc = llm_make_wordcluemap(base_url, model, title, desc, n_words=12)
if len(wc) < 8:
wc = llm_make_wordcluemap(base_url, model, title, desc, n_words=TARGET_WORDS)
# Stricter validation: need more words since they're shorter
if len(wc) < MIN_ACCEPT_WORDS:
continue
puz = generate_puzzle(wc, rnd)
if not puz or len(puz["placed"]) < 6:
# Require at least 7 placed words for a decent puzzle
if not puz or len(puz["placed"]) < 7:
continue
exported = export_format(puz, difficulty=1, rewards={"coins": 50, "stars": 2, "hints": 1})