A backend for First Encounter game for FullyHacks 2025. Frontend: FullyHacks
- Python 3.13
- Create a .env and include CEREBRAS_API_KEY
- Run 'pip install -r requirements.txt' to install dependencies
- run 'uvicorn main:app' in src/ and access the API at http://localhost:8000
Sends a message to the alien and gets a JSON-formatted response.
{
"game_id": "your-session-id",
"message": "hello"
}
{
"response": "friend", // Alien's chosen word(s)
"remaining_battery": 85 // Battery left
}
Adds a new word to the alien's vocabulary.
{
"game_id": "your-session-id",
"word": "peace"
}
{
"message": "Alien learned a new word, peace!",
"remaining_bat": "20"
}
Creates a new alien session with default settings.
{
"use_random": "bool"
}
{
"message": "Game started successfully",
"game_id": "new-session-id"
}
Deletes the session and returns game data.
{
"game_id": "session-id"
}
{
"game_data": "game-data"
}