modules
__all__ = ['BaseRagModule', 'BaseQueryRagModule', 'TranslateQueryRagModule', 'BaseRetrievalRagModule', 'BaseRerankRagModule', 'TextChunksRerankRagModule', 'VectorStoreRetrievalRagModule', 'TextLoaderRetrievalRagModule', 'BaseBeforeResponseRagModule', 'BaseAfterResponseRagModule', 'BaseResponseRagModule', 'PromptResponseRagModule', 'TextChunksResponseRagModule', 'FootnotePromptResponseRagModule']
module-attribute
BaseAfterResponseRagModule
Bases: BaseRagModule
, ABC
Source code in griptape/engines/rag/modules/response/base_after_response_rag_module.py
BaseBeforeResponseRagModule
Bases: BaseRagModule
, ABC
Source code in griptape/engines/rag/modules/response/base_before_response_rag_module.py
BaseQueryRagModule
Bases: BaseRagModule
, ABC
Source code in griptape/engines/rag/modules/query/base_query_rag_module.py
BaseRagModule
Bases: FuturesExecutorMixin
, ABC
Source code in griptape/engines/rag/modules/base_rag_module.py
name: str = field(default=Factory(lambda self: f'{self.__class__.__name__}-{uuid.uuid4().hex}', takes_self=True), kw_only=True)
class-attribute
instance-attribute
generate_prompt_stack(system_prompt, query)
Source code in griptape/engines/rag/modules/base_rag_module.py
get_context_param(context, key)
set_context_param(context, key, value)
Source code in griptape/engines/rag/modules/base_rag_module.py
BaseRerankRagModule
Bases: BaseRagModule
, ABC
Source code in griptape/engines/rag/modules/retrieval/base_rerank_rag_module.py
BaseResponseRagModule
Bases: BaseRagModule
, ABC
Source code in griptape/engines/rag/modules/response/base_response_rag_module.py
BaseRetrievalRagModule
Bases: BaseRagModule
, ABC
Source code in griptape/engines/rag/modules/retrieval/base_retrieval_rag_module.py
FootnotePromptResponseRagModule
Bases: PromptResponseRagModule
Source code in griptape/engines/rag/modules/response/footnote_prompt_response_rag_module.py
default_system_template_generator(context, artifacts)
Source code in griptape/engines/rag/modules/response/footnote_prompt_response_rag_module.py
PromptResponseRagModule
Bases: BaseResponseRagModule
, RuleMixin
Source code in griptape/engines/rag/modules/response/prompt_response_rag_module.py
answer_token_offset: int = field(default=400)
class-attribute
instance-attribute
generate_system_template: Callable[[RagContext, list[TextArtifact]], str] = field(default=Factory(lambda self: self.default_system_template_generator, takes_self=True))
class-attribute
instance-attribute
metadata: Optional[str] = field(default=None)
class-attribute
instance-attribute
prompt_driver: BasePromptDriver = field(default=Factory(lambda: Defaults.drivers_config.prompt_driver))
class-attribute
instance-attribute
default_system_template_generator(context, artifacts)
Source code in griptape/engines/rag/modules/response/prompt_response_rag_module.py
run(context)
Source code in griptape/engines/rag/modules/response/prompt_response_rag_module.py
TextChunksRerankRagModule
Bases: BaseRerankRagModule
Source code in griptape/engines/rag/modules/retrieval/text_chunks_rerank_rag_module.py
TextChunksResponseRagModule
Bases: BaseResponseRagModule
Source code in griptape/engines/rag/modules/response/text_chunks_response_rag_module.py
TextLoaderRetrievalRagModule
Bases: BaseRetrievalRagModule
Source code in griptape/engines/rag/modules/retrieval/text_loader_retrieval_rag_module.py
loader: BaseTextLoader = field()
class-attribute
instance-attribute
process_query_output_fn: Callable[[list[BaseVectorStoreDriver.Entry]], Sequence[TextArtifact]] = field(default=Factory(lambda: lambda es: [e.to_artifact() for e in es]))
class-attribute
instance-attribute
query_params: dict[str, Any] = field(factory=dict)
class-attribute
instance-attribute
source: Any = field()
class-attribute
instance-attribute
vector_store_driver: BaseVectorStoreDriver = field()
class-attribute
instance-attribute
run(context)
Source code in griptape/engines/rag/modules/retrieval/text_loader_retrieval_rag_module.py
TranslateQueryRagModule
Bases: BaseQueryRagModule
Source code in griptape/engines/rag/modules/query/translate_query_rag_module.py
generate_user_template: Callable[[str, str], str] = field(default=Factory(lambda self: self.default_user_template_generator, takes_self=True))
class-attribute
instance-attribute
language: str = field()
class-attribute
instance-attribute
prompt_driver: BasePromptDriver = field()
class-attribute
instance-attribute
default_user_template_generator(query, language)
run(context)
Source code in griptape/engines/rag/modules/query/translate_query_rag_module.py
VectorStoreRetrievalRagModule
Bases: BaseRetrievalRagModule