Skip to content

ilukasschneider/AnimalClues

Repository files navigation

🐸🐻🦊 AI-WEB-GuessingGame

Welcome to the AI-WEB-GuessingGame repository! This project is an interactive web-based guessing game centered on identifying animals. It is developed using Python and Streamlit as part of a university course.

📐 Basic Architecture

The project follows a straightforward architecture:

  1. Backend and Frontend:

    • The web application is created using Streamlit, which handles both the frontend and backend seamlessly.
    • Data with animal information was fetched from the Animals API.
    • Key components:
      • game.py: Contains the main game logic.
      • stats.py: Responsible for visualizing game statistics.
      • utils.py: Includes utility functions, such as calculating user scores.
      • betterAnimalDB/animals.json: DB for animal data.
  2. Game Logic:

    • Users guess animals based on clues provided after each guess. Each clue highlights 1-4 shared characteristics between the guessed and the target animal.
    • The fewer guesses the user takes to identify the animal, the higher their score.
    • The quality of each guess is measured by the number of shared characteristics, with the result visually indicated by clue colors.
    • During the final guess, users can interact with (Open) AI for a hint via a chat feature.
  3. Deployment:

    • The app can be run locally or accessed via Streamlit Cloud (link provided in the repository description).
    • Important: The statistics feature is currently fully functional only when the application is started locally.

⚙️ Requirements

To run the project locally, make sure you have the following installed:

  1. Python

  2. Streamlit

    • Install Streamlit via pip:
      pip install streamlit
  3. Set Up OpenAI API Key

    • Create a folder named .streamlit in your project's root directory.
    • Inside the .streamlit folder, create a file called secrets.toml.
    • Add your OpenAI API key to the secrets.toml file in the following format:
      OPEN-AI-KEY = "your-api-key-here"
    • Replace your-api-key-here with your actual OpenAI API key.
  4. Other Dependencies:

    • Additional libraries are listed in the requirements.txt file.
    • Install them using:
      pip install -r requirements.txt

🛫 Run the project:

streamlit run app.py

About

Task1: Artificial Intelligence and the Web (WiSe 2024/25)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages