Skip to content

Commit d4b98bf

Browse files
ivicacclaude
andcommitted
1570 Address PR review: null-safe Ollama response format and quieter empty-connection log
- OllamaChatAction: guard against a missing responseFormat when a response map is present, avoiding a NullPointerException. - ListConnectionsForComponentToolCallback: log a component with no connection definition at DEBUG instead of WARN; it is an expected case already tracked by the "empty" state metric. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 51b5396 commit d4b98bf

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

server/ee/libs/ai/ai-copilot/ai-copilot-tool/src/main/java/com/bytechef/ee/ai/copilot/tool/ListConnectionsForComponentToolCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public String call(String toolInput, @Nullable ToolContext toolContext) {
148148
} catch (NoSuchElementException exception) {
149149
metrics.recordStateVisibility(TOOL_NAME, "empty");
150150

151-
log.warn(
151+
log.debug(
152152
"Component {} v{} exposes no connection definition; treating as no connections available.",
153153
componentName, componentVersion);
154154

server/libs/modules/components/ai/llm/ollama/src/main/java/com/bytechef/component/ai/llm/ollama/action/OllamaChatAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public class OllamaChatAction {
204204
if (response != null) {
205205
Object responseFormat = response.get(RESPONSE_FORMAT);
206206

207-
if (!responseFormat.equals(ChatModel.ResponseFormat.TEXT.name())) {
207+
if (responseFormat != null && !responseFormat.equals(ChatModel.ResponseFormat.TEXT.name())) {
208208
ollamaChatOptionsBuilder.outputSchema((String) response.get(RESPONSE_SCHEMA));
209209
}
210210
}

0 commit comments

Comments
 (0)