-
Notifications
You must be signed in to change notification settings - Fork 140
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] Invalid JSON in payload error despite sending a valid JSON with all required parameters #1872
Comments
Hi @NeuralFlux works well for me. May be some problem in request_body while creating connector It should be
|
I realized a JSON has different standards for being "valid". May I know which standard is used to check the payload? Plain strings are valid JSON documents according to RFC 7159 and RFC 8259. |
Hi @NeuralFlux, could you please share your connector configuration? |
Sure thing, it's "actions": [
{
"action_type": "predict",
"method": "POST",
"headers": {
"content-type": "application/x-text"
},
"url": "<INFERENCE_ENDPOINT>",
"request_body": "${parameters.inputs}"
}
] |
this might be resolved using model interface #2354 |
What is the bug?
Sending a predict request to a model that uses SageMaker connector like so
produces an error
despite having a complete and valid JSON.
How can one reproduce the bug?
Steps to reproduce the behavior:
curl -XPOST "http://localhost:9200/_plugins/_ml/models/<Model ID>/_predict" -H 'Content-Type: application/json' -d' { "parameters": { "inputs": "test sentence" } }'
What is the expected behavior?
The request should trigger processing of
request_body
in the connector without any errors.What is your host/environment?
Do you have any additional context?
Passing
"inputs": ["test sentence"]
works. However, I need the embedding on just the sentence without the extra square brackets. Moreover,${parameters.input}[0]
works without any errors but gave different embedding for a test sentence than what was expected.The text was updated successfully, but these errors were encountered: