You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1b973f7
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,7 @@
89
89
- Docs: add Date & Time guide and update prompt/timezone configuration docs.
90
90
- Messages: debounce rapid inbound messages across channels with per-connector overrides. (#971) — thanks @juanpablodlc.
91
91
- Messages: allow media-only sends (CLI/tool) and show Telegram voice recording status for voice notes. (#957) — thanks @rdev.
92
+
- Media: add optional inbound media understanding for image/audio/video with provider + CLI fallbacks. (#1005) — thanks @tristanmanchester.
92
93
- Auth/Status: keep auth profiles sticky per session (rotate on compaction/new), surface provider usage headers in `/status` and `clawdbot models status`, and update docs.
93
94
- CLI: add `--json` output for `clawdbot daemon` lifecycle/install commands.
94
95
- Memory: make `node-llama-cpp` an optional dependency (avoid Node 25 install failures) and improve local-embeddings fallback/errors.
-`prompt`: optional prompt override (image/video append a `maxChars` hint automatically).
1776
+
-`maxChars`: max output characters (default 500 for image/video; unset for audio).
1777
+
-`maxBytes`: max media size to send (defaults: image 10MB, audio 20MB, video 50MB).
1778
+
-`timeoutSeconds`: request timeout (defaults: image 60s, audio 60s, video 120s).
1779
+
-`language`: optional audio hint.
1780
+
-`scope`: optional gating (first match wins) with `match.channel`, `match.chatType`, or `match.keyPrefix`.
1781
+
-`models`: ordered list of model entries; failures or oversize media fall back to the next entry.
1782
+
- Each `models[]` entry:
1783
+
- Provider entry (`type: "provider"` or omitted):
1784
+
-`provider`: API provider id (`openai`, `anthropic`, `google`/`gemini`, `groq`, etc).
1785
+
-`model`: model id override (required for image; defaults to `whisper-1`/`whisper-large-v3-turbo` for audio providers, and `gemini-3-flash-preview` for video).
-`capabilities`: optional list (`image`, `audio`, `video`) to gate a shared entry.
1791
+
-`prompt`, `maxChars`, `maxBytes`, `timeoutSeconds`, `language` can be overridden per entry.
1792
+
1793
+
If no models are configured (or `enabled: false`), understanding is skipped; the model still receives the original attachments.
1794
+
1795
+
Provider auth follows the standard model auth order (auth profiles, env vars like `OPENAI_API_KEY`/`GROQ_API_KEY`/`GEMINI_API_KEY`, or `models.providers.*.apiKey`).
-`model`: default model for spawned sub-agents (string or `{ primary, fallbacks }`). If omitted, sub-agents inherit the caller’s model unless overridden per agent or per call.
1774
1826
-`maxConcurrent`: max concurrent sub-agent runs (default 1)
@@ -2848,7 +2900,7 @@ clawdbot dns setup --apply
2848
2900
2849
2901
## Template variables
2850
2902
2851
-
Template placeholders are expanded in `tools.audio.transcription.args` (and any future templated argument fields).
2903
+
Template placeholders are expanded in `tools.media.*.models[].args` (and any future templated argument fields).
2852
2904
2853
2905
| Variable | Description |
2854
2906
|----------|-------------|
@@ -2864,6 +2916,8 @@ Template placeholders are expanded in `tools.audio.transcription.args` (and any
2864
2916
|`{{MediaPath}}`| Local media path (if downloaded) |
2865
2917
|`{{MediaType}}`| Media type (image/audio/document/…) |
Copy file name to clipboardExpand all lines: docs/nodes/audio.md
+54-19Lines changed: 54 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,38 +3,73 @@ summary: "How inbound audio/voice notes are downloaded, transcribed, and injecte
3
3
read_when:
4
4
- Changing audio transcription or media handling
5
5
---
6
-
# Audio / Voice Notes — 2025-12-05
6
+
# Audio / Voice Notes — 2026-01-17
7
7
8
8
## What works
9
-
-**Optional transcription**: If `tools.audio.transcription` is set in `~/.clawdbot/clawdbot.json`, Clawdbot will:
10
-
1) Download inbound audio to a temp path when WhatsApp only provides a URL.
11
-
2) Run the configured CLI args (templated with `{{MediaPath}}`), expecting transcript on stdout.
12
-
3) Replace `Body` with the transcript, set `{{Transcript}}`, and prepend the original media path plus a `Transcript:` section in the command prompt so models see both.
13
-
4) Continue through the normal auto-reply pipeline (templating, sessions, Pi command).
14
-
-**Verbose logging**: In `--verbose`, we log when transcription runs and when the transcript replaces the body.
9
+
-**Media understanding (audio)**: If `tools.media.audio` is enabled and has `models`, Clawdbot:
10
+
1) Locates the first audio attachment (local path or URL) and downloads it if needed.
11
+
2) Enforces `maxBytes` before sending to each model entry.
12
+
3) Runs the first eligible model entry in order (provider or CLI).
13
+
4) If it fails or skips (size/timeout), it tries the next entry.
14
+
5) On success, it replaces `Body` with an `[Audio]` block and sets `{{Transcript}}`.
15
+
-**Command parsing**: When transcription succeeds, `CommandBody`/`RawBody` are set to the transcript so slash commands still work.
16
+
-**Verbose logging**: In `--verbose`, we log when transcription runs and when it replaces the body.
-We don’t ship a transcriber; you opt in with the Whisper CLI on your PATH.
33
-
-Size guard: inbound audio must be ≤5 MB (matches the temp media store and transcript pipeline).
34
-
-Outbound caps: web send supports audio/voice up to 16 MB (sent as a voice note with `ptt: true`).
35
-
-If transcription fails, we fall back to the original body/media note; replies still go through.
36
-
-Transcript is available to templates as `{{Transcript}}`; models get both the media path and a `Transcript:` block in the prompt when using command mode.
66
+
-Provider auth follows the standard model auth order (auth profiles, env vars, `models.providers.*.apiKey`).
67
+
-Default size cap is 20MB (`tools.media.audio.maxBytes`). Oversize audio is skipped for that model and the next entry is tried.
68
+
-Default `maxChars` for audio is **unset** (full transcript). Set `tools.media.audio.maxChars` or per-entry `maxChars` to trim output.
69
+
-Transcript is available to templates as `{{Transcript}}`.
70
+
-CLI stdout is capped (5MB); keep CLI output concise.
37
71
38
72
## Gotchas
73
+
- Scope rules use first-match wins. `chatType` is normalized to `direct`, `group`, or `room`.
39
74
- Ensure your CLI exits 0 and prints plain text; JSON needs to be massaged via `jq -r .text`.
40
-
- Keep timeouts reasonable (`timeoutSeconds`, default 45s) to avoid blocking the reply queue.
75
+
- Keep timeouts reasonable (`timeoutSeconds`, default 60s) to avoid blocking the reply queue.
Copy file name to clipboardExpand all lines: docs/nodes/images.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,13 +38,23 @@ The WhatsApp channel runs via **Baileys Web**. This document captures the curren
38
38
-`{{MediaUrl}}` pseudo-URL for the inbound media.
39
39
-`{{MediaPath}}` local temp path written before running the command.
40
40
- When a per-session Docker sandbox is enabled, inbound media is copied into the sandbox workspace and `MediaPath`/`MediaUrl` are rewritten to a relative path like `media/inbound/<filename>`.
41
-
- Audio transcription (if configured via `tools.audio.transcription`) runs before templating and can replace `Body` with the transcript.
41
+
- Media understanding (if configured via `tools.media.*`) runs before templating and can insert `[Image]`, `[Audio]`, and `[Video]` blocks into `Body`.
42
+
- Audio sets `{{Transcript}}` and uses the transcript for command parsing so slash commands still work.
43
+
- Video and image descriptions preserve any caption text for command parsing.
44
+
- Only the first matching image/audio/video attachment is processed; remaining attachments are left untouched.
0 commit comments