# 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 .enterprise_knowledge_source_param import EnterpriseKnowledgeSourceParam
from .knowledge_source_request_extra import KnowledgeSourceRequestExtra


class KnowledgeQaAnswerRequest(object):
    _types = {
        "query": str,
        "enable_image": bool,
        "knowledge_scope": str,
        "enterprise_knowledge_source": EnterpriseKnowledgeSourceParam,
        "extra": KnowledgeSourceRequestExtra,
        "model_type": str,
    }

    def __init__(self, d=None):
        self.query: Optional[str] = None
        self.enable_image: Optional[bool] = None
        self.knowledge_scope: Optional[str] = None
        self.enterprise_knowledge_source: Optional[EnterpriseKnowledgeSourceParam] = None
        self.extra: Optional[KnowledgeSourceRequestExtra] = None
        self.model_type: Optional[str] = None
        init(self, d, self._types)

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


class KnowledgeQaAnswerRequestBuilder(object):
    def __init__(self) -> None:
        self._knowledge_qa_answer_request = KnowledgeQaAnswerRequest()

    def query(self, query: str) -> "KnowledgeQaAnswerRequestBuilder":
        self._knowledge_qa_answer_request.query = query
        return self

    def enable_image(self, enable_image: bool) -> "KnowledgeQaAnswerRequestBuilder":
        self._knowledge_qa_answer_request.enable_image = enable_image
        return self

    def knowledge_scope(self, knowledge_scope: str) -> "KnowledgeQaAnswerRequestBuilder":
        self._knowledge_qa_answer_request.knowledge_scope = knowledge_scope
        return self

    def enterprise_knowledge_source(self,
                                    enterprise_knowledge_source: EnterpriseKnowledgeSourceParam) -> "KnowledgeQaAnswerRequestBuilder":
        self._knowledge_qa_answer_request.enterprise_knowledge_source = enterprise_knowledge_source
        return self

    def extra(self, extra: KnowledgeSourceRequestExtra) -> "KnowledgeQaAnswerRequestBuilder":
        self._knowledge_qa_answer_request.extra = extra
        return self

    def model_type(self, model_type: str) -> "KnowledgeQaAnswerRequestBuilder":
        self._knowledge_qa_answer_request.model_type = model_type
        return self

    def build(self) -> "KnowledgeQaAnswerRequest":
        return self._knowledge_qa_answer_request
