From 462025de75cb83f5b4e5c5183f3cfd2038cf811d Mon Sep 17 00:00:00 2001 From: Craig Walls Date: Fri, 14 Jun 2024 20:44:16 -0600 Subject: [PATCH] Use FunctionCallbackWrapper builder in Minimax and ZhipuAI docs --- .../api/chat/functions/minimax-chat-functions.adoc | 10 +++++----- .../api/chat/functions/zhipuai-chat-functions.adoc | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/minimax-chat-functions.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/minimax-chat-functions.adoc index 2d6380bd7..fcc8feaf8 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/minimax-chat-functions.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/minimax-chat-functions.adoc @@ -127,10 +127,10 @@ static class Config { @Bean public FunctionCallback weatherFunctionInfo() { - return new FunctionCallbackWrapper<>("CurrentWeather", // (1) function name - "Get the weather in location", // (2) function description - (response) -> "" + response.temp() + response.unit(), // (3) Response Converter - new MockWeatherService()); // function code + return FunctionCallbackWrapper.builder(new MockWeatherService()) + .withName("CurrentWeather") // (1) function name + .withDescription("Get the weather in location") // (2) function description + .build(); } ... } @@ -223,4 +223,4 @@ The https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot // MiniMaxChatOptions.builder().withFunction("CurrentWeather").build())); // Enable the function // ---- // -// NOTE: Functions are registered when MiniMaxChatModel is created, by you must enable in the Prompt the functions to be used in the request. \ No newline at end of file +// NOTE: Functions are registered when MiniMaxChatModel is created, by you must enable in the Prompt the functions to be used in the request. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/zhipuai-chat-functions.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/zhipuai-chat-functions.adoc index de25ce8b0..22b6b132e 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/zhipuai-chat-functions.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/zhipuai-chat-functions.adoc @@ -127,10 +127,10 @@ static class Config { @Bean public FunctionCallback weatherFunctionInfo() { - return new FunctionCallbackWrapper<>("CurrentWeather", // (1) function name - "Get the weather in location", // (2) function description - (response) -> "" + response.temp() + response.unit(), // (3) Response Converter - new MockWeatherService()); // function code + return FunctionCallbackWrapper.builder(new MockWeatherService()) + .withName("CurrentWeather") // (1) function name + .withDescription("Get the weather in location") // (2) function description + .build(); } ... } @@ -223,4 +223,4 @@ The https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot // ZhiPuAiChatOptions.builder().withFunction("CurrentWeather").build())); // Enable the function // ---- // -// NOTE: Functions are registered when ZhiPuAiChatModel is created, by you must enable in the Prompt the functions to be used in the request. \ No newline at end of file +// NOTE: Functions are registered when ZhiPuAiChatModel is created, by you must enable in the Prompt the functions to be used in the request.