init
This commit is contained in:
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user