Add AI insights feature

This commit is contained in:
Urtzi Alfaro
2025-12-15 21:14:22 +01:00
parent 5642b5a0c0
commit c566967bea
39 changed files with 17729 additions and 404 deletions

View File

@@ -344,7 +344,7 @@ async def generate_batch_forecast(
return BatchForecastResponse(
id=str(uuid.uuid4()),
tenant_id=tenant_id,
batch_name=getattr(request, 'batch_name', f"orchestrator-batch-{datetime.now().strftime('%Y%m%d')}"),
batch_name=request.batch_name,
status="completed",
total_products=0,
completed_products=0,
@@ -358,8 +358,8 @@ async def generate_batch_forecast(
# IMPROVEMENT: For large batches (>5 products), use background task
# For small batches, execute synchronously for immediate results
batch_name = getattr(request, 'batch_name', f"batch-{datetime.now().strftime('%Y%m%d_%H%M%S')}")
forecast_days = getattr(request, 'forecast_days', 7)
batch_name = request.batch_name
forecast_days = request.forecast_days
# Create batch record first
batch_id = str(uuid.uuid4())