-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update tools.adoc About toolDefinition parameter transfer error #3468
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
Conversation
There shouldn't be a method here. This is obviously wrong. Signed-off-by: qwp_p <[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.
Please refer to the following source code. I don't think there is any error in the document itself. Could you please double-check it?
spring-ai/spring-ai-model/src/main/java/org/springframework/ai/tool/support/ToolDefinitions.java
Line 47 in 694bb50
public static DefaultToolDefinition.Builder builder(Method method) { |
Ok, maybe it's my version problem.😂 |
No, no, no, that's not right. The version is fine. Sorry, it seems to be the fault of the document sample.😦 |
This should be the interface: |
I'm a bit confused about what you mean, the sample code in the current sample documentation is as follows: spring-ai/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/tools.adoc Lines 318 to 324 in 694bb50
According to the interface definition, the spring-ai/spring-ai-model/src/main/java/org/springframework/ai/tool/method/MethodToolCallback.java Lines 210 to 213 in 694bb50
and Line 67 in 694bb50
which I don't seem to see a problem with. |
ok,I think i get it |
@RobinElysia Thanks for the PR fixing the doc. |
There shouldn't be a method here. Fixes #3468 Signed-off-by: qwp_p <[email protected]> (cherry picked from commit 23c38df)
Hi @ilayaperumalg , I think this merge might be a mistake, because the original document was correct — spring-ai/spring-ai-model/src/main/java/org/springframework/ai/tool/support/ToolDefinitions.java Lines 38 to 62 in 23c38df
|
@sunyuhan1998 yes, sorry about that. fixing the doc now |
Auto-cherry-pick to 1.0.x This reverts commit 23c38df.
Reverted the change. @sunyuhan1998 Thanks for pointing it out. |
Method method = ReflectionUtils.findMethod(DateTimeTools.class, "getCurrentDateTime");
ToolCallback toolCallback = MethodToolCallback.builder()
.toolDefinition(ToolDefinition.builder() // Shouldn't method be passed here?
.description("Get the current date and time in the user's timezone")
.build())
.toolMethod(method)
.toolObject(new DateTimeTools())
.build();