"""DSPy signature for Littlehand command parsing."""

from __future__ import annotations

try:
    import dspy
except ImportError:  # pragma: no cover - optional dependency
    dspy = None  # type: ignore


if dspy is not None:
    class LittlehandSignature(dspy.Signature):
        """Parse Spanish voice commands for a vacuum gripper robot."""

        comando = dspy.InputField(desc="Voice command in Spanish")
        accion = dspy.OutputField(
            desc=(
                "Accion: subir, bajar, ir, tomar, soltar, reiniciar o error. "
                "Mapea errores infantiles, parafrasis y sinonimos cercanos a la accion valida mas cercana. "
                "Si la intencion es ambigua o no relacionada, devuelve error."
            )
        )
        objeto = dspy.OutputField(
            desc="Object name (cubo, cilindro, estrella, caja) or 'no especificado'"
        )
        color = dspy.OutputField(
            desc="Color (rojo, azul, blanco, amarillo, verde) or 'no especificado'"
        )
        tamano = dspy.OutputField(desc="Size or 'no especificado'")
else:
    LittlehandSignature = None  # type: ignore
