From 2864754d44427c93f5c76f9c8abcdc80cc3582b5 Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Mon, 18 Nov 2024 19:40:55 -0500 Subject: [PATCH] Fix Kotlin test deprecation warning --- .../tool/FunctionCallbackWrapperKotlinIT.kt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/spring-ai-spring-boot-autoconfigure/src/test/kotlin/org/springframework/ai/autoconfigure/ollama/tool/FunctionCallbackWrapperKotlinIT.kt b/spring-ai-spring-boot-autoconfigure/src/test/kotlin/org/springframework/ai/autoconfigure/ollama/tool/FunctionCallbackWrapperKotlinIT.kt index dd191a90123..0ed9d312170 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/kotlin/org/springframework/ai/autoconfigure/ollama/tool/FunctionCallbackWrapperKotlinIT.kt +++ b/spring-ai-spring-boot-autoconfigure/src/test/kotlin/org/springframework/ai/autoconfigure/ollama/tool/FunctionCallbackWrapperKotlinIT.kt @@ -26,7 +26,6 @@ import org.springframework.ai.autoconfigure.ollama.OllamaAutoConfiguration import org.springframework.ai.chat.messages.UserMessage import org.springframework.ai.chat.prompt.Prompt import org.springframework.ai.model.function.FunctionCallback -import org.springframework.ai.model.function.FunctionCallbackWrapper import org.springframework.ai.model.function.FunctionCallingOptions import org.springframework.ai.ollama.OllamaChatModel import org.springframework.ai.ollama.api.OllamaModel @@ -106,13 +105,13 @@ class FunctionCallbackWrapperKotlinIT : BaseOllamaIT() { @Bean open fun weatherFunctionInfo(): FunctionCallback { - - return FunctionCallbackWrapper.builder(MockKotlinWeatherService()) - .withName("WeatherInfo") - .withInputType(KotlinRequest::class.java) - .withDescription( - "Find the weather conditions, forecasts, and temperatures for a location, like a city or state.") - .build(); + return FunctionCallback.builder() + .description( + "Find the weather conditions, forecasts, and temperatures for a location, like a city or state." + ) + .function("WeatherInfo", MockKotlinWeatherService()) + .inputType(KotlinRequest::class.java) + .build() } }