Skip to content

[BUG] RAG processor throws NPE when it is queried without "generative_qa_parameters" parameter #3092

Closed
@pyek-bot

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:

  1. Setup rag processor
  2. 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?

Do you have any screenshots?
Screenshot 2024-10-10 at 1 33 52 PM

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions