Source code for langchain_elasticsearch.retrievers
fromtypingimportAny,Listfromlangchain_core.callbacksimportCallbackManagerForRetrieverRunfromlangchain_core.documentsimportDocumentfromlangchain_elasticsearch._async.retrieversimport(AsyncElasticsearchRetrieveras_AsyncElasticsearchRetriever,)fromlangchain_elasticsearch._sync.retrieversimport(ElasticsearchRetrieveras_ElasticsearchRetriever,)# langchain defines some sync methods as abstract in its base class# so we have to add dummy methods for them, even though we only use the async versions
[docs]classAsyncElasticsearchRetriever(_AsyncElasticsearchRetriever):def_get_relevant_documents(self,query:str,*,run_manager:CallbackManagerForRetrieverRun,**kwargs:Any)->List[Document]:raiseNotImplementedError("This class is asynchronous, use _aget_relevant_documents()")
# this is only defined here so that it is picked up by Langchain's docs generator