Files
talia_bot/talia_bot/webhook_client.py
google-labs-jules[bot] 269be771f7 feat: Enhance sales flow with updated services and RAG
This commit improves the conversational sales flow by:

1.  **Updating the Knowledge Base:**
    *   Replaces the content of `talia_bot/data/services.json` with the new, more detailed list of services provided by the user.

2.  **Improving RAG Intelligence:**
    *   Enhances the `generate_sales_pitch` function in `sales_rag.py` to include `work_examples` in the prompt sent to the LLM. This provides more context and enables the generation of more specific and persuasive sales pitches.

3.  **Refining Conversational Tone:**
    *   Adjusts the text in the `client_sales_funnel.json` flow to be more professional and direct.
    *   Updates the industry options in the flow to align with the new service categories.
2025-12-21 09:33:42 +00:00

34 lines
1.2 KiB
Python

# app/webhook_client.py
# Este script se encarga de enviar datos a servicios externos usando "webhooks".
# En este caso, se comunica con n8n.
import requests
from talia_bot.config import N8N_WEBHOOK_URL, N8N_TEST_WEBHOOK_URL
def send_webhook(event_data):
"""
Envía datos de un evento al servicio n8n.
Usa el webhook normal y, si falla o no existe, usa el de test como fallback.
"""
# Intentar con el webhook principal
if N8N_WEBHOOK_URL:
try:
print(f"Intentando enviar a webhook principal: {N8N_WEBHOOK_URL}")
response = requests.post(N8N_WEBHOOK_URL, json=event_data)
response.raise_for_status()
return response.json()
except Exception as e:
print(f"Fallo en webhook principal: {e}")
# Fallback al webhook de test
if N8N_TEST_WEBHOOK_URL:
try:
print(f"Intentando enviar a webhook de fallback (test): {N8N_TEST_WEBHOOK_URL}")
response = requests.post(N8N_TEST_WEBHOOK_URL, json=event_data)
response.raise_for_status()
return response.json()
except Exception as e:
print(f"Fallo en webhook de fallback: {e}")
return None