Module agents.execution.types
Type definitions for the execution module.
Classes
class ExecutorType (*args, **kwds)-
Expand source code
class ExecutorType(Enum): """Type of executor for task processing.""" PROCESS = "process" THREAD = "thread"Type of executor for task processing.
Ancestors
- enum.Enum
Class variables
var PROCESSvar THREAD
class HealthMetrics (resource_id: str,
timestamp: float,
memory_usage_mb: float,
cpu_usage_percent: float,
active_tasks: int,
response_time_ms: float,
error_count: int = 0,
success_count: int = 0)-
Expand source code
@dataclass class HealthMetrics: """Health metrics for resource monitoring.""" resource_id: str timestamp: float memory_usage_mb: float cpu_usage_percent: float active_tasks: int response_time_ms: float error_count: int = 0 success_count: int = 0Health metrics for resource monitoring.
Instance variables
var active_tasks : intvar cpu_usage_percent : floatvar error_count : intvar memory_usage_mb : floatvar resource_id : strvar response_time_ms : floatvar success_count : intvar timestamp : float
class ResourceConfig (resource_type: ResourceType = ResourceType.PROCESS,
num_idle_resources: int = 2,
max_resources: int = 10,
initialize_timeout: float = 10.0,
close_timeout: float = 60.0,
memory_warn_mb: float = 500.0,
memory_limit_mb: float = 0.0,
ping_interval: float = 30.0,
health_check_interval: float = 5.0,
load_threshold: float = 0.75,
max_concurrent_tasks: int = 1,
executor_type: ExecutorType = ExecutorType.PROCESS,
use_dedicated_inference_process: bool = True,
inference_process_timeout: float = 30.0,
inference_memory_warn_mb: float = 1000.0)-
Expand source code
@dataclass class ResourceConfig: """Configuration for resource management.""" # Resource type and count resource_type: ResourceType = ResourceType.PROCESS num_idle_resources: int = 2 max_resources: int = 10 # Timeouts initialize_timeout: float = 10.0 close_timeout: float = 60.0 # Memory management memory_warn_mb: float = 500.0 memory_limit_mb: float = 0.0 # Health monitoring ping_interval: float = 30.0 health_check_interval: float = 5.0 # Load balancing load_threshold: float = 0.75 max_concurrent_tasks: int = 1 # Platform-specific executor_type: ExecutorType = _default_executor_type # Legacy IPC compatibility use_dedicated_inference_process: bool = ( True # New: Enable dedicated inference process ) inference_process_timeout: float = 30.0 # Longer timeout for AI model loading inference_memory_warn_mb: float = 1000.0 # Higher threshold for AI modelsConfiguration for resource management.
Instance variables
var close_timeout : floatvar executor_type : ExecutorTypevar health_check_interval : floatvar inference_memory_warn_mb : floatvar inference_process_timeout : floatvar initialize_timeout : floatvar load_threshold : floatvar max_concurrent_tasks : intvar max_resources : intvar memory_limit_mb : floatvar memory_warn_mb : floatvar num_idle_resources : intvar ping_interval : floatvar resource_type : ResourceTypevar use_dedicated_inference_process : bool
class ResourceInfo (resource_id: str,
resource_type: ResourceType,
status: ResourceStatus,
current_load: float = 0.0,
memory_usage_mb: float = 0.0,
cpu_usage_percent: float = 0.0,
active_tasks: int = 0,
total_tasks_processed: int = 0,
last_heartbeat: float = 0.0,
metadata: Dict[str, Any] = <factory>)-
Expand source code
@dataclass class ResourceInfo: """Information about a resource.""" resource_id: str resource_type: ResourceType status: ResourceStatus current_load: float = 0.0 memory_usage_mb: float = 0.0 cpu_usage_percent: float = 0.0 active_tasks: int = 0 total_tasks_processed: int = 0 last_heartbeat: float = 0.0 # Resource-specific metadata metadata: Dict[str, Any] = field(default_factory=dict)Information about a resource.
Instance variables
var active_tasks : intvar cpu_usage_percent : floatvar current_load : floatvar last_heartbeat : floatvar memory_usage_mb : floatvar metadata : Dict[str, Any]var resource_id : strvar resource_type : ResourceTypevar status : ResourceStatusvar total_tasks_processed : int
class ResourceStatus (*args, **kwds)-
Expand source code
class ResourceStatus(Enum): """Status of a resource.""" IDLE = "idle" BUSY = "busy" INITIALIZING = "initializing" SHUTTING_DOWN = "shutting_down" ERROR = "error"Status of a resource.
Ancestors
- enum.Enum
Class variables
var BUSYvar ERRORvar IDLEvar INITIALIZINGvar SHUTTING_DOWN
class ResourceType (*args, **kwds)-
Expand source code
class ResourceType(Enum): """Type of resource for task execution.""" PROCESS = "process" THREAD = "thread"Type of resource for task execution.
Ancestors
- enum.Enum
Class variables
var PROCESSvar THREAD
class TaskConfig (task_type: TaskType,
timeout: float = 300.0,
retry_count: int = 3,
priority: int = 0,
required_memory_mb: float = 100.0,
required_cpu_cores: int = 1,
data: Dict[str, Any] = <factory>)-
Expand source code
@dataclass class TaskConfig: """Configuration for task execution.""" task_type: TaskType timeout: float = 300.0 # 5 minutes default retry_count: int = 3 priority: int = 0 # Higher number = higher priority # Resource requirements required_memory_mb: float = 100.0 required_cpu_cores: int = 1 # Task-specific data data: Dict[str, Any] = field(default_factory=dict)Configuration for task execution.
Instance variables
var data : Dict[str, Any]var priority : intvar required_cpu_cores : intvar required_memory_mb : floatvar retry_count : intvar task_type : TaskTypevar timeout : float
class TaskResult (task_id: str,
status: TaskStatus,
result: Any | None = None,
error: str | None = None,
execution_time: float = 0.0,
memory_used_mb: float = 0.0)-
Expand source code
@dataclass class TaskResult: """Result of a task execution.""" task_id: str status: TaskStatus result: Optional[Any] = None error: Optional[str] = None execution_time: float = 0.0 memory_used_mb: float = 0.0Result of a task execution.
Instance variables
var error : str | Nonevar execution_time : floatvar memory_used_mb : floatvar result : Any | Nonevar status : TaskStatusvar task_id : str
class TaskStatus (*args, **kwds)-
Expand source code
class TaskStatus(Enum): """Status of a task.""" PENDING = "pending" RUNNING = "running" COMPLETED = "completed" FAILED = "failed" CANCELLED = "cancelled"Status of a task.
Ancestors
- enum.Enum
Class variables
var CANCELLEDvar COMPLETEDvar FAILEDvar PENDINGvar RUNNING
class TaskType (*args, **kwds)-
Expand source code
class TaskType(Enum): """Type of task to be executed.""" INFERENCE = "inference" # For AI model inference MEETING = "meeting" # For video meeting tasks JOB = "job" # For general job executionType of task to be executed.
Ancestors
- enum.Enum
Class variables
var INFERENCEvar JOBvar MEETING