[DERCBOT-1037] Use of PromptTemplate And Rewrite the RAG chain using LCEL #1772
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to the RAG (Retrieval-Augmented Generation) system to improve prompt handling, dependency updates, and refactoring of callback handlers and utility functions. The most important changes are summarized below:
Improvements to Prompt Handling:
RAGQuery
to usePromptTemplate
instead ofquestionAnsweringPromptInputs
for better prompt handling. (bot/engine/src/main/kotlin/engine/config/RAGAnswerHandler.kt
,gen-ai/orchestrator-client/src/main/kotlin/ai/tock/genai/orchestratorclient/requests/RAGQuery.kt
,gen-ai/orchestrator-server/src/main/python/server/src/gen_ai_orchestrator/routers/requests/requests.py
) [1] [2] [3] [4] [5]Dependency Updates:
pyproject.toml
to their latest versions to ensure compatibility and security. (gen-ai/orchestrator-server/src/main/python/server/pyproject.toml
) [1] [2]Refactoring and Cleanup:
validate_prompt_template
function fromcompletion_service.py
and moved it toprompt_utility.py
for better modularity. (gen-ai/orchestrator-server/src/main/python/server/src/gen_ai_orchestrator/services/completion/completion_service.py
) [1] [2] [3]RetrieverJsonCallbackHandler
withRAGCallbackHandler
to improve callback handling in the RAG chain execution. (gen-ai/orchestrator-server/src/main/python/server/src/gen_ai_orchestrator/services/langchain/callbacks/rag_callback_handler.py
,gen-ai/orchestrator-server/src/main/python/server/src/gen_ai_orchestrator/services/langchain/rag_chain.py
) [1] [2] [3] [4] [5] [6]These changes enhance the robustness, maintainability, and performance of the RAG system.