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 Harrison/retrieval code (#1916) 2023-03-22 23:15:04 -07:00
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 Fix typo in VectorStoreIndexWrapper method (#1922) 2023-03-23 07:08:04 -07:00
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 add tracing support to langchain (#741) 2023-01-26 17:38:13 -08:00
example_generator.py Harrison/improve cache (#368) 2022-12-18 16:22:42 -05:00
formatting.py initial commit 2022-10-24 14:51:15 -07:00
input.py Add asyncio support for LLM (OpenAI), Chain (LLMChain, LLMMathChain), and Agent (#841) 2023-02-07 21:21:57 -08:00
model_laboratory.py Harrison/improve cache (#368) 2022-12-18 16:22:42 -05:00
py.typed Add py.typed marker to package (#121) 2022-11-12 11:22:32 -08:00
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 move serpapi wrapper (#1199) 2023-02-20 21:15:45 -08:00
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 Harrison/bing wrapper (#656) 2023-01-19 14:48:30 -08:00