From de3edbd867716e116963a3f3cc1d491af44a84f9 Mon Sep 17 00:00:00 2001 From: SexyProgrammer <49146257+SexyProgrammer@users.noreply.github.com> Date: Wed, 4 Jun 2025 16:59:51 +0800 Subject: [PATCH] fix: correct ToolDefinition.builder() usage in docs (#3431) Signed-off-by: SexyProgrammer <49146257+SexyProgrammer@users.noreply.github.com> (cherry picked from commit 8af1d3958f5740dd0bd1484a47c6a51da27bf131) --- .../src/main/antora/modules/ROOT/pages/api/tools.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 fe39d6557..d649452b1 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 @@ -316,7 +316,7 @@ The `ToolMetadata.Builder` allows you to build a `ToolMetadata` instance and def ---- Method method = ReflectionUtils.findMethod(DateTimeTools.class, "getCurrentDateTime"); ToolCallback toolCallback = MethodToolCallback.builder() - .toolDefinition(ToolDefinition.builder(method) + .toolDefinition(ToolDefinitions.builder(method) .description("Get the current date and time in the user's timezone") .build()) .toolMethod(method) @@ -349,7 +349,7 @@ class DateTimeTools { ---- Method method = ReflectionUtils.findMethod(DateTimeTools.class, "getCurrentDateTime"); ToolCallback toolCallback = MethodToolCallback.builder() - .toolDefinition(ToolDefinition.builder(method) + .toolDefinition(ToolDefinitions.builder(method) .description("Get the current date and time in the user's timezone") .build()) .toolMethod(method) @@ -801,7 +801,7 @@ If you'd rather provide some or all of the attributes explicitly, you can use th [source,java] ---- Method method = ReflectionUtils.findMethod(DateTimeTools.class, "getCurrentDateTime"); -ToolDefinition toolDefinition = ToolDefinition.builder(method) +ToolDefinition toolDefinition = ToolDefinitions.builder(method) .name("currentDateTime") .description("Get the current date and time in the user's timezone") .inputSchema(JsonSchemaGenerator.generateForMethodInput(method))