Bot-Man-Toe/pyserver
Bram van den Heuvel c9899c5d65 Merge branch 'bram/deployment' into elo 2026-07-01 22:51:46 +02:00
..
Containerfile Apply hotfixes from branch bram/sneaky-hotfix 2026-07-01 22:09:01 +02:00
README.md Convert all links to relative links 2026-06-28 23:16:39 +02:00
__init__.py Create MVP PyServer 2026-06-05 18:16:23 +02:00
server.py Update PyServer Containerfile 2026-06-28 13:24:39 +02:00
spec.md Convert all links to relative links 2026-06-28 23:16:39 +02:00

README.md

Publishing your agent

Once your agent behaves the way you want, you can expose it over HTTP so other clients can play against it.

You only need this if you want other programs to connect to your agent.

Use this repository

  1. Open server.py.
  2. Replace the agent passed to PyServer with your own. For example:
from agents.my_agent import MyAgent

player = PyServer(MyAgent())
  1. Start the server. Run:
python server.py

By default, the server listens on port 5000.

  1. Open your browser and visit http://localhost:5000/. You should receive a JSON document describing your agent and the games it supports. If that works, your agent is ready to receive game requests.

Writing your own server

The included server is the easiest way to publish a Python agent.

If you want to implement the protocol yourself (for example in another language) you can use the specification in the protocol specification.