Files
rpa_vision_v3/agent_v0/config.py
Dom ae65be2555 chore: ajouter agent_v0/ au tracking git (était un repo embarqué)
Suppression du .git embarqué dans agent_v0/ — le code est maintenant
tracké normalement dans le repo principal.
Inclut : agent_v1 (client), server_v1 (streaming), lea_ui (chat client)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 11:12:23 +01:00

59 lines
1.7 KiB
Python

# config.py
"""
Configuration de base pour agent_v0.
"""
from __future__ import annotations
import os
from pathlib import Path
AGENT_VERSION = "0.1.0"
# Dossier racine du projet (là où se trouve ce fichier)
BASE_DIR = Path(__file__).resolve().parent
# Chargement automatique de .env.local depuis le répertoire parent
def load_env_file(env_path):
"""Charge un fichier .env dans les variables d'environnement"""
if not env_path.exists():
return False
with open(env_path, 'r') as f:
for line in f:
line = line.strip()
if line and not line.startswith('#') and '=' in line:
key, value = line.split('=', 1)
os.environ[key.strip()] = value.strip()
return True
# Charger .env.local depuis le répertoire parent (racine du projet)
env_local_path = BASE_DIR.parent / ".env.local"
if load_env_file(env_local_path):
print(f"[agent_v0] Variables d'environnement chargées depuis {env_local_path}")
# Endpoint du serveur RPA Vision V3
# En développement local : http://localhost:8000/api/traces/upload
# En production : configurer via variable d'environnement
import os
SERVER_URL = os.getenv("RPA_SERVER_URL", "http://localhost:8000/api/traces/upload")
# Durée max d'une session en secondes (ex: 30 minutes)
MAX_SESSION_DURATION_S = 30 * 60
# Dossier racine local où stocker les sessions (chemin ABSOLU)
SESSIONS_ROOT = str(BASE_DIR / "sessions")
# Dossier et fichier de logs
LOGS_DIR = BASE_DIR / "logs"
LOG_FILE = LOGS_DIR / "agent_v0.log"
# Faut-il quitter l'application après un Stop session ?
EXIT_AFTER_SESSION = True
# Création des dossiers si besoin
os.makedirs(SESSIONS_ROOT, exist_ok=True)
os.makedirs(LOGS_DIR, exist_ok=True)