File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,12 @@ public OpenAiChatCompletionResponse chatCompletionImage(@Nonnull final String li
9999 * @param unit The unit of temperature to use.
100100 * @return The assistant message response.
101101 */
102+ @ Nonnull
102103 public OpenAiChatCompletionResponse chatCompletionToolExecution (
103104 @ Nonnull final String location , @ Nonnull final String unit ) {
104105
105106 // 1. Define the function
106- Map <String , Object > schemaMap = generateSchema (WeatherMethod .Request .class );
107+ final Map <String , Object > schemaMap = generateSchema (WeatherMethod .Request .class );
107108 final var function =
108109 new FunctionObject ()
109110 .name ("weather" )
@@ -129,9 +130,9 @@ public OpenAiChatCompletionResponse chatCompletionToolExecution(
129130 "Expected a function call, but got: %s" .formatted (assistantMessage ));
130131 }
131132
132- WeatherMethod .Request arguments =
133+ final WeatherMethod .Request arguments =
133134 parseJson (functionCall .getArguments (), WeatherMethod .Request .class );
134- WeatherMethod .Response weatherMethod = WeatherMethod .getCurrentWeather (arguments );
135+ final WeatherMethod .Response weatherMethod = WeatherMethod .getCurrentWeather (arguments );
135136
136137 messages .add (OpenAiMessage .tool (weatherMethod .toString (), functionCall .getId ()));
137138
You can’t perform that action at this time.
0 commit comments