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

   https://issues.apache.org/jira/browse/CAMEL-26962
   
   The AI clients of the Camel CLI (`camel ask`, `camel explain`, `camel 
overview --ai` and the AI panel) call Anthropic through `LlmClient`. Every 
request had a `temperature`. Claude Opus 5.5 refuses it, and Claude Sonnet 5.5 
refuses a value other than the default. From API version `2026-10-21`, every 
model refuses the field.
   
   ## Changes
   
   - No `temperature`, `top_p` or `top_k` in the requests to Anthropic. The 
other providers keep the temperature.
   - API version `2026-10-21`: in the `anthropic-version` header, and on Vertex 
AI in the `anthropic_version` of the body.
   - The default model is `claude-sonnet-5-5`.
   - `max_tokens` is at least 16,000 for Anthropic. The current models think 
before they answer, and the thinking counts toward `max_tokens`, so the 4096 
that the commands ask for could cut long answers off.
   - Thinking blocks: in a tool loop, the answers go back as they came, 
thinking blocks included, as the API asks. The thinking blocks of earlier 
questions are left out. The AI panel compacts that part of the history, and the 
API refuses a thinking block when the history before it changed. Leaving out 
the thinking blocks at the start of the history is allowed.
   - Prompt caching in a tool loop: a breakpoint after the system prompt, so 
the tools and the system prompt stay cached when the history changes, and the 
automatic breakpoint at the end of the request. One-shot calls (`camel 
explain`, the overviews) stay uncached: there a cache write would only cost 
more.
   - Token usage: Anthropic's `input_tokens` counts only the part of the prompt 
that is not cached. The prompt size now adds the tokens read from the cache and 
written to it, as the other providers count it.
   - A refusal with no content is shown as a refusal, not as an empty answer.
   - No Vertex AI name for Claude Sonnet 4.5, which retires on Nov 30 2026. The 
full name `claude-sonnet-4-5@20250929` still works.
   - Docs: the AI setup guides recommend the MLX build `qwen3.6:35b-mlx` on a 
Mac with Apple Silicon and Ollama 0.40 or later, as the user manual already 
does. The `--temperature` help of `camel explain` and `camel overview` says 
that it is not sent to Anthropic. The AI panel page says that the panel turns 
prompt caching on with Anthropic.
   
   ## Tests
   
   Unit tests with the fake LLM server check:
   - the request: no temperature, the API version header, `max_tokens`, and 
both cache breakpoints;
   - the token usage sum;
   - the thinking blocks: those of a tool loop go back as they came, and none 
from before the question;
   - no cache for an explanation;
   - the refusal and the default model;
   - that the AI panel's tool loop keeps the answer as it came.
   
   Not tested against the API: there is no API key on the test machine. The 
rules are from the Claude API documentation and its migration guide: 
https://platform.claude.com/docs/en/api/migration-2026-10-21
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_016Y4dDi5iQNgtHrDdz2NpwF
   


-- 
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