remaining stage 1

This commit is contained in:
alorig
2025-11-19 20:53:29 +05:00
parent b5cc262f04
commit 4ca85ae0e5
4 changed files with 86 additions and 32 deletions

View File

@@ -52,12 +52,26 @@ 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