Use FunctionCallbackWrapper builder in Minimax and ZhipuAI docs
This commit is contained in:
committed by
Christian Tzolov
parent
217f944b08
commit
462025de75
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user