Overture is a matchmaked online text game, where the player tries to deduce whether the other player is an AI or a person, analogous to the turing test.
How to install and run:
- DDL
CREATE TABLE `users` (
`uId` int(11) NOT NULL AUTO_INCREMENT, -- userID
`uName` text DEFAULT NULL, -- username
`uToken` text NOT NULL, -- current session token
`uPassword` text DEFAULT NULL, -- password
`uVerified` tinyint(1) DEFAULT 0, -- verified variable
`uEmail` text DEFAULT NULL, -- users email
`gamesWon` int(11) DEFAULT 0, -- total games won
`totalGames` int(11) DEFAULT 0, -- total games played
PRIMARY KEY (`uId`)
);
CREATE TABLE `messageBank` (
`mId` varchar(128) NOT NULL, -- messageID
`uId` int(11) NOT NULL, -- userID
`player` boolean NOT NULL, -- player condition
`aId` text DEFAULT NULL, -- AI ID
`pId` text DEFAULT NULL, -- prompt ID
`chatId` text NOT NULL, -- Chat ID
`message` NVARCHAR(8192) CHARACTER SET utf8 NOT NULL, -- actual messages (allowing unicode)
PRIMARY KEY (`mId`),
FOREIGN KEY (`uId`) REFERENCES users(`uId`),
);
-
install packages
npm install express bcrypt cookie-parser email-validator express sync-mysql ollama uuid openai
-
install ollama
-
install specified model
ollama pull llama3:8b
-
start ollama
ollama serve
-
run
node server.js
/api/leaderboard
returns sorted top 5 (less if there are less than 5 players) players in terms of win:totalGames ratio in the form:
{"status":"success","leaderboard":[{"uId":playerID,"wL":wLRatio,"gamesWon":gamesWon,"totalGames":totalGames}]}
/api/myScore?uId=userId
returns users historical score in the form:
{"status":"success","data":{"gamesWon":gamesWon,"totalGames":totalGames,"wL":wLRatio}}