Skip to content

Commit b14d70c

Browse files
committed
Align with docs
1 parent 9ff262b commit b14d70c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class SpringAiAgenticWorkflowController {
2323
Object completion(
2424
@Nullable @RequestParam(value = "format", required = false) final String format) {
2525
val response =
26-
service.chain("I want to do a one-day trip to Paris. Help me make an itinerary, please");
26+
service.runAgent("I want to do a one-day trip to Paris. Help me make an itinerary, please");
2727

2828
if ("json".equals(format)) {
2929
return ((OrchestrationSpringChatResponse) response)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class SpringAiAgenticWorkflowService {
2525
new OrchestrationModuleConfig().withLlmConfig(GPT_4O_MINI);
2626

2727
@Nonnull
28-
public ChatResponse chain(String userInput) {
28+
public ChatResponse runAgent(String userInput) {
2929

3030
// Configure chat memory
3131
val memory = new InMemoryChatMemory();
@@ -54,11 +54,11 @@ public ChatResponse chain(String userInput) {
5454

5555
for (String systemPrompt : systemPrompts) {
5656

57-
// 1. Compose the input using the response from the previous step.
57+
// Combine the pre-defined prompt with the previous answer to get the new input
5858
String input = String.format("{%s}\n {%s}", systemPrompt, responseText);
5959
val prompt = new Prompt(input, options);
6060

61-
// 2. Call the chat client with the new input and get the new response.
61+
// Make a call to the LLM with the new input
6262
response =
6363
Objects.requireNonNull(
6464
cl.prompt(prompt).call().chatResponse(), "Chat response is null in step " + step);

0 commit comments

Comments
 (0)