from typing import ClassVar

from .spec import OtelGenAISpecification
from .types import MESSAGE_ROLES, REQUIRED, AttributeSpec


class OtelGenAIInputMessageSpecification(OtelGenAISpecification):
    """OpenTelemetry GenAI input message specification.

    Validates input messages with required role and parts attributes.
    """
    SUPPORTED_ATTRIBUTES: ClassVar[dict[str, AttributeSpec]] = {
        "parts": AttributeSpec(
            name="parts",
            requirement=REQUIRED,
            type="any",
        ),
        "role": AttributeSpec(
            name="role",
            requirement=REQUIRED,
            type="string",
            valid_values=MESSAGE_ROLES,
        ),
    }
