prgrmc commited on
Commit
74a57f9
1 Parent(s): f64c5f4

modify run_action on helper to adjust for spaces cpu computing-disable llama guard

Browse files
Files changed (1) hide show
  1. helper.py +25 -29
helper.py CHANGED
@@ -595,35 +595,31 @@ Inventory: {json.dumps(game_state['inventory'])}"""
595
  print(f"\nSafety Check Result: {'SAFE' if safe else 'UNSAFE'}")
596
  logger.info(f"Safety check result: {'SAFE' if safe else 'UNSAFE'}")
597
 
598
- if not safe:
599
- logging.warning("Unsafe content detected - blocking response")
600
- print("Unsafe content detected - Response blocked")
601
- return "This response was blocked for safety reasons."
602
-
603
- # # Add quest progress checks
604
- # if game_state["current_quest"]:
605
- # quest = game_state["current_quest"]
606
- # # Check for quest completion keywords
607
- # if any(
608
- # word in message.lower() for word in ["investigate", "explore", "search"]
609
- # ):
610
- # if (
611
- # "mist" in message.lower()
612
- # and quest["title"] == "Investigate the Mist"
613
- # ):
614
- # game_state["player"].complete_quest(quest)
615
- # response += "\n\nQuest Complete: Investigate the Mist! (+100 exp)"
616
-
617
- if safe:
618
- # Check for quest completion
619
- quest_completed, quest_message = check_quest_completion(message, game_state)
620
- if quest_completed:
621
- response += quest_message
622
-
623
- # Check for item updates
624
- inventory_update = update_game_inventory(game_state, response)
625
- if inventory_update:
626
- response += inventory_update
627
 
628
  # Validate response
629
  return response if response else "You look around carefully."
 
595
  print(f"\nSafety Check Result: {'SAFE' if safe else 'UNSAFE'}")
596
  logger.info(f"Safety check result: {'SAFE' if safe else 'UNSAFE'}")
597
 
598
+ # if not safe:
599
+ # logging.warning("Unsafe content detected - blocking response")
600
+ # print("Unsafe content detected - Response blocked")
601
+ # return "This response was blocked for safety reasons."
602
+
603
+ # if safe:
604
+ # # Check for quest completion
605
+ # quest_completed, quest_message = check_quest_completion(message, game_state)
606
+ # if quest_completed:
607
+ # response += quest_message
608
+
609
+ # # Check for item updates
610
+ # inventory_update = update_game_inventory(game_state, response)
611
+ # if inventory_update:
612
+ # response += inventory_update
613
+
614
+ # Check for quest completion
615
+ quest_completed, quest_message = check_quest_completion(message, game_state)
616
+ if quest_completed:
617
+ response += quest_message
618
+
619
+ # Check for item updates
620
+ inventory_update = update_game_inventory(game_state, response)
621
+ if inventory_update:
622
+ response += inventory_update
 
 
 
 
623
 
624
  # Validate response
625
  return response if response else "You look around carefully."