default_max_attempts_per_step: 30

tokens_for_ai_rubric: |
    You are a master storyteller. Your task is to create a coherent and engaging story based on the following chat history. The story should seamlessly integrate the user's responses and the AI's feedback, ensuring that the narrative flows naturally. Pay special attention to the user's choices and how they shape the story. Use descriptive language to bring the scenes to life and make the story immersive. The story should have a clear beginning, middle, and end, reflecting the user's journey and the outcomes of their decisions. Here is the chat history.

sections:
  - section_id: "section_1"
    title: "The Escape Room Begins"
    steps:
      - step_id: "step_0"
        title: "Waking Up"
        content_blocks:
          - "You wake up in a dimly lit room with no memory of how you got there. The room is small and has a single door that is locked."

      - step_id: "step_1"
        title: "Explore"
        content_blocks:
          - "You see a rug on the floor, a bookshelf with a book, and a safe on the wall."
          - "There is also an exit door, but it seems to be locked."
        tokens_for_ai: "Guide the user to make a choice between looking under the rug, examining the book, trying to open the safe, or trying to leave the room. Use off_topic sparingly if the response choice doesn't fit any other topic."
        question: "What do you do? Look under the rug, Examine the book, Try to open the safe, or Try to leave the room? 🤔"
        buckets:
          - look_under_rug
          - examine_book
          - try_open_safe
          - try_leave_room
          - asking_clarifying_questions
          - off_topic
        transitions:
          look_under_rug:
            next_section_and_step: "section_2:step_1"
          examine_book:
            next_section_and_step: "section_3:step_1"
          try_open_safe:
            next_section_and_step: "section_4:step_1"
          try_leave_room:
            metadata_conditions:
              exit_key: true
            content_blocks:
              - "You chose to try to leave the room. 🚪"
              - "The exit door opens, revealing a way out."
              - "Congratulations! You have found the way out and successfully completed the escape room. 🎉"
            next_section_and_step: "section_6:step_1"
            ai_feedback:
              tokens_for_ai: "The user has exited with the exit_key! The game is over, Use emojis like 👍 and 🌟."
          off_topic:
            ai_feedback:
              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
          asking_clarifying_questions:
            ai_feedback:
              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."

  - section_id: "section_2"
    title: "The Key"
    steps:
      - step_id: "step_1"
        title: "Found the Key"
        content_blocks:
          - "You find a key hidden under the rug. 🔑"
        tokens_for_ai: "Guide the user to make a choice between taking the key or continuing to explore the room. Be flexible to classify actions that lead to finding hidden items. Use off_topic sparingly if the response choice doesn't fit any other topic. Provide feedback based on their choice."
        question: "What do you choose? Take the key or Continue exploring? 🤔"
        buckets:
          - take_key
          - continue_exploring
          - find_coin
          - go_back
          - asking_clarifying_questions
          - off_topic
        transitions:
          take_key:
            content_blocks:
              - "You chose to take the key. 🔑"
            next_section_and_step: "section_1:step_1"
            metadata_add:
              key: true
          continue_exploring:
            next_section_and_step: "section_1:step_1"
          find_coin:
            content_blocks:
              - "You chose to take a closer look under the rug. 🧺"
              - "You find a small, mysterious coin with strange engravings."
              - "You now have the coin!"
            next_section_and_step: "section_1:step_1"
            ai_feedback:
              tokens_for_ai: "The player found a hidden coin. Congratulate them by name with your feedback. Use emojis like 👍 and 🌟."
            metadata_add:
              coin: true
          go_back:
            next_section_and_step: "section_1:step_1"
            ai_feedback:
              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Be flexible to classify actions that lead to finding hidden items. Use emojis like 👍 and 🌟."
          off_topic:
            content_blocks:
              - "It seems like your response is off-topic. Let's try to stay focused on the story. 🔄"
            ai_feedback:
              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
          asking_clarifying_questions:
            ai_feedback:
              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."

  - section_id: "section_3"
    title: "The Book"
    steps:
      - step_id: "step_1"
        title: "Found the Password"
        content_blocks:
          - "The book contains a note with a password: 'ESCAPE123'. 🔐"
        tokens_for_ai: "Guide the user to make a choice between taking note of the password or continuing to explore the room. Be flexible to classify actions that lead to finding hidden items. Use off_topic sparingly if the response choice doesn't fit any other topic. Provide feedback based on their choice."
        question: "What do you choose? Take note of the password or Continue exploring? 🤔"
        buckets:
          - take_password
          - continue_exploring
          - find_paper
          - go_back
          - asking_clarifying_questions
          - off_topic
        transitions:
          take_password:
            content_blocks:
              - "You chose to take note of the password. 🔑"
            next_section_and_step: "section_1:step_1"
            metadata_add:
              password: true
          continue_exploring:
            next_section_and_step: "section_1:step_1"
          find_paper:
            content_blocks:
              - "You chose to take a closer look at the book. 📖"
              - "You find a small, folded piece of paper with a cryptic message."
              - "You take the paper!"
            next_section_and_step: "section_1:step_1"
            ai_feedback:
              tokens_for_ai: "The player found a hidden paper with a cryptic message. Congratulate them by name with your feedback. Use emojis like 👍 and 🌟."
            metadata_add:
              paper: true
          go_back:
            next_section_and_step: "section_1:step_1"
            ai_feedback:
              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Be flexible to classify actions that lead to finding hidden items. Use emojis like 👍 and 🌟."
          off_topic:
            ai_feedback:
              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
          asking_clarifying_questions:
            ai_feedback:
              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."

  - section_id: "section_4"
    title: "The Safe"
    steps:
      - step_id: "step_1"
        title: "Opening the Safe"
        content_blocks:
          - "The safe is locked and requires both a key and a password to open. 🔒"
        tokens_for_ai: "Guide the user to make a choice between using the key and entering the password to open the safe or continuing to explore the room. Be flexible to classify actions that lead to finding hidden items. Use off_topic sparingly if the response choice doesn't fit any other topic. Provide feedback based on their choice."
        question: "What do you do? Use the key and enter the password or Continue exploring? 🤔"
        buckets:
          - use_key_and_password
          - continue_exploring
          - go_back
          - asking_clarifying_questions
          - off_topic
        transitions:
          use_key_and_password:
            metadata_conditions:
              key: true
              password: true
            content_blocks:
              - "You chose to use the key and enter the password to open the safe. 🔑"
              - "The safe opens, revealing a hidden treasure and the exit key. 🎉"
              - "There is also a slot for a coin, but that is likely not important..."
            next_section_and_step: "section_4:step_2"
            ai_feedback:
              tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Be flexible to classify actions that lead to finding hidden items. Use emojis like 👍 and 🌟."
            metadata_add:
              second_safe: true
              exit_key: true
          continue_exploring:
            next_section_and_step: "section_1:step_1"
          go_back:
            next_section_and_step: "section_3:step_1"
            ai_feedback:
              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Be flexible to classify actions that lead to finding hidden items. Use emojis like 👍 and 🌟."
          off_topic:
            ai_feedback:
              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
          asking_clarifying_questions:
            ai_feedback:
              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."

      - step_id: "step_2"
        title: "Safe is Open"
        content_blocks:
          - "The safe is now open, revealing treasure and an exit key. 🎉"
          - "There is a coin slot in the safe that looks intriguing. 🪙"
        tokens_for_ai: "Guide the user to make a choice: If they mention 'use coin', 'coin slot', or 'insert coin' categorize as 'use_coin'. If they want to continue exploring or leave, categorize accordingly."
        question: "What do you do? Use the coin in the slot, Try to leave the room, or Continue exploring? 🤔"
        buckets:
          - use_coin
          - try_leave_room
          - continue_exploring
          - go_back
          - asking_clarifying_questions
          - off_topic
        transitions:
          use_coin:
            metadata_conditions:
              coin: true
              second_safe: true
            metadata_remove:
              - coin
            next_section_and_step: "section_5:step_1"
            ai_feedback:
              tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Be flexible to classify actions that lead to finding hidden items. Use emojis like 👍 and 🌟."
          try_leave_room:
            metadata_conditions:
              exit_key: true
            content_blocks:
              - "You chose to try to leave the room. 🚪"
              - "The exit door opens, revealing a way out."
              - "Congratulations! You have found the way out and successfully completed the escape room. 🎉"
            next_section_and_step: "section_6:step_1"
            ai_feedback:
              tokens_for_ai: "The user has exited with the exit_key! The game is over, Use emojis like 👍 and 🌟."
          continue_exploring:
            next_section_and_step: "section_1:step_1"
          go_back:
            next_section_and_step: "section_4:step_1"
            ai_feedback:
              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Use emojis like 👍 and 🌟."
          off_topic:
            ai_feedback:
              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
          asking_clarifying_questions:
            ai_feedback:
              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."

  - section_id: "section_5"
    title: "The Secret Compartment"
    steps:
      - step_id: "step_1"
        title: "The Hidden Compartment"
        content_blocks:
          - "The compartment opens, revealing a second, smaller safe. 🪙"
          - "This safe requires a combination to open."
        tokens_for_ai: "Guide the user to make a choice between solving the combination to open the second safe or leaving it alone. Be flexible to classify actions that lead to finding hidden items. Use off_topic sparingly if the response choice doesn't fit any other topic. Provide feedback based on their choice."
        question: "Do you try to solve the combination or leave it alone? 🤔"
        buckets:
          - solve_combination
          - leave_it_alone
          - go_back
          - asking_clarifying_questions
          - off_topic
        transitions:
          solve_combination:
            metadata_conditions:
              paper: true
            content_blocks:
              - "You chose to solve the combination. 🧩"
              - "After some thought, you decipher the cryptic message and enter the combination."
              - "The second safe opens, revealing a map to a hidden location outside the room."
              - "Congratulations! You have found the ultimate secret and a new adventure awaits. 🎉"
            next_section_and_step: "section_1:step_1"
            ai_feedback:
              tokens_for_ai: "Congratulate the player by name for finding ultimate secret. Use emojis like 👍 and 🌟."
          leave_it_alone:
            next_section_and_step: "section_1:step_1"
            ai_feedback:
              tokens_for_ai: "Provide positive reinforcement and guide the user to the final encounter. Be flexible to classify actions that lead to finding hidden items. Use emojis like 👍 and 🌟."
          go_back:
            next_section_and_step: "section_4:step_1"
            ai_feedback:
              tokens_for_ai: "Provide positive reinforcement and guide the user to make the next choice. Be flexible to classify actions that lead to finding hidden items. Use emojis like 👍 and 🌟."
          off_topic:
            ai_feedback:
              tokens_for_ai: "Gently guide the user back to the story in a supportive manner. Use emojis like 🔄 and 🧭."
          asking_clarifying_questions:
            ai_feedback:
              tokens_for_ai: "Answer the user's clarifying questions and provide additional information in a friendly and engaging manner. Use emojis like ❓ and 💬."

  - section_id: "section_6"
    title: "Prize Room"
    steps:
      - step_id: "step_1"
        title: "Choose Your Prize"
        content_blocks:
          - "You have reached the prize room! 🎁"
          - "There are 10 different items in the room. One is your prize."
        tokens_for_ai: "Randomly select one of the following prize_ items as the user's prize."
        question: "Guess your prize? 🤔"
        buckets:
          - prize_1
          - prize_2
          - prize_3
          - prize_4
          - prize_5
          - prize_6
          - prize_7
          - prize_8
          - prize_9
          - prize_10
        transitions:
          prize_1:
            content_blocks:
              - "You won Prize 1: A golden keychain. 🗝️"
            metadata_add:
              prize: golden_keychain
          prize_2:
            content_blocks:
              - "You won Prize 2: A mysterious amulet. 🧿"
            metadata_add:
              prize: mysterious_amulet
          prize_3:
            content_blocks:
              - "You won Prize 3: A rare gemstone. 💎"
            metadata_add:
              prize: rare_gemstone
          prize_4:
            content_blocks:
              - "You won Prize 4: An ancient scroll. 📜"
            metadata_add:
              prize: ancient_scroll
          prize_5:
            content_blocks:
              - "You won Prize 5: A magical wand. 🪄"
            metadata_add:
              prize: magical_wand
          prize_6:
            content_blocks:
              - "You won Prize 6: A treasure map. 🗺️"
            metadata_add:
              prize: treasure_map
          prize_7:
            content_blocks:
              - "You won Prize 7: A silver coin. 🪙"
            metadata_add:
              prize: silver_coin
          prize_8:
            content_blocks:
              - "You won Prize 8: A mystical ring. 💍"
            metadata_add:
              prize: mystical_ring
          prize_9:
            content_blocks:
              - "You won Prize 9: A rare book. 📚"
            metadata_add:
              prize: rare_book
          prize_10:
            content_blocks:
              - "You won Prize 10: A magical potion. 🧪"
            metadata_add:
              prize: magical_potion

  - section_id: "section_7"
    title: "Congratulations!"
    steps:
      - step_id: "step_1"
        title: "Well Done!"
        content_blocks:
          - "Congratulations on finding the hidden treasure! 🎉"
          - "You have successfully completed the escape room."
          - "We hope you enjoyed the adventure. 🌟"
