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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class ChatMessageRole(str, enum.Enum):
    """
    One of CHATBOT|USER to identify who the message is coming from.
    """

    CHATBOT = "CHATBOT"
    USER = "USER"

    def visit(self, chatbot: typing.Callable[[], T_Result], user: typing.Callable[[], T_Result]) -> T_Result:
        if self is ChatMessageRole.CHATBOT:
            return chatbot()
        if self is ChatMessageRole.USER:
            return user()
