"""表达优化模型."""

from pydantic import BaseModel, Field

from .action_state import ActionState


class OptimizeExpressionRequest(BaseModel):
    """表达优化请求."""

    text: str = Field(..., min_length=1, max_length=8000)
    context: str = Field("", max_length=2000)


class OptimizedExpressionData(BaseModel):
    """表达优化响应数据（含降级标记）."""

    optimized: str
    suggestions: list[str] = []
    degraded: bool = False
    degraded_reason: str = ""


class OptimizeExpressionResponse(ActionState[OptimizedExpressionData]):
    """表达优化响应信封."""
