Open mingshl opened 2 days ago
"text": "query.term.review.value" ## This can also be null
"image": "query.term.review_embedding.value" ## This can also be null
My understanding: if any of these parameter value is null and ignore_missing
as true, we should use null value in model input. Then the default value in model_config
seems not necessary for some model if they allow optional text or image. Seems not necessary to define default value as null in model_config
"model_config": {
"text": null
"image": null
},
For some model, they may prefer some default value. I remember this should be supported today , for example?
"input_map": [
{
"input_type": "query.term.review.value"
}
]
"model_config": {
"input_type": "image"
},
If "query.term.review.value" doesn't exist, will we use image
as default value of input_type
today ?
maybe we can refer to this blueprint when a key is not found, we can refer this setting: inputText:-null
"ml_inference": {
"tag": "ml_inference",
"description": "This processor is going to run ml inference during search request",
"model_id": "ZuOjE5MBVOtxcB9MLrYL",
"query_template": "{\"size\": 2,\"query\": {\"knn\": {\"review_embedding\": {\"vector\": ${image_embedding},\"k\": 3}}}}",
"function_name": "REMOTE",
"input_map": [
{
"text": "query.term.review.value:-null" ## This can also be null
"image": "query.term.review_embedding.value:-null" ## This can also be null
}
],
"output_map": [
{
"image_embedding": "response"
}
],
"model_config":
{
},
"ignore_missing": false,
"ignore_failure": false
}
Is your feature request related to a problem? Currently, in ml inference processors, when input_maps are config, those fields are mandatory field to map from ingest document or from search response or from search query. When a field is missing, we will not proceed with predictions.
What solution would you like? we can make an enhancement, to give a default value in the model_config, then we can check even though a field is not present in the query body, but there is default value in model_config, we can still proceed forward with prediction.
for example:
What alternatives have you considered? TBD
Do you have any additional context?