langchain/langchain
Davis Chase 10e4b32ecb
Add document transformer abstraction (#3182)
Add DocumentTransformer abstraction so that in #2915 we don't have to
wrap TextSplitter and RedundantEmbeddingFilter (neither of which uses
the query) in the contextual doc compression abstractions. with this
change, doc filter (doc extractor, whatever we call it) would look
something like
```python
class BaseDocumentFilter(BaseDocumentTransformer[_RetrievedDocument], ABC):
  
  @abstractmethod
  def filter(self, documents: List[_RetrievedDocument], query: str) -> List[_RetrievedDocument]:
    ...
  
  def transform_documents(self, documents: List[_RetrievedDocument], query: Optional[str] = None, **kwargs: Any) -> List[_RetrievedDocument]:
    if query is None:
      raise ValueError("Must pass in non-null query to DocumentFilter")
    return self.filter(documents, query)
```
2023-04-19 16:05:05 -07:00
..
agents Agents 4 18 (#3122) 2023-04-18 21:41:03 -07:00
callbacks Comet ml updates 17 04 2023 (#3074) 2023-04-18 07:32:29 -07:00
chains Spelling to correct conservation to conservation (#3049) 2023-04-17 21:03:03 -07:00
chat_models consistently use getLogger(__name__), no root logger (#2989) 2023-04-16 12:49:35 -07:00
docstore
document_loaders Harrison/discord (#3092) 2023-04-18 08:19:23 -07:00
embeddings Allowing HuggingFaceEmbeddings from the cached weight (#3084) 2023-04-18 07:30:35 -07:00
evaluation Improve eval chain prompt (#2798) 2023-04-12 17:05:20 -07:00
experimental agent docs fixes (#3128) 2023-04-18 21:54:30 -07:00
graphs Minor: Remove duplicated word in error message (#2706) 2023-04-11 13:10:33 -07:00
indexes
llms Add allowed and disallowed special arguments to BaseOpenAI (#3012) 2023-04-18 09:34:08 -07:00
memory Harrison/retriever memory (#2804) 2023-04-13 10:03:43 -07:00
output_parsers Nc/combining output parser (#3014) 2023-04-17 20:29:53 -07:00
prompts Import jinja2 only when used (#3123) 2023-04-18 21:23:03 -07:00
retrievers Fix type hint regression (#3033) 2023-04-17 15:49:18 -07:00
tools Prevent kwargs from being overwritten (#3158) 2023-04-19 09:00:10 -07:00
utilities Harrison/jira (#3055) 2023-04-17 21:14:40 -07:00
vectorstores Adding shared chromaDB client option (#2886) 2023-04-17 21:22:39 -07:00
__init__.py Add exeption for when version metadata cannot be found for package (#3107) 2023-04-18 16:44:40 -07:00
cache.py Harrison/gpt cache (#2744) 2023-04-12 14:16:58 -07:00
docker-compose.yaml
example_generator.py
formatting.py
input.py
model_laboratory.py
py.typed
python.py Move PythonRepl -> langchain.utilities (#2917) 2023-04-15 10:50:25 -07:00
requests.py fixed aiohttp.client_exceptions.ClientConnectionError: Connection closed (#2718) 2023-04-11 10:52:55 -07:00
schema.py Add document transformer abstraction (#3182) 2023-04-19 16:05:05 -07:00
serpapi.py
server.py Fix missing docker-compose (#2899) 2023-04-15 16:05:11 -07:00
sql_database.py Harrison/table index (#2526) 2023-04-06 23:03:09 -07:00
text_splitter.py Add document transformer abstraction (#3182) 2023-04-19 16:05:05 -07:00
utils.py