ammachado commented on code in PR #24594:
URL: https://github.com/apache/camel/pull/24594#discussion_r3564656442
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/LlmClient.java:
##########
@@ -287,6 +287,95 @@ public ChatResponse chatWithTools(String systemPrompt,
List<Message> messages, L
};
}
+ // -- Model listing --
+
+ /**
+ * Lists model identifiers available from the configured provider:
Ollama's {@code /api/tags}, or the
+ * OpenAI-compatible/Anthropic {@code /v1/models}. Vertex AI has no
equivalent listing endpoint (models come from
+ * the Vertex AI model garden, not the Anthropic API surface), so it
always returns an empty list. Best-effort: any
+ * failure (unreachable endpoint, non-200 response, unexpected JSON shape)
yields an empty list rather than
+ * throwing, since this only feeds the informational {@code /model}
listing in the AI panel.
+ */
+ public List<String> listModels() {
+ if (apiType == null || url == null || url.isBlank()) {
Review Comment:
Documented in the commit message of
ae38606cb33372c942a01f763da8397f7252668b: `tryExplicitUrl()` now probes
`/api/tags` and `/v1/models` before the bare URL and sets `apiType` as a side
effect when a probe succeeds. Custom proxy/gateway URLs that do not serve those
sub-paths still fall through to the bare-URL reachability check, at the cost of
two extra probe round-trips. No behavioral revert; keeping the auto-detection.
_Claude Code on behalf of ammachado_
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Ask.java:
##########
@@ -122,7 +122,8 @@ public Integer doCall() throws Exception {
if (!client.detectEndpoint()) {
printer().printErr("LLM service is not reachable.");
- printer().printErr("Options: --url=<endpoint>,
--api-type=anthropic, or start Ollama with: camel infra run ollama");
+ printer()
Review Comment:
Reverted in ae38606cb33372c942a01f763da8397f7252668b — the `printErr` line
is back to a single line, matching `main`. Confirmed `formatter:format` does
not re-wrap it (the line is within the 128-char limit).
_Claude Code on behalf of ammachado_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]