Feat: Agregar agente Groq con integración RAG
- Nuevo módulo groq_agent.py para consultas a la API de Groq - Panel de administración en /groq para configurar API key, modelo y prompt - Comando /rag en Discord y Telegram para consultar el RAG - Sistema de prompt personalizable guardado en base de datos - Soporte para variables de entorno en Docker - Fix: starlette version para evitar bug con Jinja2
This commit is contained in:
@@ -45,6 +45,11 @@ def load_config(config_path: str = None) -> dict:
|
||||
{"code": "it", "name": "Italiano"},
|
||||
{"code": "pt", "name": "Português"}
|
||||
]
|
||||
},
|
||||
"groq": {
|
||||
"api_key": "",
|
||||
"model": "llama-3.3-70b-versatile",
|
||||
"rag_url": "http://localhost:8004"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +79,9 @@ def load_config(config_path: str = None) -> dict:
|
||||
"DB_USER": ("database", "user"),
|
||||
"DB_PASSWORD": ("database", "password"),
|
||||
"DB_NAME": ("database", "name"),
|
||||
"GROQ_API_KEY": ("groq", "api_key"),
|
||||
"GROQ_MODEL": ("groq", "model"),
|
||||
"RAG_API_URL": ("groq", "rag_url"),
|
||||
}
|
||||
|
||||
for env_key, (section, key, *transform) in env_mappings.items():
|
||||
@@ -122,3 +130,15 @@ def get_db_type() -> str:
|
||||
|
||||
def get_web_config() -> dict:
|
||||
return get_config().get("web", {})
|
||||
|
||||
def get_groq_config() -> dict:
|
||||
return get_config().get("groq", {})
|
||||
|
||||
def get_groq_api_key() -> str:
|
||||
return get_config().get("groq", {}).get("api_key", "")
|
||||
|
||||
def get_groq_model() -> str:
|
||||
return get_config().get("groq", {}).get("model", "llama-3.3-70b-versatile")
|
||||
|
||||
def get_groq_rag_url() -> str:
|
||||
return get_config().get("groq", {}).get("rag_url", "http://localhost:8004")
|
||||
|
||||
Reference in New Issue
Block a user