Skip to content

Commit c752e52

Browse files
committed
pom dependency order and controller method params
1 parent a27294f commit c752e52

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

sample-code/spring-app/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@
131131
<groupId>com.fasterxml.jackson.core</groupId>
132132
<artifactId>jackson-annotations</artifactId>
133133
</dependency>
134+
<dependency>
135+
<groupId>com.fasterxml.jackson.module</groupId>
136+
<artifactId>jackson-module-jsonSchema</artifactId>
137+
</dependency>
134138
<!-- scope "runtime" -->
135139
<dependency>
136140
<groupId>ch.qos.logback</groupId>
@@ -186,10 +190,6 @@
186190
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
187191
<artifactId>cloudplatform-connectivity</artifactId>
188192
</dependency>
189-
<dependency>
190-
<groupId>com.fasterxml.jackson.module</groupId>
191-
<artifactId>jackson-module-jsonSchema</artifactId>
192-
</dependency>
193193
</dependencies>
194194

195195
<build>

sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OpenAiController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,10 @@ Object chatCompletionImage(
123123
@GetMapping("/chatCompletionToolExecution")
124124
@Nonnull
125125
Object chatCompletionToolExecution(
126-
@Nullable @RequestParam(value = "format", required = false) final String format) {
127-
final var response = service.chatCompletionToolExecution("Dubai", "°C");
126+
@Nullable @RequestParam(value = "format", required = false) final String format,
127+
@Nonnull @RequestParam(value = "location", defaultValue = "Dubai") final String location,
128+
@Nonnull @RequestParam(value = "unit", defaultValue = "°C") final String unit) {
129+
final var response = service.chatCompletionToolExecution(location, unit);
128130
if ("json".equals(format)) {
129131
return response;
130132
}

0 commit comments

Comments
 (0)