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

Adding default use cases #583

Merged
merged 5 commits into from
Mar 17, 2024

Conversation

amitgalitz
Copy link
Member

@amitgalitz amitgalitz commented Mar 15, 2024

Description

The reason I went with a separate defaults file for now is so we don't make breaking changes on our template if customers gives us feedback for how to this differently.

Some concerns I have:

  1. Customers might have a hard time knowing what to substitute, for example if they want to change connector post functions they need to know this key:
    "create_connector.actions.pre_process_function": "<content>"
    or for sparse search: "register_local_sparse_encoding_model.function_name"

  2. If we want to make these more flexibly its going to be hard to do substitution on things like the index mapping unless user gives a whole string version of there mapping, settings and alias and we make the entire configuration a substitution.

  3. Currently you can see I have two versions of create connector - deploy - register. This is due that some connectors have more optional parameters then the others. One solution is having many files for each variation, another is to potentially have the connectors made with empty fields (for example truncate is only needed in cohere default so if we have that for an OpenAI connector it will just be there and unused).

I only added 3 fully working defaults here for now, will have lots more to add if this approach seems fine. I want to also add a good amount of local models so that at least for fast POC or demo users can have a one click set up of an entire use case with 0 additional input like:

POST /_plugins/_flow_framework/workflow?use_case=local_neural_sparse_search
{}
or
POST /_plugins/_flow_framework/workflow?use_case=local_neural_sparse_search

another example with current use cases in PR:

POST /_plugins/_flow_framework/workflow?use_case=cohere-embedding_model_deploy
{
    "create_connector.credential.key" : "123"
}

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions github-actions bot added the backport 2.x backport PRs to 2.x branch label Mar 15, 2024
@amitgalitz amitgalitz marked this pull request as ready for review March 15, 2024 20:23
Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 56.75676% with 32 lines in your changes are missing coverage. Please review.

Project coverage is 72.15%. Comparing base (1f6573d) to head (cdb6459).

❗ Current head cdb6459 differs from pull request most recent head 80ca636. Consider uploading reports for the commit 80ca636 to get more accurate results

Files Patch % Lines
...h/flowframework/rest/RestCreateWorkflowAction.java 17.85% 22 Missing and 1 partial ⚠️
.../org/opensearch/flowframework/util/ParseUtils.java 64.28% 3 Missing and 2 partials ⚠️
...ensearch/flowframework/common/DefaultUseCases.java 92.30% 0 Missing and 2 partials ⚠️
...earch/flowframework/transport/WorkflowRequest.java 66.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #583      +/-   ##
============================================
- Coverage     72.55%   72.15%   -0.40%     
- Complexity      659      670      +11     
============================================
  Files            80       81       +1     
  Lines          3399     3462      +63     
  Branches        268      278      +10     
============================================
+ Hits           2466     2498      +32     
- Misses          816      842      +26     
- Partials        117      122       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
@jackiehanyang
Copy link
Collaborator

Some nit comments on this draft pr, will review again once the pr is ready for review.

Copy link
Member

@joshpalis joshpalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me, thanks @amitgalitz for this, definitely improves ease of use. Just had a few comments

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
Copy link
Member

@owaiskazi19 owaiskazi19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have some design questions and code/style comments to discuss. Without a frontend, this functionality might appear somewhat complex to users. However, we are steadily advancing towards enhancing the framework's capabilities.

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
Copy link
Member

@owaiskazi19 owaiskazi19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create those 2 issues to either continue the discussion over the design or have a follow up PR. Rest looks good. Thanks for addressing the comments. @dbwiddis can you take a look and we can merge this in?

Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! This is an awesome addition.

@owaiskazi19 owaiskazi19 merged commit b148eb5 into opensearch-project:main Mar 17, 2024
31 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 17, 2024
* initial default use case addition

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

* adding IT and UT

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

* addresing comments and adding more tests

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

* addressing more comments and adding more UT

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

* addressed more comments and more UT

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>

---------

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
(cherry picked from commit b148eb5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
amitgalitz pushed a commit that referenced this pull request Mar 17, 2024
Adding default use cases (#583)

* initial default use case addition



* adding IT and UT



* addresing comments and adding more tests



* addressing more comments and adding more UT



* addressed more comments and more UT



---------


(cherry picked from commit b148eb5)

Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport PRs to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants