Upload core/models.py with huggingface_hub
Browse files- core/models.py +48 -0
core/models.py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pydantic import BaseModel
|
| 2 |
+
from typing import Dict, List, Optional, Any
|
| 3 |
+
import uuid
|
| 4 |
+
from datetime import datetime
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class AgentConfig(BaseModel):
|
| 8 |
+
"""Configuration for an individual agent"""
|
| 9 |
+
name: str
|
| 10 |
+
enabled: bool = True
|
| 11 |
+
max_iterations: int = 10
|
| 12 |
+
timeout_seconds: int = 300
|
| 13 |
+
model_name: str = "local-model"
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class Task(BaseModel):
|
| 17 |
+
"""Represents a task for an agent to execute"""
|
| 18 |
+
id: str = str(uuid.uuid4())
|
| 19 |
+
type: str
|
| 20 |
+
description: str
|
| 21 |
+
priority: int = 1 # 1-5, 5 being highest
|
| 22 |
+
status: str = "pending" # pending, running, completed, failed
|
| 23 |
+
assigned_agent: Optional[str] = None
|
| 24 |
+
created_at: datetime = datetime.now()
|
| 25 |
+
completed_at: Optional[datetime] = None
|
| 26 |
+
result: Optional[Dict[str, Any]] = None
|
| 27 |
+
metadata: Dict[str, Any] = {}
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class AgentMessage(BaseModel):
|
| 31 |
+
"""Message exchanged between agents"""
|
| 32 |
+
sender: str
|
| 33 |
+
recipient: str
|
| 34 |
+
content: str
|
| 35 |
+
timestamp: datetime = datetime.now()
|
| 36 |
+
message_type: str = "info" # info, warning, error, task
|
| 37 |
+
correlation_id: Optional[str] = None
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
class SEOData(BaseModel):
|
| 41 |
+
"""SEO-specific data structure"""
|
| 42 |
+
domain: str
|
| 43 |
+
keywords: List[str] = []
|
| 44 |
+
backlinks: List[Dict[str, Any]] = []
|
| 45 |
+
content_pages: List[Dict[str, Any]] = []
|
| 46 |
+
technical_issues: List[Dict[str, Any]] = []
|
| 47 |
+
analytics_data: Dict[str, Any] = {}
|
| 48 |
+
conversion_metrics: Dict[str, Any] = {}
|