ammachado commented on code in PR #24594:
URL: https://github.com/apache/camel/pull/24594#discussion_r3564913656
##########
dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/AiPanel.java:
##########
@@ -187,22 +234,29 @@ void open() {
void close() {
visible = false;
+ providerSwitchPopup.close();
}
void destroy() {
close();
- Thread t = agentThread;
- if (t != null) {
- t.interrupt();
- }
+ stopAgentThread();
}
private void initClient() {
try {
- client = LlmClient.create()
+ LlmClient created = LlmClient.create()
.withTemperature(0.3)
.withTimeout(120)
- .withMaxTokens(4096);
+ .withMaxTokens(4096)
+ .withModel("llama3.2");
Review Comment:
Fixed in 0db17789f02e — removed the hard-coded `llama3.2` call from
`AiPanel.initClient()`. A blank configured model now leaves model selection to
the selected provider, as it did before the provider-switch change.
_AI-generated by Codex on behalf of ammachado._
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/LlmClient.java:
##########
@@ -1126,11 +1215,41 @@ private String sendAnthropicStreamingRequest(String
requestUrl, JsonObject body,
// ---- Endpoint detection helpers ----
+ // Order matters: /api/tags is checked before /v1/models, matching the
original priority.
+ private static final List<Map.Entry<String, ApiType>>
EXPLICIT_URL_HEALTH_CHECK_SUFFIXES = List.of(
Review Comment:
Verified against the pre-change implementation: `tryExplicitUrl()`
previously delegated to `isEndpointReachable(url)`, which already checked `url
+ "/api/tags"`, then `url + "/v1/models"`, then the bare URL. The current
implementation preserves that request order and count; its only added behavior
is inferring `apiType` from a successful known endpoint when no API type was
configured. No code change is needed for this comment.
_AI-generated by Codex 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]