28e50b921c
- Added Router_de_agentes.py to manage agent interactions for sales data analysis. - Created Analizador_de_datos_de_ventas.yaml for generating structured text reports from sales data. - Developed Generador_sql_ventas.yaml for generating SQL queries to analyze sales data. - Established Router_de_agente.yaml as a routing mechanism for agent requests. - Compiled centros_disponibles.md listing available sales centers. - Introduced primera_ejecucion_de_un_agente.py as an example for executing agents. - Added ver_los_prompts_de_un_agente.py to inspect prompts sent to OpenAI. - Included service account key for BigQuery access in rag-datasets-reader-sa-key.json. - Defined schema for sales data in Objeto_ventas.json. - Implemented utility functions for querying BigQuery in conseguir_datos_bq.py. - Created data transformation utilities in transformar_datos.py for handling decimal and date formats.
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
# Constantes ##########################################################################
|
|
|
|
PROMPT = "Dame la venta total del centro de velez malaga de marzo de 2023 desglosado por factura"
|
|
|
|
|
|
# Librerias de Agno ################################################################
|
|
|
|
from agno.agent import Agent
|
|
from agno.models.openai import OpenAIChat
|
|
|
|
# Prefect imports ##################################################################
|
|
|
|
from prefect import task, flow
|
|
from prefect.logging import get_run_logger
|
|
from prefect.filesystems import LocalFileSystem
|
|
|
|
local_file_system_block = LocalFileSystem.load("localfile")
|
|
|
|
# Cargar variables de entorno ######################################################
|
|
|
|
import os
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
openai_api_key = os.getenv("OPENAI_API_KEY")
|
|
|
|
|
|
# Imports adicionales #########################################################
|
|
|
|
import traceback
|
|
from uuid import uuid4
|
|
|
|
# Importaciones de Archivos #########################################################
|
|
|
|
from jinja2 import Template
|
|
import yaml
|
|
import json
|
|
|
|
|
|
# Utils ###################################################################################
|
|
|
|
from utils.conseguir_datos_bq import consultar_bigquery_paginado
|
|
from utils.transformar_datos import convertir_decimales
|