INNER CODE UNIT · Python

validate_assets_directory

aadya940/autoresume · app/backend/src/ai/main.py:81

def validate_assets_directory():
    """Cached validation of assets directory."""
    if "assets" not in os.listdir(os.getcwd()):
        raise FileNotFoundError("The 'assets' directory is missing.")


async def append_and_compile(info, file_path, output_dir, prompt=None):
    """Append new content to the LaTeX file and compile it. Handles status updates internally."""

    # Start validation early (cached after first call)
    validate_assets_directory()

    # Concurrent file read and runner init
    current_code_task = asyncio.create_task(asyncio.to_thread(read_file, file_path))
    runner_task = asyncio.create_task(get_runner())
    current_code, runner = await asyncio.gather(current_code_task, runner_task)

    # Prompt construction

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…