[BUG] RAG processor throws NPE when it is queried without "generative_qa_parameters" parameter #3092
Closed
Description
What is the bug?
NPE that occurs when you query a rag processor without providing the "generative_qa_params" parameter within the "ext" parameter of the query
How can one reproduce the bug?
Steps to reproduce the behavior:
- Setup rag processor
- Run rag processor without providing "generative_qa_params"
Stack trace:
2024-10-10 13:15:56 at org.opensearch.searchpipelines.questionanswering.generative.GenerativeQAResponseProcessor.processResponseAsync(GenerativeQAResponseProcessor.java:130) ~[?:?]
2024-10-10 13:15:56 at org.opensearch.search.pipeline.Pipeline.lambda$transformResponseListener$9(Pipeline.java:230) ~[opensearch-2.17.1.jar:2.17.1]
2024-10-10 13:15:56 at org.opensearch.core.action.ActionListener$1.onResponse(ActionListener.java:82) [opensearch-core-2.17.1.jar:2.17.1]
2024-10-10 13:15:56 at org.opensearch.search.pipeline.Pipeline.lambda$transformResponseListener$10(Pipeline.java:259) [opensearch-2.17.1.jar:2.17.1]
2024-10-10 13:15:56 at org.opensearch.core.action.ActionListener$1.onResponse(ActionListener.java:82) [opensearch-core-2.17.1.jar:2.17.1]
2024-10-10 13:15:56 at org.opensearch.core.action.ActionListener$5.onResponse(ActionListener.java:268) [opensearch-core-2.17.1.jar:2.17.1]
2024-10-10 13:15:56 at org.opensearch.action.search.AbstractSearchAsyncAction.sendSearchResponse(AbstractSearchAsyncAction.java:759) [opensearch-2.17.1.jar:2.17.1]
Failure request:
GET /my_rag_test_data/_search
{
"query": {
"match": {
"text": "What's the population of NYC metro area in 2023"
}
},
"ext": {} // error occurs even if "ext" is not provided
}
Working request:
GET /my_rag_test_data/_search
{
"query": {
"match": {
"text": "What's the population of NYC metro area in 2023"
}
},
"ext": {
"generative_qa_parameters": {
"llm_model": "bedrock/llm",
"llm_question": "What's the population of NYC metro area in 2023"
}
}
}
What is the expected behavior?
Exception should be handled gracefully and request the user to provide the required parameters
What is your host/environment?
- OS: Linux (docker)
- Version 2.17 (should go all the way back until this code was introduced, maybe till 2.10 or 2.9)
check: 1112612#diff-0f4b179748d6cfb14e578f426d6e7de05aef8aa3e1d847f166f69a3bc5e2917b
Metadata
Assignees
Labels
Type
Projects
Status
Done