Update choice history display in DynastAI prompt formatting

- Modified the prompt generation to include all choices made by the player instead of limiting to the last three.
- Enhanced the formatting to ensure clarity by stripping existing numbering from character prompts.
- Improved readability of the decision and effects displayed for each choice in the history.
This commit is contained in:
Earl Potters 2025-05-18 22:35:12 +00:00
parent 790e3848f5
commit ad21f178a1

View file

@ -240,8 +240,12 @@ class DynastAIEnv(BaseEnv):
if choice_history:
prompt += "Previous choices made:\n"
for i, choice in enumerate(choice_history[-3:]): # Show last 3 choices at most
prompt += f"{i+1}. {choice.get('Character', 'Unknown')} presented: \"{choice.get('Prompt', 'Unknown')}\"\n"
for i, choice in enumerate(choice_history): # Show all choices
# Get the character and prompt, ensuring we strip any existing numbering
character = choice.get('Character', 'Unknown')
character_prompt = choice.get('Prompt', 'Unknown')
prompt += f"{i+1}. {character} presented: \"{character_prompt}\"\n"
prompt += f" Decision: {choice.get('choice_made', 'Unknown')}\n"
prompt += f" Effects: Piety {choice.get('effects', {}).get('Piety', 0)}, "
prompt += f"Stability {choice.get('effects', {}).get('Stability', 0)}, "