-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat: parse connector id from tool parameters map #846
feat: parse connector id from tool parameters map #846
Conversation
Not sure what are the expected UTs and ITs in the PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #846 +/- ##
============================================
+ Coverage 77.38% 77.55% +0.17%
- Complexity 963 966 +3
============================================
Files 97 97
Lines 4536 4531 -5
Branches 423 422 -1
============================================
+ Hits 3510 3514 +4
+ Misses 845 835 -10
- Partials 181 182 +1 ☔ View full report in Codecov by Sentry. |
Thanks for the PR! I see you copied what we already did for model ID which works great. I wonder if there's a more efficient way to do it but we can refactor later. :)
For UT: Looks like our existing unit tests just confirm that we generate a tool step. We could update those to include things in the map and verify that they exist in the MLToolSpec object in the output... which we probably should have already done. But this is one of those things probably better tested in an integ test (or API Spec test). Can you add a new test method to
From the standpoint of this PR, doing a manual test and showing the output here is probably sufficient as we have a plan to eventually test all our templates via api spec and that will eventually cover this... but any help you can provide improving out UT/IT would be appreciated. |
Updated |
It should be a good idea to iterate over a set of [CONNECTOR_ID, MODEL_ID, AGENT_ID]. Hoping that the code can get merged before 2.17, we can refactor the code later in 2.18. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for now, please make the one tweak on workflow data param I requested!
src/test/java/org/opensearch/flowframework/workflow/ToolStepTests.java
Outdated
Show resolved
Hide resolved
Not sure how to accomplish this step. It takes me some while to get the agent id. |
This one's probably better handled by an api spec test |
Just figured out. Pushing the code now. |
@dbwiddis Can you help review the IT code? Thanks! |
88b1ecf
to
44cf0be
Compare
Not sure whether the current CI error is attributed to this PR. Can someone take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still LGTM with a few suggestions.
src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also write a secured integ test for this in FlowFrameworkSecureRestApiIT
?
src/main/java/org/opensearch/flowframework/workflow/ToolStep.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/workflow/ToolStep.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/flowframework/FlowFrameworkRestTestCase.java
Outdated
Show resolved
Hide resolved
I can add an IT. Before that, can you tell me its difference between |
FlowFrameworkSecureRestApiIT is for security enabled integ tests and FlowFrameworkRestApiIT is for security disabled integ tests. |
|
So since you are adding a new template file createconnector-createconnectortool-createflowagent.json. We can add a new secured integ tests for create and provision with access control. |
Does the ML Commons client connector API behave differently with/without the security plugin installed? If so, it's appropriate. |
No. I don't think so. Connector is accessing remote services. Security plugin does not matter. |
Then I don't think a security integ test is needed. @owaiskazi19 do you feel differently? |
Agreed. @yuye-aws can you resolve the other comments then and we can get this in? |
Signed-off-by: yuye-aws <[email protected]>
Signed-off-by: yuye-aws <[email protected]>
Signed-off-by: yuye-aws <[email protected]>
Signed-off-by: yuye-aws <[email protected]>
Signed-off-by: yuye-aws <[email protected]>
Signed-off-by: yuye-aws <[email protected]>
e7994a6
to
a8872d6
Compare
Signed-off-by: yuye-aws <[email protected]>
@dbwiddis @owaiskazi19 This PR has been updated according to your comments. Can you help review again? |
There seems to be a flakey test. Need to rerun this workflow. |
Yeah, macos multinode runs into memory issues sometimes (3 nodes in docker + deploying a local model), will rerun, but sometimes we just merge if that's the only failure. |
Signed-off-by: yuye-aws <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and I've checked all requested changes and resolved the conversations.
* feat: parse connector id from tool parameters map Signed-off-by: yuye-aws <[email protected]> * update changelog Signed-off-by: yuye-aws <[email protected]> * implement unit test for connector, model and agent id Signed-off-by: yuye-aws <[email protected]> * tool step id: make node id unique Signed-off-by: yuye-aws <[email protected]> * integration test: create agent with connector tool Signed-off-by: yuye-aws <[email protected]> * integration test: update with get agent and get workflow Signed-off-by: yuye-aws <[email protected]> * optimize: iterate through connector_id model_id and agent_id Signed-off-by: yuye-aws <[email protected]> * update changelog Signed-off-by: yuye-aws <[email protected]> --------- Signed-off-by: yuye-aws <[email protected]> (cherry picked from commit b3f9d65) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* feat: parse connector id from tool parameters map (#846) * feat: parse connector id from tool parameters map Signed-off-by: yuye-aws <[email protected]> * update changelog Signed-off-by: yuye-aws <[email protected]> * implement unit test for connector, model and agent id Signed-off-by: yuye-aws <[email protected]> * tool step id: make node id unique Signed-off-by: yuye-aws <[email protected]> * integration test: create agent with connector tool Signed-off-by: yuye-aws <[email protected]> * integration test: update with get agent and get workflow Signed-off-by: yuye-aws <[email protected]> * optimize: iterate through connector_id model_id and agent_id Signed-off-by: yuye-aws <[email protected]> * update changelog Signed-off-by: yuye-aws <[email protected]> --------- Signed-off-by: yuye-aws <[email protected]> (cherry picked from commit b3f9d65) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * JDK21 minimum is only for 3.x Signed-off-by: Daniel Widdis <[email protected]> --------- Signed-off-by: yuye-aws <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Daniel Widdis <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Daniel Widdis <[email protected]>
Description
Parse connector id from
previous_node_inputs
into the parameters mapRelated Issues
Resolves #845
Check List
[ ] API changes companion pull request created.--signoff
.[ ] Public documentation issue/PR created.Already documentedBy 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.