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

[Enhancement] Enhance validation for create connector API #2993

Open
ylwu-amzn opened this issue Sep 26, 2024 · 5 comments · Fixed by #3260 · May be fixed by #3579
Open

[Enhancement] Enhance validation for create connector API #2993

ylwu-amzn opened this issue Sep 26, 2024 · 5 comments · Fixed by #3260 · May be fixed by #3579
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ylwu-amzn
Copy link
Collaborator

From #2986, user found they can create connector with invalid input like a wrong pre_process_function. We should add more validation.

@mingshl
Copy link
Collaborator

mingshl commented Nov 5, 2024

  • check the mandatory fields in from the request_body
  • validate input of the preprocessing functions

for example:

@akolarkunnu
Copy link
Contributor

please assign to me

@dhrubo-os
Copy link
Collaborator

We can have more validations in few phases like:

  1. Validate if connector payload has all the required fields. If not provided, throw the illegal argument exception

  2. Then for pre-processing or post processing functions, if the LLM service uri is available url, we need to check if we are using the pre-processing function for the same llm service or not. As an example, for "url": "https://${parameters.endpoint}/openai/deployments/${parameters.deploy-name}/embeddings?api-version=${parameters.api-version}" pre-processing function needs to be: "connector.pre_process.openai.embedding", LLM service is openai here, so we need to use the pre-processing function of openai. Same for post processing function.

  3. We can now perform more deeper level check. If we notice in the previous url: the model endpoint is embeddings so we are using the openai.embedding for pre-processing function. Same for post processing function.

We can raise PRs phase by phase accordingly.

@akolarkunnu
Copy link
Contributor

A comment from @mingshl :
Just a following up thoughts, if we can check if the credentials is valid in the create API, that would be even better as a further enhancement coming next. Then we can help user ensure the credentials work before calling the model.

@akolarkunnu
Copy link
Contributor

akolarkunnu commented Feb 11, 2025

@mingshl Can you please elaborate, what kind of validation are you expecting for credentials here?

akolarkunnu added a commit to akolarkunnu/ml-commons that referenced this issue Feb 21, 2025
This change will address the second part of validation "pre and post processing function validation".

Partially resolves opensearch-project#2993

Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
@akolarkunnu akolarkunnu linked a pull request Feb 21, 2025 that will close this issue
3 tasks
akolarkunnu added a commit to akolarkunnu/ml-commons that referenced this issue Feb 21, 2025
This change will address the second part of validation "pre and post processing function validation".

Partially resolves opensearch-project#2993

Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
akolarkunnu added a commit to akolarkunnu/ml-commons that referenced this issue Feb 24, 2025
This change will address the second part of validation "pre and post processing function validation".

Partially resolves opensearch-project#2993

Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
akolarkunnu added a commit to akolarkunnu/ml-commons that referenced this issue Mar 11, 2025
This change will address the second part of validation "pre and post processing function validation".

Partially resolves opensearch-project#2993

Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
akolarkunnu added a commit to akolarkunnu/ml-commons that referenced this issue Mar 12, 2025
This change will address the second part of validation "pre and post processing function validation".

Partially resolves opensearch-project#2993

Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
akolarkunnu added a commit to akolarkunnu/ml-commons that referenced this issue Mar 17, 2025
This change will address the second part of validation "pre and post processing function validation".

Partially resolves opensearch-project#2993

Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: Backlog
4 participants