mirror of
https://github.com/thecyberlearn/quantum-ai-v3.git
synced 2026-08-18 15:52:58 +00:00
- Create AGENT_CREATION_GUIDE.md with complete step-by-step instructions - Add agent_template_prototype.html with full CSS framework and JavaScript utilities - Implement Email Writer agent as demonstration of template system - Update CLAUDE.md with agent creation workflow and template guidance - Include Django patterns, form handling, status polling, and marketplace integration - Provide reusable components: wallet card, processing status, quick access panel - Ensure responsive design, accessibility, and consistent user experience 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
90 lines
2.7 KiB
Python
90 lines
2.7 KiB
Python
from django.db import models
|
|
from django.contrib.auth import get_user_model
|
|
import uuid
|
|
|
|
User = get_user_model()
|
|
|
|
|
|
class EmailWriterRequest(models.Model):
|
|
"""Email Writer agent request model"""
|
|
|
|
# Base request fields
|
|
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
|
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
|
status = models.CharField(max_length=20, choices=[
|
|
('pending', 'Pending'),
|
|
('processing', 'Processing'),
|
|
('completed', 'Completed'),
|
|
('failed', 'Failed'),
|
|
], default='pending')
|
|
cost = models.DecimalField(max_digits=10, decimal_places=2, default=3.00)
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
processed_at = models.DateTimeField(null=True, blank=True)
|
|
|
|
# Email content fields
|
|
email_type = models.CharField(
|
|
max_length=50,
|
|
choices=[
|
|
('business', 'Business Email'),
|
|
('follow_up', 'Follow-up Email'),
|
|
('complaint', 'Complaint Email'),
|
|
('thank_you', 'Thank You Email'),
|
|
('introduction', 'Introduction Email'),
|
|
('meeting_request', 'Meeting Request'),
|
|
('apology', 'Apology Email'),
|
|
('announcement', 'Announcement'),
|
|
],
|
|
help_text="Type of email to generate"
|
|
)
|
|
|
|
recipient = models.CharField(
|
|
max_length=200,
|
|
help_text="Who the email is being sent to"
|
|
)
|
|
|
|
subject = models.CharField(
|
|
max_length=200,
|
|
blank=True,
|
|
help_text="Email subject (optional - can be auto-generated)"
|
|
)
|
|
|
|
main_message = models.TextField(
|
|
help_text="Main content/purpose of the email"
|
|
)
|
|
|
|
tone = models.CharField(
|
|
max_length=30,
|
|
choices=[
|
|
('professional', 'Professional'),
|
|
('friendly', 'Friendly'),
|
|
('formal', 'Formal'),
|
|
('casual', 'Casual'),
|
|
],
|
|
default='professional',
|
|
help_text="Tone of the email"
|
|
)
|
|
|
|
length = models.CharField(
|
|
max_length=20,
|
|
choices=[
|
|
('short', 'Short (1-2 paragraphs)'),
|
|
('medium', 'Medium (3-4 paragraphs)'),
|
|
('long', 'Long (5+ paragraphs)'),
|
|
],
|
|
default='medium',
|
|
help_text="Desired length of the email"
|
|
)
|
|
|
|
# Result fields
|
|
email_content = models.TextField(
|
|
blank=True,
|
|
help_text="Generated email content"
|
|
)
|
|
|
|
class Meta:
|
|
verbose_name = "Email Writer Request"
|
|
verbose_name_plural = "Email Writer Requests"
|
|
ordering = ['-created_at']
|
|
|
|
def __str__(self):
|
|
return f"Email Writer - {self.email_type} for {self.recipient}" |