⚡️ Describe the Bug
Running the application via the make exec command crashes immediately upon startup with a NameError: name 'Union' is not defined. This occurs because Union is used for type hinting the pdf_form_path parameter in the run_pdf_fill_process function signature in src/main.py, but the module is never imported.
👣 Steps to Reproduce
- Ensure the Docker containers are running (
docker compose up -d).
- Run the command
make exec (or docker compose exec app python3 src/main.py) in the terminal.
- See the
NameError crash output immediately.
📉 Expected Behavior
The application should start successfully, detect the PDF, and begin the extraction/filling process without throwing Python standard library import errors.
🖥️ Environment Information
- OS: Windows / WSL 2 (Ubuntu)
- Docker/Compose Version: Docker Desktop latest
- Ollama Model used: Mistral
📸 Screenshots/Logs
Traceback (most recent call last):
File "/app/src/main.py", line 14, in <module>
def run_pdf_fill_process(user_input: str, definitions: list, pdf_form_path: Union[str, os.PathLike]):
^^^^^
NameError: name 'Union' is not defined
🕵️ Possible Fix
Add the missing import statement from the standard typing library at the top of src/main.py:
⚡️ Describe the Bug
Running the application via the
make execcommand crashes immediately upon startup with aNameError: name 'Union' is not defined. This occurs becauseUnionis used for type hinting thepdf_form_pathparameter in therun_pdf_fill_processfunction signature insrc/main.py, but the module is never imported.👣 Steps to Reproduce
docker compose up -d).make exec(ordocker compose exec app python3 src/main.py) in the terminal.NameErrorcrash output immediately.📉 Expected Behavior
The application should start successfully, detect the PDF, and begin the extraction/filling process without throwing Python standard library import errors.
🖥️ Environment Information
📸 Screenshots/Logs
🕵️ Possible Fix
Add the missing import statement from the standard typing library at the top of src/main.py: