# This file was auto-generated by Fern from our API Definition.

import typing

from ..core import enum

T_Result = typing.TypeVar("T_Result")


class PatronusGuardrailConfigTarget(enum.StrEnum):
    """
    Where to apply evaluation: request (evaluate user input) or response (evaluate model response)
    """

    RESPONSE = "response"
    REQUEST = "request"

    def visit(self, response: typing.Callable[[], T_Result], request: typing.Callable[[], T_Result]) -> T_Result:
        if self is PatronusGuardrailConfigTarget.RESPONSE:
            return response()
        if self is PatronusGuardrailConfigTarget.REQUEST:
            return request()
