A simple script to query Gemini for cycling workouts and then post them to Intervals.icu.
To get started, you need to put a Gemini API passcode, an intervals.icu API code, and your intervals.icu Athlete ID in the .secrets.json file, following the format in (secrets_example.json)[configs/secrets_example.json].
Your athlete ID and API key for intervals.icu are in Settings/Developer Settings.
Gemimi can tell you how to find your API code. You may need to enter payment info in your account even if you use the free version.
The default prompt (probably still needs improvement) is (here)[configs/prompts/default.txt]. You can also make your own and specify it in the script with -p
The prompt is supplemented by additional info, including the goals (also specified as a CL argument).
The easiest way to run is from a python venv:
python3 -m venv env
. env/bin/activate
pip install -r requirements.txt
An example command is
python3 query_and_post.py -g config/goals/LaClassique2025.txt --debug --constraints "I am available for a 2 hour ride Wednesday, a 3 hour ride Friday, a 4 hour ride Saturday, and a 1 hour ride Monday. I am not available to ride other days"