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] Remote endpoint connector cannot parse array param #1036

Closed
ps48 opened this issue Jul 5, 2023 · 3 comments
Closed

[BUG] Remote endpoint connector cannot parse array param #1036

ps48 opened this issue Jul 5, 2023 · 3 comments
Labels
bug Something isn't working untriaged

Comments

@ps48
Copy link
Member

ps48 commented Jul 5, 2023

What is the bug?
Different Language models have different types of parameters that need to be passed in to the model endpoints. The connectors should support different data-types including array for such model.s

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Use dev tools to create a model connector
  2. API Sample with payload
POST /_plugins/_ml/connectors/_create
{
  "name": "Test connector",
  "description": "Test Connector",
  "version": 1,
  "protocol": "aws/v1",
  "access_mode": "public",
  "parameters": {
  "sample_param": [ "\n\nHuman:" ]
  },
  "credential": {
      "access_key": "<new access key>",
      "secret_key": "<new secret key>",
      "session_token": "<new session>"
  },
  "actions": [
    {
      "predict": {
        "method": "POST",
        "url": "URL",
        "headers": { 
          "content-type": "application/json",
          "x-amz-content-sha256": "required"
        },
        "request_body": "PARAMS"
      }
    },
    {
      "metadata": {
        "method": "GET",
        "url": "URL",
        "headers": {
          "content-type": "application/json"
        }
      }
    }
  ]
}

NOTE: The issue is with sample_param in the above payload

What is the expected behavior?
All parameters with different data-type should work out of the box with all APIs

What is your host/environment?

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?

  1. The issue may trickle down to model register and deploy APIs. Need to test more without connector and directly register/deploy models.
@ps48 ps48 added bug Something isn't working untriaged labels Jul 5, 2023
@Zhangxunmt
Copy link
Collaborator

This bug is fix in 2.9 in #1075.

@ps48
Copy link
Member Author

ps48 commented Jul 18, 2023

@Zhangxunmt @ylwu-amzn Was this solved in 2.9? I still see the same error as earlier in the 2.9 version:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Invalid JSON in payload"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Invalid JSON in payload"
  },
  "status": 400
}

@ylwu-amzn
Copy link
Collaborator

ylwu-amzn commented Jul 18, 2023

you should change action part

"actions": [
    {
        "action_type": "predict",
        "method": "POST",
        "url": "URL",
        "headers": { 
          "content-type": "application/json",
          "x-amz-content-sha256": "required"
        },
        "request_body": "PARAMS"
    }
  ]

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

3 participants