This commit is contained in:
Team3
2026-06-07 11:42:12 +02:00
parent 58fb1b6a56
commit b414d7f464
3 changed files with 10 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
gnupg \
poppler-utils \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g @anthropic-ai/claude-code opencode-ai \

View File

@@ -13,6 +13,7 @@ auth:
install:
pip install --break-system-packages fastapi uvicorn[standard] aiosqlite uv
@which pdftotext >/dev/null 2>&1 || sudo apt-get install -y poppler-utils
cd frontend && npm install
npm install -g opencode-ai
@mkdir -p $(HOME)/.config/opencode

View File

@@ -305,11 +305,15 @@ def _pdfs_konvertieren(project: Path) -> None:
Wird vor jeder Projekt-Generierung aufgerufen; konvertiert nur, wenn die
.txt fehlt oder älter als das PDF ist. Das Original bleibt unangetastet.
Fehlt pdftotext und das Projekt enthält PDFs → harter Fehler statt
unzuverlässigem Direkt-Lese-Modus (MiniMax-Bilderlimit, Vision-Kosten).
"""
if shutil.which("pdftotext") is None:
_log(project.name, "pdftotext nicht installiert — PDFs bleiben unkonvertiert")
pdfs = list(project.rglob("*.pdf"))
if not pdfs:
return
for pdf in project.rglob("*.pdf"):
if shutil.which("pdftotext") is None:
raise RuntimeError("pdftotext fehlt (poppler-utils installieren) — PDFs im Projekt können nicht gelesen werden")
for pdf in pdfs:
txt = pdf.with_suffix(".txt")
if txt.exists() and txt.stat().st_mtime >= pdf.stat().st_mtime:
continue
@@ -317,7 +321,7 @@ def _pdfs_konvertieren(project: Path) -> None:
subprocess.run(["pdftotext", "-layout", str(pdf), str(txt)], check=True, timeout=120)
_log(project.name, f"PDF konvertiert: {pdf.name}{txt.name}")
except Exception as e:
_log(project.name, f"PDF-Konvertierung fehlgeschlagen ({pdf.name}): {e}")
raise RuntimeError(f"PDF-Konvertierung fehlgeschlagen ({pdf.name}): {e}") from e
def _build_recherche_prompt(topic: str, out_path: Path, instructions: str = "", project: Path | None = None) -> str: