Spaces:
Running
Running
modify run_action on helper to adjust for spaces cpu computing-disable llama guard
Browse files
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 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
#
|
604 |
-
#
|
605 |
-
#
|
606 |
-
#
|
607 |
-
#
|
608 |
-
|
609 |
-
#
|
610 |
-
#
|
611 |
-
#
|
612 |
-
#
|
613 |
-
|
614 |
-
#
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
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."
|