Skip to content

Python script to automate the process of solving Szkopuł problems by utilizing Artificial Intelligence

License

Notifications You must be signed in to change notification settings

Kamix-08/szkopul-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

szkopul-solver

GitHub License

This Python script automates the process of solving problems from Szkopuł

git clone https://github.com/Kamix-08/szkopul-solver
cd szkopul-solver

Features

  • Task scraping: automatically extracts task details from Szkopuł
  • AI integration: utilizes Groq to process and solve tasks
  • Code submission: formats the solutions into a .cpp file and submits them back to Szkopuł

Prerequisites

Before executing the script, install the dependencies, by running

pip install -r requirements.txt

The dependencies include:

  • groq>=0.9.0
  • bs4>=0.0.2
  • requests>=2.31.0
  • PyPDF2>=3.0.1

Configuration

Modify the config.json file to include your credentials and configuration:

{
    "GROQ_API_KEY": "foo",
    "SZKOPUL_API_KEY": "bar",
    "AI_MODEL": "baz"
}

API Tokens

All of the necessary API Tokens are free.

Groq:
https://console.groq.com/keys

Szkopul:
https://szkopul.edu.pl/api/token

Configuration

You can find aviable AI models here:
https://console.groq.com/docs/models

In the config.json file, set the value of AI_MODEL to the Model ID of AI of you choosing.

Example:

"AI_MODEL": "llama3-8b-8192"

Problems

Szkopul uses images to render some of the text, such as 2^n in this example:

Example of incorrectly rendered text

The script cannot process those images, so the user will be prompted to input the text from those images manually:

[?] Input the text seen on the LaTeX image #1: 

On top of that, the script can only process problems from public contest, such as zLO155, while not being able to process private contests (contest, that require authorization to access), such as PIWO 2019/20.

Contributions

Contributions are welcome! If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Python script to automate the process of solving Szkopuł problems by utilizing Artificial Intelligence

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages