davsclaus opened a new pull request, #27994: URL: https://github.com/apache/camel/pull/27994
As decided on [CAMEL-23688](https://issues.apache.org/jira/browse/CAMEL-23688) (raised in #27967): **an LLM given with `--url` is the only one used.** ### The change When the LLM given with `--url` did not answer, `LlmClient.detectEndpoint` went on to detect another provider: the Ollama of `camel infra` or of the host (with `--api-type=ollama`), or, without an API type, the whole detection: a hosted provider with an API key in the environment (Anthropic, Azure OpenAI, Gemini, OpenAI, watsonx) or Ollama. The prompts then went to a provider the user did not choose. Now an explicit URL is the only endpoint the client tries: - `camel ask`, `camel explain` and `camel overview --ai` fail with their "not reachable" error when the `--url` does not answer. - The AI panel of the Camel TUI says which URL of its settings does not answer (`No LLM service reachable at <url> (the URL of the AI settings).`), instead of the hint to set an API key. - Without a URL the provider is detected as before. `camel doctor` and the Ollama tab of the TUI probe without one, so they still find the Ollama of `camel infra` or `localhost:11434`. `camel harden` has its own client and already did not fall back. ### Tests - `LlmClientExplicitUrlTest` (new): with an Ollama of `camel infra` always there to find (a pid file in a home of the test and a fake server), an unreachable URL fails with and without an API type and keeps its URL, a URL that answers is used, and without a URL the Ollama of `camel infra` is found. Without the change the two tests of an unreachable URL fail. - `OllamaDoctorSupportTest` asserted the fallback; it asserts that an unreachable URL is not running now, on every host. - `OverviewTest.aiWithoutAnLlmIsAFailure` no longer skips itself on a host that runs Ollama. The AI providers page says what `--url` does, and the change is in the 4.24 upgrade guide. `mvn test` of the LLM client, overview, explain, harden, ask and doctor tests of camel-jbang-core: all pass (160, none skipped). The TUI module compiles. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DDRLJAyf8cDXSg8iX785My -- 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]
