File size: 453 Bytes
463f868
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import os
import sys


def setup_paths():
    """Add project root to sys.path to ensure imports work correctly."""
    # Assume this file is in <root>/ai/
    current_dir = os.path.dirname(os.path.abspath(__file__))
    project_root = os.path.dirname(current_dir)

    if project_root not in sys.path:
        sys.path.insert(0, project_root)


if __name__ == "__main__":
    setup_paths()
    print(f"Added {sys.path[0]} to sys.path")