Skip to content

Commit

Permalink
raise error when llm did not conform to output format
Browse files Browse the repository at this point in the history
  • Loading branch information
Luncenok committed Oct 28, 2024
1 parent dfde2ee commit 25e68b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
20 changes: 3 additions & 17 deletions new_gui_development_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,23 @@ This plan outlines the development of a comprehensive GUI for the LLMPostor proj
- Visualize voting results using a clear and intuitive representation:
- Bar chart: Show the number of votes for each player.

**Phase 3: LLM Interaction Visualization**

1. **LLM Interaction Visualization:**
- Create a chat window to visualize prompts and responses of player LLMs.
- Implement a mechanism to collapse prompts by default, allowing users to expand them when needed.
- Display prompts and responses in a chronological order.


**Additional Considerations:**

- **Scenario Selection:** Allow users to choose from a library of pre-defined scenarios or create their own.
- Implement a scenario selection menu or dropdown.
- Provide options to customize scenario parameters (e.g., number of players, impostors, task difficulty).
- **Player Customization:** Allow users to customize player names, avatars, and LLM models.
- Implement a player customization section.
- **Player Customization:** Allow users to customize player LLM models.
- Provide a list of available LLM models and allow users to select their preferred options.
- **Game History:** Provide a log of past game turns, including player actions, discussion messages, and voting results.
- Implement a game history section that displays a chronological record of game events.
- Allow users to filter and search through the game history.
- **Data Export:** Allow users to export game data (e.g., player actions, discussion transcripts, voting results) in various formats (e.g., CSV, JSON).
- **Data Export:** Allow users to export game state.
- Implement an export functionality that allows users to save game data for further analysis.

This development plan provides a structured approach to building a comprehensive and user-friendly GUI for the LLMPostor project. By following these phases and considering the additional features and extensions, you can create a powerful tool for analyzing and visualizing the persuasive abilities of LLMs in a game-like environment.


**Phase ????**
- **Turn Control:**
- Slider to navigate through game turns.
- "Previous Turn" and "Next Turn" buttons for sequential navigation.
- **Game Control:**
- "Resume" and "Stop" buttons to control game execution.
- "Resume" and "Stop" switch to control game execution.
- "Save State" functionality to save the current game state to a separate file.
- **Player Action Selection:**
- Section for manual action selection, allowing users to choose actions for a specific player.
1 change: 1 addition & 0 deletions src/llm_postor/game/agents/adventure_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def check_action_valid(self, chosen_action: str) -> int:
else:
warning_str = f"{self.player_name} LLM did not conform to output format. Expected one of {normalized_available_actions}, but got {chosen_action} ({normalized_chosen_action} normalized)"
print(warning_str)
raise ValueError(warning_str)
self.responses.append(warning_str)
return 0

Expand Down
1 change: 1 addition & 0 deletions src/llm_postor/game/agents/voting_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def check_action_valid(self, chosen_action: str) -> int:
else:
warning_str = f"{self.player_name} LLM did not conform to output format. Expected one of {normalized_available_actions}, but got {chosen_action} ({normalized_chosen_action} normalized)"
print(warning_str)
raise ValueError(warning_str)
self.responses.append(warning_str)
return 0 # Default to first action if invalid

Expand Down

0 comments on commit 25e68b2

Please sign in to comment.