-
Notifications
You must be signed in to change notification settings - Fork 50
[example][java] Add ReAct agent example #242
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
base: main
Are you sure you want to change the base?
Conversation
10ffbff
to
43b5e39
Compare
One thing that I'm not sure is whether the notifyShipping tools was called or not. At least, i'm not able to see it from the short period that I ran it. |
@wenjin272 @xintongsong @Sxnan please take a look when you gets time. |
43b5e39
to
288f9f0
Compare
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.
Hi, @letaoj, thanks for your work.
The tool is exactly called, but it fell into recursion.
"Notify the shipping manager when product received a negative review due to shipping damage.") | ||
public static void notifyShippingManager( | ||
@ToolParam(name = "id") String id, @ToolParam(name = "review") String review) { | ||
notifyShippingManager(id, review); |
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.
Should use org.apache.flink.agents.examples.agents.CustomTypesAndResources.notifyShippingManager( id, review);
here.
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.
Thanks for catching this. This is not an obvious bug. Is that possible to write this code in a different way so that I do not need to have this sort of redundent call in the ReAct agent?
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.
Maybe you can add @tool and @ToolParam directly on the notifyShippingManager
method in CustomTypesAndResources, and register it in agents execution envrionment.
288f9f0
to
8766f98
Compare
Linked issue: #229
Purpose of change
This change added a example for the ReAct agent quickstart guide in Java similar to what python did. In this change, we are made a couple improvement to the existing single and multiple agent example to remove unused connection setup.
Tests
API
Documentation