ALwrity version 0.5.4
This commit is contained in:
@@ -942,13 +942,17 @@ class EnhancedStrategyService:
|
||||
# Transform data into frontend-expected format
|
||||
auto_populated_fields = self._transform_onboarding_data_to_fields(processed_data)
|
||||
|
||||
# Add detailed input data points for transparency
|
||||
input_data_points = self._get_detailed_input_data_points(processed_data)
|
||||
|
||||
logger.info(f"Retrieved comprehensive onboarding data for user {user_id}")
|
||||
return {
|
||||
'fields': auto_populated_fields,
|
||||
'sources': self._get_data_sources(processed_data),
|
||||
'quality_scores': processed_data['data_quality_scores'],
|
||||
'confidence_levels': processed_data['confidence_levels'],
|
||||
'data_freshness': processed_data['data_freshness']
|
||||
'data_freshness': processed_data['data_freshness'],
|
||||
'input_data_points': input_data_points # Add detailed input data
|
||||
}
|
||||
|
||||
finally:
|
||||
@@ -2442,4 +2446,87 @@ class EnhancedStrategyService:
|
||||
'quality_scores': {},
|
||||
'confidence_levels': {},
|
||||
'data_freshness': {'status': 'unknown', 'age_days': 'unknown'}
|
||||
}
|
||||
}
|
||||
|
||||
def _get_detailed_input_data_points(self, processed_data: Dict[str, Any]) -> Dict[str, Any]:
|
||||
"""Get detailed input data points that were used to generate each field"""
|
||||
input_data_points = {}
|
||||
|
||||
website_data = processed_data.get('website_analysis', {})
|
||||
research_data = processed_data.get('research_preferences', {})
|
||||
api_data = processed_data.get('api_keys_data', {})
|
||||
|
||||
# Business Objectives - from website analysis
|
||||
if website_data:
|
||||
input_data_points['business_objectives'] = {
|
||||
'website_content': website_data.get('content_goals', 'Not available'),
|
||||
'meta_description': website_data.get('meta_description', 'Not available'),
|
||||
'about_page': website_data.get('about_page_content', 'Not available'),
|
||||
'page_title': website_data.get('page_title', 'Not available'),
|
||||
'content_analysis': website_data.get('content_analysis', {})
|
||||
}
|
||||
|
||||
# Target Metrics - from research preferences and industry analysis
|
||||
if research_data:
|
||||
input_data_points['target_metrics'] = {
|
||||
'research_preferences': research_data.get('target_audience', 'Not available'),
|
||||
'industry_benchmarks': research_data.get('industry_benchmarks', 'Not available'),
|
||||
'competitor_analysis': research_data.get('competitor_analysis', 'Not available'),
|
||||
'market_research': research_data.get('market_research', 'Not available')
|
||||
}
|
||||
|
||||
# Content Preferences - from research preferences
|
||||
if research_data:
|
||||
input_data_points['content_preferences'] = {
|
||||
'user_preferences': research_data.get('content_types', 'Not available'),
|
||||
'industry_trends': research_data.get('industry_trends', 'Not available'),
|
||||
'consumption_patterns': research_data.get('consumption_patterns', 'Not available'),
|
||||
'audience_research': research_data.get('audience_research', 'Not available')
|
||||
}
|
||||
|
||||
# Preferred Formats - from website analysis and research
|
||||
if website_data or research_data:
|
||||
input_data_points['preferred_formats'] = {
|
||||
'existing_content': website_data.get('existing_content_types', 'Not available'),
|
||||
'engagement_metrics': website_data.get('engagement_metrics', 'Not available'),
|
||||
'platform_analysis': research_data.get('platform_preferences', 'Not available'),
|
||||
'content_performance': website_data.get('content_performance', 'Not available')
|
||||
}
|
||||
|
||||
# Content Frequency - from research preferences
|
||||
if research_data:
|
||||
input_data_points['content_frequency'] = {
|
||||
'audience_research': research_data.get('content_frequency_preferences', 'Not available'),
|
||||
'industry_standards': research_data.get('industry_frequency', 'Not available'),
|
||||
'competitor_frequency': research_data.get('competitor_frequency', 'Not available'),
|
||||
'optimal_timing': research_data.get('optimal_timing', 'Not available')
|
||||
}
|
||||
|
||||
# Content Budget - from website analysis and industry standards
|
||||
if website_data:
|
||||
input_data_points['content_budget'] = {
|
||||
'website_analysis': website_data.get('budget_indicators', 'Not available'),
|
||||
'industry_standards': website_data.get('industry_budget', 'Not available'),
|
||||
'company_size': website_data.get('company_size', 'Not available'),
|
||||
'market_position': website_data.get('market_position', 'Not available')
|
||||
}
|
||||
|
||||
# Team Size - from website analysis and company profile
|
||||
if website_data:
|
||||
input_data_points['team_size'] = {
|
||||
'company_profile': website_data.get('company_profile', 'Not available'),
|
||||
'content_volume': website_data.get('content_volume', 'Not available'),
|
||||
'industry_standards': website_data.get('industry_team_size', 'Not available'),
|
||||
'budget_constraints': website_data.get('budget_constraints', 'Not available')
|
||||
}
|
||||
|
||||
# Implementation Timeline - from research and industry analysis
|
||||
if research_data:
|
||||
input_data_points['implementation_timeline'] = {
|
||||
'project_scope': research_data.get('project_scope', 'Not available'),
|
||||
'resource_availability': research_data.get('resource_availability', 'Not available'),
|
||||
'industry_timeline': research_data.get('industry_timeline', 'Not available'),
|
||||
'complexity_assessment': research_data.get('complexity_assessment', 'Not available')
|
||||
}
|
||||
|
||||
return input_data_points
|
||||
Reference in New Issue
Block a user