davsclaus opened a new pull request, #27971:
URL: https://github.com/apache/camel/pull/27971

   Seventh batch of 
[CAMEL-23688](https://issues.apache.org/jira/browse/CAMEL-23688) (test coverage 
of the CLI commands): `camel explain` (9% line coverage before) and `camel 
harden` (14%).
   
   ### Tests
   - `FakeLlmServer` (new test helper): a local `HttpServer` that plays Ollama 
(its models, the answer whole or streamed in two parts) and an 
OpenAI-compatible chat completion, and keeps the last question, so a test can 
check the prompt the command sent.
   - `ExplainTest` (new): the explanation (streamed and not), `--show-prompt` 
with `--format=markdown` and `--verbose`, `--catalog-context` (the components 
and EIPs of the route in the prompt), `--system-prompt`, the API key in the 
configuration, and the errors.
   - `HardenTest` (new): the suggestions from Ollama and from an 
OpenAI-compatible service, `--show-prompt`, an `--url` that does not answer 
(the route is not sent to the Ollama of the host), and an unknown `--format`.
   
   ### Bugs the tests found
   - **`camel harden --api-type=openai`** printed only the header: with 
`--stream` (the default) it took the answer as already printed, but the 
OpenAI-compatible call answers in one go. It now prints the answer unless it 
was streamed.
   - **Output channels**: `camel explain` and `camel harden` printed the LLM 
configuration, the progress (`Analyzing route with ...`) and the prompts of 
`--show-prompt` on stdout, mixed with the answer. They go to stderr now, as 
`camel overview --ai` does, so `camel explain route.yaml > explanation.md` 
keeps only the answer (with the header of each file).
   - **`--format`**: an unknown value (`--format=json`) was ignored; now a 
usage error (`2`), before anything is sent to an LLM.
   - **API key**: the configuration showed `****` and the last four characters, 
which is the whole key when it has four or fewer; a key of eight characters or 
fewer is not shown.
   
   The user-visible changes are in the 4.24 upgrade guide.
   
   `mvn test` of camel-jbang-core: all tests pass.
   
   _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]

Reply via email to