ml-commons
ml-commons copied to clipboard
[FEATURE] Add possible values to ConnectorAction.ActionType enum, or make generic
Is your feature request related to a problem? A clear and concise description of what the problem is, e.g. I'm always frustrated when [...]
When registering a ML model, you can specify an actions
parameter that is an array of objects, however there is currently no point to do so since the action_type
only supports predict
currently. For example, what if I wanted to add in the same model, actions for embed
and predict
?
"actions": [
{
"action_type": "predict",
"method": "POST",
"url": "https://api.cohere.ai/v1/chat",
"headers": {
"Authorization": "Bearer ${credential.cohere_key}",
"Request-Source": "unspecified:opensearch"
},
"request_body": "{ \"message\": ${parameters.message}, \"model\": \"${parameters.model}\", \"connectors\": \"${parameters.connectors}\", \"conversation_id\": \"${parameters.conversation_id}\" }"
},
{
"action_type": "other..",
]
What solution would you like? A clear and concise description of what you want to happen.
Solution 1:
- Increase the ActionType enum values we can use
Solution 2:
- Remove the ActionType enum, and allow the use the flexibility to define the
action_type
tourl
mapping generically
What alternatives have you considered? A clear and concise description of any alternative solutions or features you've considered.
Two solutions above
Do you have any additional context? Add any other context or screenshots about the feature request here.
When registering a ML model, you can specify an actions parameter that is an array of objects, however there is currently no point to do so since the action_type only supports predict currently.
Thanks @tianjing-li , you are correct. We built connector action as list for future extension. Check my response https://github.com/opensearch-project/ml-commons/issues/1926#issuecomment-1916351976
@ylwu-amzn Thank you! will make a note of that ticket