# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .llm_content import LlmContent


class LlmMessage(object):
    _types = {
        "role": str,
        "contents": List[LlmContent],
    }

    def __init__(self, d=None):
        self.role: Optional[str] = None
        self.contents: Optional[List[LlmContent]] = None
        init(self, d, self._types)

    @staticmethod
    def builder() -> "LlmMessageBuilder":
        return LlmMessageBuilder()


class LlmMessageBuilder(object):
    def __init__(self) -> None:
        self._llm_message = LlmMessage()

    def role(self, role: str) -> "LlmMessageBuilder":
        self._llm_message.role = role
        return self

    def contents(self, contents: List[LlmContent]) -> "LlmMessageBuilder":
        self._llm_message.contents = contents
        return self

    def build(self) -> "LlmMessage":
        return self._llm_message
