Bridge that answers nationstates issues using an AI
How to set up:
- Create an account on Huggingface (https://huggingface.co)
- Generate a read-access token (https://huggingface.co/settings/tokens)
- Find a host for this bot. I use Daki (https://daki.cc)
- Create a server. The absolute minimum necessary is 10% CPU, 100mb RAM and 200mb disk storage. Adding more CPU will make your server start up faster but does little else. Remember to set the programming language as Python!
- Copy the repository and file names.
- Edit environment variables in .env
- USER_AGENT: I use "[email protected] AI Issue Answering" as the user agent, where [email protected] is your actual email.
- HF_API_TOKEN: Input the read-access token you generated in step 2
- API_URL: You can keep this the same. The format is
https://api-inference.huggingface.co/models/
plus the model name at the end. The default value ishttps://api-inference.huggingface.co/models/distilbert-base-cased-distilled-squad
. You can use any question answering model. The list can be found at https://huggingface.co/models?pipeline_tag=question-answering&sort=downloads. To use a model from that collection, copy its name, which is the title showed in search results, and attach it to the end of the url. - NATION: Input the corresponding nation names for the passwords you listed above.
Format: Lowercase, replace all spaces with _
, do not keep prefixes like The Republic of Nation
Examples:
Nation -> "nation"
Very Good AI Nation -> "very_good_ai_nation"
- NATIONSTATES_PASSWORDS: Input your Nationstates passwords, one for each nation you want to use the AI to control.
- PROMPTS: Input the prompt you want to give to the AI at the beginning of each issue query.
The prompts will be sent to the AI in this format: "{prompt} 1, 2, 3 or 4?"
Example: prompt = "Who would Donald Trump agree with,"
Sent query: "Who would Donald Trump agree with, 1, 2, 3, or 4?"
- Run the bot.
The logs are outputted to logs.log.