chore: Remove obsolete build and GUI files, and introduce a new Docker Compose setup for microservices architecture. This change streamlines the project structure by eliminating legacy scripts and integrating a PostgreSQL database service alongside extraction and cleaning services.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
"""Perfiles de extracción.
|
||||
|
||||
Define configuraciones por tipo de documento para guiar prompts, envoltura
|
||||
de resultados y agregaciones especiales en CSV.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Dict, List, Optional, TypedDict
|
||||
|
||||
|
||||
class Profile(TypedDict, total=False):
|
||||
name: str
|
||||
wrap_root: Optional[str]
|
||||
default_instruction: str
|
||||
aggregate_list_paths: List[str]
|
||||
|
||||
|
||||
DEFAULT_INVOICE_INSTRUCTION = (
|
||||
"Extrae los datos de la factura a un JSON, identificando la tabla principal por sus columnas (código, cantidad, valor unitario) "
|
||||
"para crear un array con la clave fija 'items', y usando las etiquetas literales del documento como claves para el resto de la información. "
|
||||
"Si el documento muestra una línea o bloque de texto bajo una etiqueta como «Observación:», «Observaciones» o equivalente, "
|
||||
"inclúyelo en el JSON con la misma clave que refleje el documento (respeta mayúsculas, tildes y singular/plural tal como aparezcan). "
|
||||
"Ten especial cuidado en no confundir el número de autorización con el código."
|
||||
)
|
||||
|
||||
|
||||
PROFILES: Dict[str, Profile] = {
|
||||
"invoice": {
|
||||
"name": "invoice",
|
||||
"wrap_root": None,
|
||||
"default_instruction": DEFAULT_INVOICE_INSTRUCTION,
|
||||
"aggregate_list_paths": [],
|
||||
},
|
||||
}
|
||||
|
||||
def get_profile(name: str) -> Profile:
|
||||
key = (name or "invoice").lower()
|
||||
return PROFILES.get(key, PROFILES["invoice"]) # por defecto factura
|
||||
Reference in New Issue
Block a user