mirror of
https://github.com/thecyberlearn/quantum-ai-v2.git
synced 2026-08-18 22:52:59 +00:00
- Create Human Resources category for HR-related agents - Implement Job Posting Generator with 7-field dynamic form - Add specialized N8N webhook message formatting for job postings - Support multiple seniority levels, contract types, and locations - Complete form validation and error handling - Full integration with existing wallet and execution system Form fields: - Job title and company name - Detailed job description (textarea) - Seniority level (entry to executive) - Contract type (full-time, part-time, contract, etc.) - Location with remote work support - Multi-language support Webhook format matches N8N payload structure exactly. Tested and working with real-time wallet deduction. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
130 lines
6.7 KiB
Python
130 lines
6.7 KiB
Python
from django.core.management.base import BaseCommand
|
|
from agents.models import AgentCategory, Agent
|
|
|
|
class Command(BaseCommand):
|
|
help = 'Create job posting generator agent'
|
|
|
|
def handle(self, *args, **options):
|
|
# Get or use existing HR category
|
|
hr_category, created = AgentCategory.objects.get_or_create(
|
|
slug='human-resources',
|
|
defaults={
|
|
'name': 'Human Resources',
|
|
'description': 'AI-powered HR and recruitment tools',
|
|
'icon': '💼'
|
|
}
|
|
)
|
|
|
|
if created:
|
|
self.stdout.write(self.style.SUCCESS(f'Created category: {hr_category.name}'))
|
|
else:
|
|
self.stdout.write(f'Category already exists: {hr_category.name}')
|
|
|
|
# Create Job Posting Generator agent
|
|
job_posting_agent, created = Agent.objects.get_or_create(
|
|
slug='job-posting-generator',
|
|
defaults={
|
|
'name': 'Job Posting Generator',
|
|
'short_description': 'Create professional job postings that attract top talent',
|
|
'description': 'Generate comprehensive and attractive job postings with AI-powered content creation. Perfect for HR teams and recruiters looking to create compelling job descriptions that attract qualified candidates. Supports multiple languages, locations, and contract types.',
|
|
'category': hr_category,
|
|
'price': 10.0,
|
|
'form_schema': {
|
|
'fields': [
|
|
{
|
|
'name': 'job_title',
|
|
'type': 'text',
|
|
'label': 'Job Title',
|
|
'placeholder': 'e.g., Senior Full Stack Developer',
|
|
'required': True,
|
|
'help_text': 'The position title for the job posting'
|
|
},
|
|
{
|
|
'name': 'company_name',
|
|
'type': 'text',
|
|
'label': 'Company Name',
|
|
'placeholder': 'e.g., Quantum Technologies Inc.',
|
|
'required': True,
|
|
'help_text': 'Name of the hiring company'
|
|
},
|
|
{
|
|
'name': 'job_description',
|
|
'type': 'textarea',
|
|
'label': 'Job Description',
|
|
'placeholder': 'Describe the role, responsibilities, and what makes this opportunity exciting...',
|
|
'required': True,
|
|
'rows': 5,
|
|
'help_text': 'Detailed description of the role, responsibilities, and company culture'
|
|
},
|
|
{
|
|
'name': 'seniority_level',
|
|
'type': 'select',
|
|
'label': 'Seniority Level',
|
|
'required': True,
|
|
'options': [
|
|
{'value': '', 'label': 'Select seniority level...'},
|
|
{'value': 'entry', 'label': 'Entry Level'},
|
|
{'value': 'junior', 'label': 'Junior'},
|
|
{'value': 'mid', 'label': 'Mid Level'},
|
|
{'value': 'senior', 'label': 'Senior'},
|
|
{'value': 'lead', 'label': 'Lead'},
|
|
{'value': 'principal', 'label': 'Principal'},
|
|
{'value': 'executive', 'label': 'Executive'}
|
|
],
|
|
'help_text': 'Experience level required for this position'
|
|
},
|
|
{
|
|
'name': 'contract_type',
|
|
'type': 'select',
|
|
'label': 'Contract Type',
|
|
'required': True,
|
|
'options': [
|
|
{'value': '', 'label': 'Select contract type...'},
|
|
{'value': 'full-time', 'label': 'Full-time'},
|
|
{'value': 'part-time', 'label': 'Part-time'},
|
|
{'value': 'contract', 'label': 'Contract'},
|
|
{'value': 'freelance', 'label': 'Freelance'},
|
|
{'value': 'internship', 'label': 'Internship'},
|
|
{'value': 'temporary', 'label': 'Temporary'}
|
|
],
|
|
'help_text': 'Type of employment contract'
|
|
},
|
|
{
|
|
'name': 'location',
|
|
'type': 'text',
|
|
'label': 'Location',
|
|
'placeholder': 'e.g., Dubai, UAE (Remote)',
|
|
'required': True,
|
|
'help_text': 'Job location, include if remote work is available'
|
|
},
|
|
{
|
|
'name': 'language',
|
|
'type': 'select',
|
|
'label': 'Language',
|
|
'required': False,
|
|
'default': 'English',
|
|
'options': [
|
|
{'value': 'English', 'label': 'English'},
|
|
{'value': 'Arabic', 'label': 'Arabic (العربية)'},
|
|
{'value': 'Spanish', 'label': 'Spanish (Español)'},
|
|
{'value': 'French', 'label': 'French (Français)'},
|
|
{'value': 'German', 'label': 'German (Deutsch)'},
|
|
{'value': 'Chinese', 'label': 'Chinese (中文)'}
|
|
],
|
|
'help_text': 'Primary language for the job posting'
|
|
}
|
|
]
|
|
},
|
|
'webhook_url': 'http://localhost:5678/webhook/43f84411-eaaa-488c-9b1f-856e90d0aaf6'
|
|
}
|
|
)
|
|
|
|
if created:
|
|
self.stdout.write(self.style.SUCCESS(f'Created agent: {job_posting_agent.name}'))
|
|
else:
|
|
self.stdout.write(f'Agent already exists: {job_posting_agent.name}')
|
|
|
|
self.stdout.write(self.style.SUCCESS('Job Posting Generator setup completed successfully'))
|
|
self.stdout.write(f'Agent ID: {job_posting_agent.id}')
|
|
self.stdout.write(f'Agent Slug: {job_posting_agent.slug}')
|
|
self.stdout.write(f'Price: {job_posting_agent.price} AED') |