rag_service package

execute_rag

rag_service.execute_rag.execute_rag_pipeline(original_query, input_language_detected, email_id, user_name=None, message_id=None, chat_history=None)[source]

Execute RAG pipeline to process rephrasing, reranking and generating response for the given query based on the available content.

openai_service

utils

from django_core.config import Config from generation.utils import insert_generation_data from rephrasing.utils import insert_rephrase_data from reranking.utils import insert_rerank_data

rag_service.utils.post_process_rag_pipeline(message_id, rephrased_query_response, reranked_query_response, generated_response)[source]

Save or log the RAG pipeline metrics to DB.

Note : Original method call. For documenation purpose removed the with_db_config inclusion def post_process_rag_pipeline( message_id, rephrased_query_response, reranked_query_response, generated_response, with_db_config=Config.WITH_DB_CONFIG,

):