# 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 .passage import Passage


class RagAnswer(object):
    _types = {
        "answer": str,
        "reasoning_content": str,
        "passages": List[Passage],
    }

    def __init__(self, d=None):
        self.answer: Optional[str] = None
        self.reasoning_content: Optional[str] = None
        self.passages: Optional[List[Passage]] = None
        init(self, d, self._types)

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


class RagAnswerBuilder(object):
    def __init__(self) -> None:
        self._rag_answer = RagAnswer()

    def answer(self, answer: str) -> "RagAnswerBuilder":
        self._rag_answer.answer = answer
        return self

    def reasoning_content(self, reasoning_content: str) -> "RagAnswerBuilder":
        self._rag_answer.reasoning_content = reasoning_content
        return self

    def passages(self, passages: List[Passage]) -> "RagAnswerBuilder":
        self._rag_answer.passages = passages
        return self

    def build(self) -> "RagAnswer":
        return self._rag_answer
