feat: Update default models for extraction and normalization to GPT-5.6 Luna across configuration files and documentation. Remove deprecated code and improve pricing details in the UI components. Add tests to ensure correct model settings and pricing calculations.
This commit is contained in:
@@ -53,9 +53,6 @@ class EventBus:
|
||||
for cb in self.callbacks:
|
||||
cb(event)
|
||||
|
||||
def add_callback(self, callback: EventCallback) -> None:
|
||||
self.callbacks.append(callback)
|
||||
|
||||
def close(self) -> None:
|
||||
if self.jsonl_logger is not None:
|
||||
self.jsonl_logger.close()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
from typing import Callable, Optional, Tuple
|
||||
from typing import Callable, Tuple
|
||||
|
||||
from selenium import webdriver
|
||||
from selenium.common.exceptions import (
|
||||
|
||||
@@ -45,16 +45,3 @@ class FileManager:
|
||||
os.replace(archivo_temp, ruta_final)
|
||||
except Exception:
|
||||
os.rename(archivo_temp, ruta_final)
|
||||
|
||||
def remove_safe(self, ruta: str) -> None:
|
||||
try:
|
||||
if ruta and os.path.exists(ruta):
|
||||
os.remove(ruta)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def list_pdfs(self) -> set:
|
||||
return {
|
||||
f for f in os.listdir(self.carpeta_descarga)
|
||||
if f.lower().endswith(".pdf")
|
||||
}
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from bot_descarga.audit.events import BotEvent, EventType
|
||||
|
||||
|
||||
class ProgressTracker:
|
||||
"""Traduce BotEvent a contadores de progreso para la UI."""
|
||||
|
||||
def __init__(self):
|
||||
self.total = 0
|
||||
self.procesados = 0
|
||||
self.exitosos = 0
|
||||
self.fallidos = 0
|
||||
self.skipped = 0
|
||||
self.nit_actual = "—"
|
||||
self.nit_estado = "Esperando inicio del proceso..."
|
||||
|
||||
def reset(self) -> None:
|
||||
self.total = 0
|
||||
self.procesados = 0
|
||||
self.exitosos = 0
|
||||
self.fallidos = 0
|
||||
self.skipped = 0
|
||||
self.nit_actual = "—"
|
||||
self.nit_estado = "Esperando inicio del proceso..."
|
||||
|
||||
def handle(self, event: BotEvent) -> None:
|
||||
if event.index is not None and event.total is not None:
|
||||
self.procesados = event.index
|
||||
self.total = event.total
|
||||
|
||||
if event.event_type == EventType.RUN_STARTED:
|
||||
if "total" in event.metadata:
|
||||
self.total = int(event.metadata["total"])
|
||||
elif event.total is not None:
|
||||
self.total = event.total
|
||||
|
||||
elif event.event_type == EventType.NIT_STARTED:
|
||||
self.nit_actual = event.nit or "—"
|
||||
self.nit_estado = "Procesando radicados de este NIT..."
|
||||
|
||||
elif event.event_type == EventType.NIT_FINISHED:
|
||||
nit = event.nit or ""
|
||||
meta = event.metadata
|
||||
self.nit_estado = (
|
||||
f"Finalizó NIT {nit} | "
|
||||
f"OK: {meta.get('ok', 0)} | "
|
||||
f"Fallidos: {meta.get('fallidos', 0)} | "
|
||||
f"Ya existían: {meta.get('omitidos', 0)}"
|
||||
)
|
||||
|
||||
elif event.event_type == EventType.RADICADO_SAVED:
|
||||
self.exitosos += 1
|
||||
|
||||
elif event.event_type == EventType.RADICADO_SKIPPED:
|
||||
self.skipped += 1
|
||||
|
||||
elif event.event_type == EventType.RADICADO_FAILED:
|
||||
if "PROCESO TERMINADO" not in event.message:
|
||||
self.fallidos += 1
|
||||
|
||||
@property
|
||||
def percent(self) -> float:
|
||||
total = self.total if self.total > 0 else 1
|
||||
return min(self.procesados / total, 1.0)
|
||||
Reference in New Issue
Block a user