Use FunctionCallbackWrapper builder in Minimax and ZhipuAI docs

This commit is contained in:
Craig Walls
2024-06-14 20:44:16 -06:00
committed by Christian Tzolov
parent 217f944b08
commit 462025de75
2 changed files with 10 additions and 10 deletions

View File

@@ -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.
// NOTE: Functions are registered when MiniMaxChatModel is created, by you must enable in the Prompt the functions to be used in the request.

View File

@@ -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.
// NOTE: Functions are registered when ZhiPuAiChatModel is created, by you must enable in the Prompt the functions to be used in the request.