Base
DocTransformer ¶
Bases: BaseComponent
This is a base class for document transformers
A document transformer transforms a list of documents into another list of documents. Transforming can mean splitting a document into multiple documents, reducing a large list of documents into a smaller list of documents, or adding metadata to each document in a list of documents, etc.
Source code in libs/kotaemon/kotaemon/indices/base.py
LlamaIndexDocTransformerMixin ¶
Allow automatically wrapping a Llama-index component into kotaemon component
Example
class TokenSplitter(LlamaIndexMixin, BaseSplitter): def _get_li_class(self): from llama_index.core.text_splitter import TokenTextSplitter return TokenTextSplitter
To use this mixin, please:
1. Use this class as the 1st parent class, so that Python will prefer to use
the attributes and methods of this class whenever possible.
2. Overwrite _get_li_class
to return the relevant LlamaIndex component.
Source code in libs/kotaemon/kotaemon/indices/base.py
run ¶
Run Llama-index node parser and convert the output to Document from kotaemon
Source code in libs/kotaemon/kotaemon/indices/base.py
BaseIndexing ¶
Bases: BaseComponent
Define the base interface for indexing pipeline
Source code in libs/kotaemon/kotaemon/indices/base.py
to_retrieval_pipeline ¶
BaseRetrieval ¶
Bases: BaseComponent
Define the base interface for retrieval pipeline