def answer(self, qa: BaseQaData, question_idx: int) -> dict:
        """The decision making process when a Question is given.

        Here we implement the process of single LLM call w/ or w/o reference retrieved. Re-write this function if you
        want to test more complicated QA process like Multi-Hop QAs.
        """
        reference_chunks: List[str] = self._retriever.retrieve_contents(qa, retrieve_id=f"Q{question_idx:03}")
        messages = self._qa_protocol.process_input(content=qa.question, references=reference_chunks, **qa.as_dict())

        response = self._client.generate_content_with_messages(messages, **self.llm_config)
        output_dict: dict = self._qa_protocol.parse_output(response, **qa.as_dict())

        if "response" not in output_dict:
            output_dict["response"] = response

        if "reference_chunks" not in output_dict:
            output_dict["reference_chunks"] = reference_chunks

        return output_dict
The decision making process when a Question is given.

        Here we implement the process of single LLM call w/ or w/o reference retrieved. Re-write this function if you
        want to test more complicated QA process like Multi-Hop QAs.
        
pikerag/workflows/qa.py