| 36 | |
| 37 | |
| 38 | class RChain(BaseQaChain): |
| 39 | def __init__( |
| 40 | self, |
| 41 | chain_type: str, |
| 42 | retriever, |
| 43 | llm, |
| 44 | chain_type_kwargs: dict |
| 45 | ) -> None: |
| 46 | super().__init__(chain_type, retriever, llm) |
| 47 | self.chain_type_kwargs = chain_type_kwargs |
| 48 | |
| 49 | @property |
| 50 | def create_qa_chain(self) -> RetrievalQA: |
| 51 | qa_chain = RetrievalQA.from_chain_type( |
| 52 | llm=self.llm, |
| 53 | chain_type=self.chain_type, |
| 54 | retriever=self.retriever, |
| 55 | chain_type_kwargs=self.chain_type_kwargs |
| 56 | ) |
| 57 | return qa_chain |
| 58 | |
| 59 | |
| 60 | class CRChain(BaseQaChain): |