Context
ContextHandler
¶
Bases: LocalStep
Example class for processing retrieved documents.
In this simple example, the text is combined with the title.
Source code in ragfit/processing/local_steps/context.py
__init__(docs_key, title_key='title', text_key='content', **kwargs)
¶
Parameters:
-
docs_key(str) –Key to the documents in the item.
-
title_key(str, default:'title') –Key to the title in the document.
-
text_key(str, default:'content') –Key to the text in the document.
Source code in ragfit/processing/local_steps/context.py
DocumentsJoiner
¶
Bases: LocalStep
Class to select top-K and join the documents into a string.
Source code in ragfit/processing/local_steps/context.py
__init__(docs_key, k=None, join_string='\n', **kwargs)
¶
Join k documents in docs_key into a string using join_string and save back to docs_key.
Parameters:
-
docs_key(str) –Key to the documents in the item.
-
k(int, default:None) –Number of documents to select or take all. Defaults to None.
-
join_string(str, default:'\n') –String to join the documents. Defaults to "\n".