quantum-ai-v2/workflows/config/agents.py
Claude 511c78b0a1 🔧 Complete data analyzer webhook integration and file upload
- Added data-analyzer configuration to agents.py with webhook URL
- Implemented comprehensive file upload to N8N webhook in views.py
- Added send_file_to_webhook() function with proper error handling
- Fixed JSON serialization by separating file objects from form data
- Added AJAX response handling for real-time results display
- Enhanced debugging and logging throughout the pipeline
- Updated documentation via auto-update system

Fixes file upload issue where PDFs weren't reaching the webhook endpoint.
Now supports end-to-end data analysis with proper balance deduction.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 22:35:24 +05:30

91 lines
2.9 KiB
Python

"""
Simplified agent configuration system for unified workflows app.
Each agent is defined by essential metadata only - forms are handled in individual templates.
"""
AGENT_CONFIGS = {
'social-ads-generator': {
'name': 'Social Ads Generator',
'description': 'Create engaging social media advertisements with AI-powered content generation',
'category': 'marketing',
'price': 5.0,
'icon': '📱',
'webhook_url': 'http://localhost:5678/webhook/2dc234d8-7217-454a-83e9-81afe5b4fe2d',
},
'job-posting-generator': {
'name': 'Job Posting Generator',
'description': 'Create professional job postings that attract top talent',
'category': 'content',
'price': 4.0,
'icon': '💼',
'webhook_url': 'http://localhost:5678/webhook/job-posting-webhook-id',
},
'five-whys-analyzer': {
'name': 'Five Whys Analyzer',
'description': 'Perform root cause analysis using the Five Whys methodology',
'category': 'analytics',
'price': 2.5,
'icon': '🔍',
'webhook_url': 'http://localhost:5678/webhook/five-whys-webhook-id',
},
'weather-reporter': {
'name': 'Weather Reporter',
'description': 'Get detailed weather reports and forecasts for any location',
'category': 'utilities',
'price': 1.0,
'icon': '🌤️',
'webhook_url': 'http://localhost:5678/webhook/weather-webhook-id',
},
'template-demo': {
'name': 'Template Demo',
'description': 'Demo of the fixed agent template starter with all enhancements',
'category': 'demo',
'price': 0.5,
'icon': '🎯',
'webhook_url': 'http://localhost:5678/webhook/template-demo',
},
'data-analyzer': {
'name': 'Data Analyzer',
'description': 'AI-powered analysis of your data files with comprehensive insights',
'category': 'analytics',
'price': 8.0,
'icon': '📊',
'webhook_url': 'http://localhost:5678/webhook/simple-pdf-processor',
}
}
def get_agent_config(agent_slug):
"""Get agent configuration by slug"""
return AGENT_CONFIGS.get(agent_slug)
def get_all_agents():
"""Get all available agent configurations"""
return AGENT_CONFIGS
def get_available_agents():
"""Get all agents formatted for navigation components"""
return {
slug: {
'name': config['name'],
'icon': config['icon'],
'description': config['description']
}
for slug, config in AGENT_CONFIGS.items()
}
def format_message_for_n8n(agent_slug, form_data):
"""Format form data into message for N8N webhook"""
config = get_agent_config(agent_slug)
if not config:
return None
# Simple format - just send the form data as is
return f"Process {config['name']} request: {str(form_data)}"