"""智能算法展示平台数据模型"""

from typing import List, Optional, Dict, Any
from dataclasses import dataclass


@dataclass
class AlgorithmVersion:
    """算法版本"""
    id: str
    algorithm_id: str
    version: str
    url: str
    params: Dict[str, Any]
    input_schema: Dict[str, Any]
    output_schema: Dict[str, Any]
    is_default: bool
    created_at: str
    updated_at: str


@dataclass
class Algorithm:
    """算法"""
    id: str
    name: str
    description: str
    type: str
    status: str
    versions: List[AlgorithmVersion]
    created_at: str
    updated_at: str


@dataclass
class AlgorithmCallRequest:
    """算法调用请求"""
    algorithm_id: str
    version_id: str
    input_data: Dict[str, Any]
    params: Dict[str, Any]


@dataclass
class AlgorithmCallResult:
    """算法调用结果"""
    id: str
    user_id: str
    algorithm_id: str
    version_id: str
    input_data: Dict[str, Any]
    params: Dict[str, Any]
    output_data: Dict[str, Any]
    status: str
    response_time: float
    error_message: Optional[str]
    created_at: str
    updated_at: str
