Skip to content

Commit f1c6c50

Browse files
committed
PMD
1 parent ddae356 commit f1c6c50

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiServiceV2.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)