INNER CODE UNIT · Python
append_and_compile
aadya940/autoresume · app/backend/src/ai/main.py:87
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
if prompt is None:
prompt = build_generic_prompt(info, current_code)
# Get LLM response
llm_response = await get_llm_response(prompt, runner)
cleaned_response = clean_latex_block(llm_response)