From ad21f178a1014af82e2b10c1e36520e1a163c729 Mon Sep 17 00:00:00 2001 From: Earl Potters Date: Sun, 18 May 2025 22:35:12 +0000 Subject: [PATCH] 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. --- environments/dynastai/dynastai_server.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/environments/dynastai/dynastai_server.py b/environments/dynastai/dynastai_server.py index 877fb4bb..29c3d1d7 100755 --- a/environments/dynastai/dynastai_server.py +++ b/environments/dynastai/dynastai_server.py @@ -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)}, "