from dataclasses import dataclass
from typing import List, Dict, Any
import time

@dataclass
class WorkerInfo:
    worker_id: str
    address: tuple
    gpu_info: Dict[str, Any]
    model_info: Dict[str, Any]
    performance_score: float
    last_heartbeat: float
    current_load: int = 0

@dataclass
class InferenceRequest:
    request_id: str
    prompt: str
    timestamp: float
    max_length: int = 100
    temperature: float = 0.7

@dataclass
class InferenceResponse:
    request_id: str
    worker_id: str
    result: str
    processing_time: float
    timestamp: float

@dataclass
class BlockchainTransaction:
    transaction_id: str
    worker_id: str
    work_units: int
    reward: float
    timestamp: float
    block_hash: str = ""