Skip to content

Commit

Permalink
Merge pull request #85 from colbyedell/main
Browse files Browse the repository at this point in the history
Minor fixes.
  • Loading branch information
research-outcome authored Jul 19, 2024
2 parents 585aa7b + e524c66 commit 74605c1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
10 changes: 1 addition & 9 deletions game-simulation/FAQs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
"Question": "How do I use the game simulation page?",
"Answer": "Please click the User Guide button on the game simulation page for written and video guides on how to use the page."
},
{
"Question": "Why do I get 'networkerror'?",
"Answer": "If you get the error when you run the game simulation at https://research-outcome.github.io/LLM-Game-Benchmark/game-simulation/ or when you run it at your local machine, you need to enter your API Key for the LLMs that you are using to make the game simulation work."
},
{
"Question": "Can I run the simulation at my local machine?",
"Answer": "Yes, you can download the GitHub repository to your local machine, then run the index.html in the game-simulation folder, and then enter your API Keys."
},
{
"Question": "Can I submit results for a new LLM?",
"Answer": "Yes, we appreciate contributions to the benchmarks as results from new game runs. Please use the game simulation code to enter your LLM information and then send the files generated by the 'Game Simulation' web app to be added to the leaderboard. Please send the data to research.explorations at gmail address."
Expand Down Expand Up @@ -47,4 +39,4 @@
"Question": "What does the Auto-Scroll Progress Displays checkbox do?",
"Answer": "This checkbox, when checked, will automatically scroll the progress displays (located to the left and right sides of the game board for the first and second player, respectively) downward whenever a new move is made. Leave this unchecked if you'd like to scroll the progress displays freely."
}
]
]
2 changes: 1 addition & 1 deletion game-simulation/add-games-guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ <h1><strong>Adding Your Own Games to the LLM Game Simulation</strong></h1>

The "classes.js" file in the "game-simulation" folder contains the Move class implementation if you'd like to view the constructor parameters and their meanings.
<div class="code-snippet">
<span class="orange">static</span> processMove(response, currentPlayer, model, currentMoveCount, currentStatus, useConsoleLogging) {<br>
<span class="orange">static</span> <span class="blue">processMove</span>(response, currentPlayer, model, currentMoveCount, currentStatus, useConsoleLogging) {<br>
&emsp;<span class="orange">let</span> row;<br>
&emsp;<span class="orange">let</span> col;<br>
&emsp;<span class="orange">let</span> symbol = (currentPlayer === <span class="cyan">1</span>) ? <span class="green">"X"</span> : <span class="green">"O"</span>;<br>
Expand Down
15 changes: 8 additions & 7 deletions game-simulation/game-simulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { populateGameDetailsTable, populatePromptTable, populateLLMTable, popula
const GAME_RESET_DELAY = 5000; // Time to wait (in milliseconds) before resetting the board after a game ends.
const MAX_GAME_REPEATS = 10; // Max number of times to attempt to repeat a game when network errors occur.

// REMOVE BEFORE RELEASE.
const OPENAI_API_KEY = "PLACE YOUR API KEY HERE";
const GOOGLE_API_KEY = "PLACE YOUR API KEY HERE";
const BEDROCK_SECRET = "PLACE YOUR API KEY HERE";
Expand Down Expand Up @@ -338,8 +337,8 @@ async function playGame() {
}

// Update game results for progress windows.
document.getElementById("game-" + currentGameCount + "-result-first-player-" + gameRepeatCounter).textContent = (result === "networkerror") ? "Network error occurred. Please check your API keys and URLs in the 'Manage LLMs' window." : result;
document.getElementById("game-" + currentGameCount + "-result-second-player-" + gameRepeatCounter).textContent = (result === "networkerror") ? "Network error occurred. Please check your API keys and URLs in the 'Manage LLMs' window." : result;
document.getElementById("game-" + currentGameCount + "-result-first-player-" + gameRepeatCounter).textContent = result;
document.getElementById("game-" + currentGameCount + "-result-second-player-" + gameRepeatCounter).textContent = result;

gameRepeatCounter++; // Increment game repeat counter.

Expand Down Expand Up @@ -458,10 +457,10 @@ function getBulkRunGameCount() {
// Enable or disable option input fields.
function disableInputs(disableFlag) {
document.getElementById("game-type").disabled = disableFlag;
document.getElementById("prompt-type").disabled = disableFlag;
document.getElementById("game-count").disabled = disableFlag;
document.getElementById("first-player").disabled = disableFlag;
document.getElementById("second-player").disabled = disableFlag;
document.getElementById("game-count").disabled = disableFlag;
document.getElementById("prompt-type").disabled = disableFlag;
document.getElementById("manage-llms-btn").disabled = disableFlag;
document.getElementById("reset-btn").disabled = disableFlag;

Expand Down Expand Up @@ -531,10 +530,12 @@ async function updateProgressDisplays(game, move, progressDisplayType) {

// Append current move to the current player's progress display.
if (currentPlayer === 1) {
firstPlayerProgressDisplay.innerHTML += "Move " + moveNumber + ":<br>" + newContent;
firstPlayerProgressDisplay.innerHTML += "Move " + moveNumber + ":<br>" +
newContent;
}
else {
secondPlayerProgressDisplay.innerHTML += "Move " + moveNumber + ":<br>" + newContent;
secondPlayerProgressDisplay.innerHTML += "Move " + moveNumber + ":<br>" +
newContent;
}

// Scroll the progress displays downward if the "autoScrollDisplays" flag is set to true.
Expand Down

0 comments on commit 74605c1

Please sign in to comment.