[31388f42] Implement Expert Response Generator with Gemini & CE integration
This commit is contained in:
@@ -5,7 +5,7 @@ import sqlite3
|
||||
|
||||
# Füge das Hauptverzeichnis zum Python-Pfad hinzu, damit der Connector gefunden wird
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
||||
from company_explorer_connector import handle_company_workflow
|
||||
from company_explorer_connector import handle_company_workflow, get_company_details
|
||||
from db import get_leads, DB_PATH
|
||||
|
||||
def update_lead_enrichment(lead_id, data, status):
|
||||
@@ -18,6 +18,26 @@ def update_lead_enrichment(lead_id, data, status):
|
||||
conn.close()
|
||||
print(f"Lead {lead_id} aktualisiert. Neuer Status: {status}")
|
||||
|
||||
def refresh_ce_data(lead_id, ce_id):
|
||||
"""
|
||||
Holt die aktuellsten Daten (inkl. Analyse-Ergebnis) vom Company Explorer
|
||||
und aktualisiert den lokalen Lead.
|
||||
"""
|
||||
print(f"Refreshing data for CE ID {ce_id}...")
|
||||
ce_data = get_company_details(ce_id)
|
||||
|
||||
# Bestehende Enrichment-Daten holen, um nichts zu überschreiben
|
||||
# (Vereinfachung: Wir bauen das dict neu auf)
|
||||
enrichment_data = {
|
||||
"sync_status": "refreshed",
|
||||
"ce_id": ce_id,
|
||||
"message": "Data refreshed from CE",
|
||||
"ce_data": ce_data
|
||||
}
|
||||
|
||||
update_lead_enrichment(lead_id, enrichment_data, status='synced')
|
||||
return ce_data
|
||||
|
||||
def run_sync():
|
||||
"""
|
||||
Haupt-Synchronisationsprozess.
|
||||
|
||||
Reference in New Issue
Block a user