From efdd97c24833db2a06d2611d893cc5510cc03655 Mon Sep 17 00:00:00 2001 From: "huidong.yin" Date: Mon, 4 Aug 2025 20:55:05 +0800 Subject: [PATCH] Fix incorrect example code in documentation Signed-off-by: huidong.yin --- .../src/main/antora/modules/ROOT/pages/api/tools.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/tools.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/tools.adoc index c285ef58dbc..08e8713e6f2 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/tools.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/tools.adoc @@ -789,7 +789,7 @@ When building tools from a method, the `ToolDefinition` is automatically generat [source,java] ---- Method method = ReflectionUtils.findMethod(DateTimeTools.class, "getCurrentDateTime"); -ToolDefinition toolDefinition = ToolDefinition.from(method); +ToolDefinition toolDefinition = ToolDefinitions.from(method); ---- The `ToolDefinition` generated from a method includes the method name as the tool name, the method name as the tool description, and the JSON schema of the method input parameters. If the method is annotated with `@Tool`, the tool name and description will be taken from the annotation, if set.