Skip to main content

GuessItCreator

Host-only authoring node for the GuessIt game. It lets you enter a question, generate suggested answers via LLM (with synonyms and scores), edit the results, and then save + start a GuessIt node in your workshop.

Example structures​

Minimal creator node​

{
"type": "GuessItCreator",
"data": { "question": "", "isGenerating": false }
}

With generated data attached​

{
"type": "GuessItCreator",
"data": {
"question": "Nenne einen Bereich, wo man KI einsetzen kann.",
"isGenerating": false,
"generatedData": {
"type": "GuessIt",
"data": {
"text": "Nenne einen Bereich, wo man KI einsetzen kann.",
"answers": [
{
"position": 1,
"answer": "Bildbearbeitung",
"score": 35,
"synonyms": ["Foto", "Bilderkennung"],
"isRevealed": false
},
{
"position": 2,
"answer": "Kundensupport",
"score": 25,
"synonyms": ["Support", "Chatbot"],
"isRevealed": false
},
{
"position": 3,
"answer": "Medizin",
"score": 20,
"synonyms": ["Gesundheit", "Diagnose"],
"isRevealed": false
},
{
"position": 4,
"answer": "Bildung",
"score": 15,
"synonyms": ["Lehre", "Lernen"],
"isRevealed": false
},
{
"position": 5,
"answer": "Finanzen",
"score": 5,
"synonyms": ["Bank", "Trading"],
"isRevealed": false
}
],
"answerTime": 60,
"maxFails": 3
}
}
}
}

Properties​

KeyTypeDefaultDescription
data.questionstring—Prompt used to generate canonical answers. Also becomes the GuessIt.data.text.
data.isGeneratingbooleanfalseUI state flag while a generation job is running.
data.generatedDataobject—LLM result structured exactly like a GuessIt node payload. Optional until generation completes.

Actions (client → server)​

The creator uses action-based messages. Payload values are URL-encoded where appropriate.

  • generate — Start LLM generation
    • Payload: { question: "<text>" }
  • reset — Clear pending data and start over
    • Payload: {}
  • update_answer — Edit an answer’s text
    • Payload: { position: number, field: "answer", value: "<text>" }
  • update_score — Edit an answer’s score
    • Payload: { position: number, score: number }
  • update_synonym — Manage synonyms
    • Payload: { position: number, operation: "add"|"remove"|"edit", synonymIndex?: number, synonymValue?: string }
  • save_and_start — Persist to workshop and switch to the GuessIt node
    • Payload: {}

Save & start flow​

  1. Validate that the sum of all score values equals 100; otherwise, saving is blocked.
  2. If a GuessIt node already follows the creator, it is updated; otherwise, one is inserted after the current node.
  3. The workshop is saved and the host view navigates to the GuessIt node to begin the game.

LLM integration​

  • Generation endpoint: the web app calls /api/llm/guessit/generate (Next.js API route) which in turn forwards the result to Nakama via RPC guessit_llm_generate_result.
  • Clustering used during gameplay: /api/llm/guessit/cluster → Nakama RPC guessit_llm_cluster_result.
  • Secure with NEXT_LLM_SHARED_SECRET (present in both apps) so only trusted calls are accepted.

Environment Variables​

For the environment variables see the GuessIt documentation.

Tips​

  • Use short, concrete answer labels (synonyms can carry variants).
  • You can tweak generated results before saving; changes are synchronized via the update_* actions.