def _call(self, inputs: Dict[str, str]) -> Dict[str, Any]:
        """Run get_relevant_text and llm on input query.
        If chain has 'return_source_documents' as 'True', returns
        the retrieved documents as well under the key 'source_documents'.
        Example:
        .. code-block:: python
        res = indexqa({'query': 'This is my query'})
        answer, docs = res['result'], res['source_documents']
        """
        question = inputs[self.input_key]
        docs = self._get_docs(question)
        answer, _ = self.combine_documents_chain.combine_docs(docs, question=question)
        if self.return_source_documents:
            return {self.output_key: answer, "source_documents": docs}
        else:
            return {self.output_key: answer}
[docs]class RetrievalQA(BaseRetrievalQA, BaseModel):
    """Chain for question-answering against an index.
    Example:
        .. code-block:: python
            from langchain.llms import OpenAI
            from langchain.chains import RetrievalQA
            from langchain.faiss import FAISS
            vectordb = FAISS(...)
            retrievalQA = RetrievalQA.from_llm(llm=OpenAI(), retriever=vectordb)
    """
    retriever: BaseRetriever = Field(exclude=True)
    def _get_docs(self, question: str) -> List[Document]:
        return self.retriever.get_relevant_documents(question)
[docs]class VectorDBQA(BaseRetrievalQA, BaseModel):
    """Chain for question-answering against a vector database."""
    vectorstore: VectorStore = Field(exclude=True, alias="vectorstore")
    """Vector Database to connect to."""