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

[Core] Tools as methods only work if they are public #2041

Open
ThomasVitale opened this issue Jan 5, 2025 · 0 comments
Open

[Core] Tools as methods only work if they are public #2041

ThomasVitale opened this issue Jan 5, 2025 · 0 comments

Comments

@ThomasVitale
Copy link
Contributor

Bug description
When defining tools from Java methods, the callback logic fails if the method is not public or if it's located in a non-public class.

Environment
Spring AI: 1.0.0-SNAPSHOT
Java: 23

Expected behavior
Even if the class/method is not public, I'd expect the tool callback logic to work. It's good practice not to define tool methods as public, and make sure they are only used as part of an LLM workflow.

I have a solution suggestion. See MethodToolCallback.java. A working example is available here.

Minimal Complete Reproducible example
Example reproducing the issue is available here (check the /chat/method/non-public endpoint).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant