Fix battleship AI hallucination bug with skip_condition system
Add skip_condition logic to feedback prompts to prevent AI from generating false ship destruction messages when no ships were actually destroyed. Changes: - Add skip_condition parameter support in provide_feedback_prompts() - Support all_null, all_false, and all_true condition types - Apply skip_condition to battleship Ship Status and Game Over prompts - Add comprehensive unit tests covering all skip condition scenarios - Test real battleship scenario that was causing hallucinations This prevents the AI from creating false positive ship destruction messages when metadata indicates no ships were actually sunk (all null values).
This commit is contained in:
parent
060a91d2e1
commit
fca7addaa5
4 changed files with 325 additions and 0 deletions
|
|
@ -230,6 +230,7 @@ sections:
|
|||
metadata_filter:
|
||||
- user_sunk_ship_this_round
|
||||
- ai_sunk_ship_this_round
|
||||
skip_condition: "all_null"
|
||||
|
||||
- name: "Game Over"
|
||||
tokens_for_ai: |
|
||||
|
|
@ -245,6 +246,7 @@ sections:
|
|||
- game_over
|
||||
- user_wins
|
||||
- ai_wins
|
||||
skip_condition: "all_false"
|
||||
|
||||
processing_script: |
|
||||
import random
|
||||
|
|
|
|||
|
|
@ -208,6 +208,7 @@ sections:
|
|||
metadata_filter:
|
||||
- user_sunk_ship_this_round
|
||||
- ai_sunk_ship_this_round
|
||||
skip_condition: "all_null"
|
||||
|
||||
- name: "Game Over"
|
||||
tokens_for_ai: |
|
||||
|
|
@ -223,6 +224,7 @@ sections:
|
|||
- game_over
|
||||
- user_wins
|
||||
- ai_wins
|
||||
skip_condition: "all_false"
|
||||
|
||||
processing_script: |
|
||||
import random
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue