Skip to content

Commit 6e5fc2b

Browse files
committed
Minor format
1 parent 74094fb commit 6e5fc2b

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationHttpExecutor.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,8 @@ private static void logRequestStart() {
117117
val reqId = UUID.randomUUID().toString().substring(0, 8);
118118
MDC.put("reqId", reqId);
119119
MDC.put("service", "Orchestration");
120-
log.debug(
121-
"[reqId={}] Starting Orchestration {} request to {}, destination={}",
122-
reqId,
123-
MDC.get("mode"),
124-
MDC.get("endpoint"),
125-
MDC.get("destination"));
120+
121+
val msg = "[reqId={}] Starting Orchestration {} request to {}, destination={}";
122+
log.debug(msg, reqId, MDC.get("mode"), MDC.get("endpoint"), MDC.get("destination"));
126123
}
127124
}

orchestration/src/main/java/com/sap/ai/sdk/orchestration/spring/OrchestrationChatModel.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import java.util.List;
1616
import java.util.Map;
1717
import java.util.function.Function;
18+
import java.util.stream.Collectors;
1819
import javax.annotation.Nonnull;
1920
import lombok.extern.slf4j.Slf4j;
2021
import lombok.val;
@@ -73,10 +74,14 @@ public ChatResponse call(@Nonnull final Prompt prompt) {
7374
if (ToolCallingChatOptions.isInternalToolExecutionEnabled(prompt.getOptions())
7475
&& response.hasToolCalls()) {
7576

76-
val toolCalls =
77-
response.getResult().getOutput().getToolCalls().stream().map(ToolCall::name).toList();
78-
log.debug("Executing {} tool call(s) - {}", toolCalls.size(), toolCalls);
77+
if (log.isDebugEnabled()) {
78+
val tools = response.getResult().getOutput().getToolCalls();
79+
val toolsStr = tools.stream().map(ToolCall::name).collect(Collectors.joining(", "));
80+
log.debug("Executing {} tool call(s) - {}", tools.size(), toolsStr);
81+
}
82+
7983
val toolExecutionResult = toolCallingManager.executeToolCalls(prompt, response);
84+
8085
// Send the tool execution result back to the model.
8186
log.debug("Re-invoking LLM with tool execution results.");
8287
return call(new Prompt(toolExecutionResult.conversationHistory(), prompt.getOptions()));

0 commit comments

Comments
 (0)