Skip to content

Commit 2864754

Browse files
committed
Fix Kotlin test deprecation warning
1 parent f5b00a0 commit 2864754

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

spring-ai-spring-boot-autoconfigure/src/test/kotlin/org/springframework/ai/autoconfigure/ollama/tool/FunctionCallbackWrapperKotlinIT.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import org.springframework.ai.autoconfigure.ollama.OllamaAutoConfiguration
2626
import org.springframework.ai.chat.messages.UserMessage
2727
import org.springframework.ai.chat.prompt.Prompt
2828
import org.springframework.ai.model.function.FunctionCallback
29-
import org.springframework.ai.model.function.FunctionCallbackWrapper
3029
import org.springframework.ai.model.function.FunctionCallingOptions
3130
import org.springframework.ai.ollama.OllamaChatModel
3231
import org.springframework.ai.ollama.api.OllamaModel
@@ -106,13 +105,13 @@ class FunctionCallbackWrapperKotlinIT : BaseOllamaIT() {
106105

107106
@Bean
108107
open fun weatherFunctionInfo(): FunctionCallback {
109-
110-
return FunctionCallbackWrapper.builder(MockKotlinWeatherService())
111-
.withName("WeatherInfo")
112-
.withInputType(KotlinRequest::class.java)
113-
.withDescription(
114-
"Find the weather conditions, forecasts, and temperatures for a location, like a city or state.")
115-
.build();
108+
return FunctionCallback.builder()
109+
.description(
110+
"Find the weather conditions, forecasts, and temperatures for a location, like a city or state."
111+
)
112+
.function("WeatherInfo", MockKotlinWeatherService())
113+
.inputType(KotlinRequest::class.java)
114+
.build()
116115
}
117116

118117
}

0 commit comments

Comments
 (0)