Skip to content

Commit edad77d

Browse files
fix
1 parent d55d82a commit edad77d

File tree

3 files changed

+0
-76
lines changed

3 files changed

+0
-76
lines changed

sample-code/spring-app/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@
118118
<groupId>com.fasterxml.jackson.core</groupId>
119119
<artifactId>jackson-core</artifactId>
120120
</dependency>
121-
<dependency>
122-
<groupId>com.fasterxml.jackson.core</groupId>
123-
<artifactId>jackson-annotations</artifactId>
124-
</dependency>
125121
<!-- scope "runtime" -->
126122
<dependency>
127123
<groupId>ch.qos.logback</groupId>

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
public class OpenAiController {
2727
@Autowired private OpenAiService service;
2828

29-
/** Chat request to OpenAI */
3029
@GetMapping("/chatCompletion")
3130
@Nonnull
3231
Object chatCompletion(
@@ -38,7 +37,6 @@ Object chatCompletion(
3837
return response.getContent();
3938
}
4039

41-
/** Asynchronous stream of an OpenAI chat request */
4240
@SuppressWarnings("unused") // The end-to-end test doesn't use this method
4341
@GetMapping("/streamChatCompletionDeltas")
4442
@Nonnull
@@ -65,7 +63,6 @@ ResponseEntity<ResponseBodyEmitter> streamChatCompletionDeltas() {
6563
return ResponseEntity.ok().contentType(MediaType.TEXT_EVENT_STREAM).body(emitter);
6664
}
6765

68-
/** Asynchronous stream of an OpenAI chat request */
6966
@SuppressWarnings("unused") // The end-to-end test doesn't use this method
7067
@GetMapping("/streamChatCompletion")
7168
@Nonnull
@@ -117,7 +114,6 @@ private static String objectToJson(@Nonnull final Object obj) {
117114
}
118115
}
119116

120-
/** Chat request to OpenAI with an image */
121117
@GetMapping("/chatCompletionImage")
122118
@Nonnull
123119
Object chatCompletionImage(
@@ -131,7 +127,6 @@ Object chatCompletionImage(
131127
return response.getContent();
132128
}
133129

134-
/** Chat request to OpenAI with a tool. */
135130
@GetMapping("/chatCompletionTool")
136131
@Nonnull
137132
Object chatCompletionTools(
@@ -144,14 +139,12 @@ Object chatCompletionTools(
144139
return response.getContent();
145140
}
146141

147-
/** Get the embedding of a text */
148142
@GetMapping("/embedding")
149143
@Nonnull
150144
Object embedding() {
151145
return service.embedding("Hello world");
152146
}
153147

154-
/** Chat request to OpenAI filtering by resource group */
155148
@GetMapping("/chatCompletion/{resourceGroup}")
156149
@Nonnull
157150
Object chatCompletionWithResource(

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

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
class OrchestrationController {
3030
@Autowired private OrchestrationService service;
3131

32-
/** Chat request to an LLM through the Orchestration service with a simple prompt. */
3332
@GetMapping("/completion")
3433
Object completion(@Nullable @RequestParam(value = "view", required = false) final String view) {
3534
final var response = service.completion("HelloWorld!");
@@ -39,11 +38,6 @@ Object completion(@Nullable @RequestParam(value = "view", required = false) fina
3938
return response.getContent();
4039
}
4140

42-
/**
43-
* Asynchronous stream of an LLM chat request
44-
*
45-
* @return the emitter that streams the assistant message response
46-
*/
4741
@GetMapping("/streamChatCompletion")
4842
ResponseEntity<ResponseBodyEmitter> streamChatCompletion() {
4943
final var stream = service.streamChatCompletion("developing a software project");
@@ -67,12 +61,6 @@ ResponseEntity<ResponseBodyEmitter> streamChatCompletion() {
6761
return ResponseEntity.ok().contentType(MediaType.TEXT_EVENT_STREAM).body(emitter);
6862
}
6963

70-
/**
71-
* Chat request to an LLM through the Orchestration service with a template.
72-
*
73-
* @link <a href="https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/templating">SAP
74-
* AI Core: Orchestration - Templating</a>
75-
*/
7664
@GetMapping("/template")
7765
Object template(@Nullable @RequestParam(value = "view", required = false) final String view) {
7866
final var response = service.template("German");
@@ -82,7 +70,6 @@ Object template(@Nullable @RequestParam(value = "view", required = false) final
8270
return response.getContent();
8371
}
8472

85-
/** Chat request to an LLM through the Orchestration service using message history. */
8673
@GetMapping("/messagesHistory")
8774
@Nonnull
8875
Object messagesHistory(
@@ -94,19 +81,6 @@ Object messagesHistory(
9481
return response.getContent();
9582
}
9683

97-
/**
98-
* Send an HTTP GET request for input filtering to the Orchestration service.
99-
*
100-
* @link <a
101-
* href="https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/input-filtering">SAP
102-
* * AI Core: Orchestration - Input Filtering</a>
103-
* @param view an optional HTTP header specifying the desired content type for the response.
104-
* @param policy path variable specifying the {@link AzureFilterThreshold} the explicitness of
105-
* content that should be allowed through the filter
106-
* @return a {@link ResponseEntity} containing the filtered input. The response is either in JSON
107-
* format if the "accept" header specifies "application/json" or in plain content format
108-
* otherwise.
109-
*/
11084
@GetMapping("/inputFiltering/{policy}")
11185
@Nonnull
11286
Object inputFiltering(
@@ -128,19 +102,6 @@ Object inputFiltering(
128102
return response.getContent();
129103
}
130104

131-
/**
132-
* Send an HTTP GET request for output filtering to the Orchestration service.
133-
*
134-
* @link <a
135-
* href="https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/output-filtering">SAP
136-
* AI Core: Orchestration - Output Filtering</a>
137-
* @param view an optional HTTP header specifying the desired content type for the response.
138-
* @param policy a mandatory path variable specifying the {@link AzureFilterThreshold} the
139-
* explicitness of content that should be allowed through the filter
140-
* @return a {@link ResponseEntity} containing the filtered output. The response is either in JSON
141-
* format if the "accept" header specifies "application/json" or in plain content format
142-
* otherwise.
143-
*/
144105
@GetMapping("/outputFiltering/{policy}")
145106
@Nonnull
146107
Object outputFiltering(
@@ -162,15 +123,6 @@ Object outputFiltering(
162123
return response.getContent();
163124
}
164125

165-
/**
166-
* Let the orchestration service evaluate the feedback on the AI SDK provided by a hypothetical
167-
* user. Anonymize any names given as they are not relevant for judging the sentiment of the
168-
* feedback.
169-
*
170-
* @link <a
171-
* href="https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/data-masking">SAP AI
172-
* Core: Orchestration - Data Masking</a>
173-
*/
174126
@GetMapping("/maskingAnonymization")
175127
@Nonnull
176128
Object maskingAnonymization(
@@ -182,9 +134,6 @@ Object maskingAnonymization(
182134
return response.getContent();
183135
}
184136

185-
/**
186-
* Chat request to an LLM through the Orchestration deployment under a specific resource group.
187-
*/
188137
@GetMapping("/completion/{resourceGroup}")
189138
@Nonnull
190139
Object completionWithResourceGroup(
@@ -197,14 +146,6 @@ Object completionWithResourceGroup(
197146
return response.getContent();
198147
}
199148

200-
/**
201-
* Let the orchestration service a response to a hypothetical user who provided feedback on the AI
202-
* SDK. Pseudonymize the user's name and location to protect their privacy.
203-
*
204-
* @link <a
205-
* href="https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/data-masking">SAP AI
206-
* Core: Orchestration - Data Masking</a>
207-
*/
208149
@GetMapping("/maskingPseudonymization")
209150
@Nonnull
210151
Object maskingPseudonymization(
@@ -216,12 +157,6 @@ Object maskingPseudonymization(
216157
return response.getContent();
217158
}
218159

219-
/**
220-
* Using grounding to provide additional context to the AI model.
221-
*
222-
* @link <a href="https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/grounding">SAP
223-
* AI Core: Orchestration - Grounding</a>
224-
*/
225160
@GetMapping("/grounding")
226161
@Nonnull
227162
Object grounding(@Nullable @RequestParam(value = "view", required = false) final String view) {

0 commit comments

Comments
 (0)