imp part 5
This commit is contained in:
@@ -26,17 +26,7 @@ class ContentValidationService:
|
||||
"""
|
||||
errors = []
|
||||
|
||||
# Stage 3: Enforce "no cluster, no task" rule when feature flag enabled
|
||||
from django.conf import settings
|
||||
if getattr(settings, 'USE_SITE_BUILDER_REFACTOR', False):
|
||||
if not task.cluster:
|
||||
errors.append({
|
||||
'field': 'cluster',
|
||||
'code': 'missing_cluster',
|
||||
'message': 'Task must be associated with a cluster before content generation',
|
||||
})
|
||||
|
||||
# Stage 3: Validate entity_type is set
|
||||
# Validate entity_type is set
|
||||
if not task.content_type:
|
||||
errors.append({
|
||||
'field': 'content_type',
|
||||
|
||||
@@ -52,26 +52,12 @@ class ClusteringService:
|
||||
|
||||
# Delegate to AI task
|
||||
from igny8_core.ai.tasks import run_ai_task
|
||||
from django.conf import settings
|
||||
|
||||
payload = {
|
||||
'ids': keyword_ids,
|
||||
'sector_id': sector_id
|
||||
}
|
||||
|
||||
# Stage 1: When USE_SITE_BUILDER_REFACTOR is enabled, payload can include
|
||||
# taxonomy hints and dimension metadata for enhanced clustering.
|
||||
# TODO (Stage 2/3): Enhance clustering to collect and use:
|
||||
# - Taxonomy hints from SiteBlueprintTaxonomy
|
||||
# - Dimension metadata (context_type, dimension_meta) for clusters
|
||||
# - Attribute values from Keywords.attribute_values
|
||||
if getattr(settings, 'USE_SITE_BUILDER_REFACTOR', False):
|
||||
logger.info(
|
||||
f"Clustering with refactor enabled: {len(keyword_ids)} keywords, "
|
||||
f"sector_id={sector_id}, account_id={account.id}"
|
||||
)
|
||||
# Future: Add taxonomy hints and dimension metadata to payload
|
||||
|
||||
try:
|
||||
if hasattr(run_ai_task, 'delay'):
|
||||
# Celery available - queue async
|
||||
|
||||
Reference in New Issue
Block a user