Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] search request with ml_inference response processor search pipeline throws error with script_fields #17157

Open
prasadnu opened this issue Jan 28, 2025 · 0 comments
Labels
bug Something isn't working untriaged

Comments

@prasadnu
Copy link

Describe the bug

Currently, through ml_inference response processor, I can access only the _source fields in the input_map. If I create new fields using a script while querying, I get illegal_argument_exception error

Related component

No response

To Reproduce

Example:

Creating search pipeline with ml_inference response processor

PUT /_search/pipeline/LLM_language_detection_pipeline
{
"description": "Translate the text",
"response_processors": [
{
"ml_inference": {
"model_id": "3oDXrJQBHuI4hsXgXABB",
"input_map": [
{
"inputs": "new_field". ##### using the script field as the model input
}
],
"output_map": [
{
"ext.ml_inference.llm_response": "response"
}
]
}
}
]
}

_search query that creates a script field, 'new_field':

GET /_search?search_pipeline=LLM_language_detection_pipeline
{
"query": {
"match_all": {}
},
"script_fields": {
"new_field": {
"script": {
"lang": "painless",
"source": "'new_field_value'"
}
}
}
}

Response

{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "json object can not be null"
}
],
"type": "illegal_argument_exception",
"reason": "json object can not be null"
},
"status": 400
}

Expected behavior

search request with ml_inference response processor search pipeline to be able to run with script_fields

Additional Details

Plugins
Please list all plugins currently enabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@prasadnu prasadnu added bug Something isn't working untriaged labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged
Projects
None yet
Development

No branches or pull requests

1 participant