From a785b29494031309f7eb272b8cafc3ded1689753 Mon Sep 17 00:00:00 2001 From: Carl Furtado Date: Mon, 24 Aug 2026 09:19:51 -0400 Subject: [PATCH] add visual search custom image instructions --- README.md | 2 ++ src/rewards_tasks.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e1bfb2..b88b506 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ cp /path/to/my_amazing_wordlist.txt nouns.txt You should also have an Ollama account created (for the LLM), the `ollama` tool installed, and you should have signed in to the Ollama CLI via the command line using `ollama signin`. This project will use a minimal amount of Ollama cloud usage using `gemma4:cloud`. If you wish to use a different model, please change the `model` parameter in the `get_ollama_response` function in `src/llm_utils.py`. +You must also provide an image for the script to upload to complete the visual search task. Currently, this image is named `keypress_times.png` and is located in the root directory of the project (yes, I used a random image from my keyboard analysis to do this). You may provide an image of your own, just ensure that the absolute path of the image is placed in the `VISUAL_SEARCH_IMAGE_PATH` constant at the top of `rewards_tasks.py`. + Activate the virtual environment & install dependencies (you may have to use `python -m poetry` instead of `poetry`). You must have Python 3.14+ and Poetry installed. diff --git a/src/rewards_tasks.py b/src/rewards_tasks.py index 1170bd2..1bdeeec 100644 --- a/src/rewards_tasks.py +++ b/src/rewards_tasks.py @@ -15,6 +15,8 @@ import mouse_trajectory import mimic_typing import element_selectors +VISUAL_SEARCH_IMAGE_PATH = os.path.abspath("keypress_times.png") + class RewardsTaskUtils: def __init__(self, driver: webdriver.Edge): self.driver = driver @@ -119,7 +121,7 @@ class RewardsTaskUtils: file_input = self.wait_for_element(self.elements.get_visual_search_file_input) - file_input.send_keys(os.path.abspath("keypress_times.png")) + file_input.send_keys(VISUAL_SEARCH_IMAGE_PATH) time.sleep(random.uniform(3, 5))