feat: ajout viewer Flask CIM-10 avec config Ollama centralisée et chronométrage

Ajoute une interface web Flask pour visualiser les dossiers médicaux CIM-10,
avec temps de traitement par PDF, sélecteur de modèle Ollama, et centralisation
de la config Ollama dans src/config.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
dom
2026-02-10 20:11:07 +01:00
parent fc68fc6f6b
commit 037d255aa0
10 changed files with 721 additions and 7 deletions

View File

@@ -8,15 +8,10 @@ from typing import Optional
import requests
from ..config import Diagnostic, DossierMedical, RAGSource
from ..config import Diagnostic, DossierMedical, RAGSource, OLLAMA_URL, OLLAMA_MODEL, OLLAMA_TIMEOUT
logger = logging.getLogger(__name__)
# Configuration Ollama
OLLAMA_URL = "http://localhost:11434/api/generate"
OLLAMA_MODEL = "mistral-small3.2:24b"
OLLAMA_TIMEOUT = 120 # secondes
# Singleton pour le modèle d'embedding (chargé une seule fois)
_embed_model = None
@@ -107,7 +102,7 @@ def _call_ollama(prompt: str) -> dict | None:
"""Appelle Ollama et parse la réponse JSON."""
try:
response = requests.post(
OLLAMA_URL,
f"{OLLAMA_URL}/api/generate",
json={
"model": OLLAMA_MODEL,
"prompt": prompt,