ai: send images directly to llamacpp chat models + add ResolvedBackend

llamacpp models now receive images via OpenAI content-parts instead of
the describe-then-inline strategy (hybrid mode unchanged). Fixes
assistant messages with tool_calls emitting content: null instead of ""
to satisfy strict Jinja template role-alternation checks. Adds debug
logging of message role sequences on llamacpp requests.

Introduces BackendKind enum, SamplingOverrides, and ResolvedBackend in
a new backend.rs module. InsightGenerator::resolve_backend centralises
client construction + vision capability detection — next step wires the
existing inline dispatch through it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cameron CordesandClaude Opus 4.7 committed 2026-05-24 14:00:37 -04:00
1 parent be51421b38
commit 0631820fbf
6 files changed
+395 -70

No files matched your search

+1 -1
View File
@@ -495,7 +495,7 @@ pub async fn get_available_models_handler(
.iter()
.map(|name| ModelCapabilities {
name: name.clone(),
has_vision: name == &lc.vision_model,
has_vision: true,
has_tool_calling: true,
})
.collect();