The BaselineBot class (in baseline_bot.py) contains many utility methods that are useful for bots in general. All one needs to do is subclass BaselineBot and implement the abstract methods. There are some methods left entirely empty to serve as places to implement "hooks", while others you need to implement entirely from scratch. There is a method to use for the general game flow, but that can also be overwritten if needed.
For example usage of the methods from BaselineBot, see the following bots:
RandomProposerBot: It should exercise as much general logic as possible, which should be sufficient for most bots.mila_api_advisor.pyandmila_api_player.py: If your bot requires a substantial amount of existing code that lives in another repository, then you might want to use these files as a model for usingchiron_utilsfrom that repository.
Once you've created your own bot, you need to manually add it to __init__.py so it can be exported. All bots should be imported from chiron_utils.bots instead of their individual modules to make imports less verbose and to make refactoring more self-contained. The bot class also needs to be added to the BOTS list in the file so it can be called as an argument. If the bot relies on specific packages that are not installed by default, make their inclusion conditional, following the same technique as the existing code.
If there are dependencies that cannot be installed as Python packages, you will likely need to make some changes to the Dockerfile so the bot can be built. Some refactoring might be needed, and if the changes are large, it might be worth making separate targets for specific bots.
You should add documentation to the README on how to build the bot and the basics of how it works. Anyone who uses the library should be able to run any of the bots.
If your code base is particularly complex (e.g., Cicero), you should import chiron_utils as a package. Otherwise, the bot should be developed right in this repository. Keeping as much as possible in a single place will make refactoring easier.
You generally should not be interfacing directly with game communications yourself and instead should be doing all such interactions through methods in BaselineBot. This will allow us to make changes to the Diplomacy engine without individual bots needing to be changed.
I (Alex) will require all code meets the various standards set for the repository, which will involve code review.
If you want to share code between an advisor and a player, it's up to your how you structure it. You can factor out code into functions, or you can make a class your advisor and player both inherit from. It's up to you. Regardless, you do need to declare the bot_type field as either BotType.ADVISOR or BotType.PLAYER.
Feel free to create utilities and utility classes as needed. If something would be useful to reuse, then we should design it modularly so it can be used in multiple players. In addition, model training scripts and other files should all be stored in the repository to make them easy to find.
Models and other large files should be publicly accessible in some way, likely hosted on the Docker Hub (or GHCR), Hugging Face Hub, or both to make builds easier.