diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-10 16:55:40 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-10 16:55:40 +0100 |
| commit | 87e5b715075fb56343d2d10a6a532d04d8fc615b (patch) | |
| tree | 571764784ff69cf604d2b47cb6ff2d0e189a6592 /deckit/modules/assistant.py | |
| parent | 5a6359af175a0dac3c7c03d7b76bdaa59dadcb61 (diff) | |
| download | deck-it-87e5b715075fb56343d2d10a6a532d04d8fc615b.tar.gz deck-it-87e5b715075fb56343d2d10a6a532d04d8fc615b.zip | |
feat(assistant): the transcript as chat bubbles with avatars
Questions sit on the right in an accent bubble with the user's avatar
(`[assistant] user_avatar`, served at /api/avatar); replies on the left
in a surface bubble with the assistant's, a "…" bubble while a reply has
no text yet. The assistant's avatar is the background picture itself,
zoomed by CSS onto `[assistant] face` ([centre x, centre y, size] in its
pixels), so nothing is cropped on the PC; the page loads the picture once
for its real size. Unset, both are plain circles.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'deckit/modules/assistant.py')
| -rw-r--r-- | deckit/modules/assistant.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/deckit/modules/assistant.py b/deckit/modules/assistant.py index f0b3947..4355cfa 100644 --- a/deckit/modules/assistant.py +++ b/deckit/modules/assistant.py @@ -127,6 +127,9 @@ def qarma_args(item, kinds): def make(cfg: dict) -> Module: shell = os.path.expanduser(cfg.get("assistant", {}).get("shell", "")) + face = cfg.get("assistant", {}).get("face") or None + if not (isinstance(face, list) and len(face) == 3 and all(isinstance(v, (int, float)) for v in face)): + face = None # [centre x, centre y, size] in the background image, else a plain circle lock = threading.Lock() # guards st send_lock = threading.Lock() # one writer on the socket at a time voice_lock = threading.Lock() @@ -201,6 +204,7 @@ def make(cfg: dict) -> Module: out = json.loads(json.dumps(st)) # a copy: the reader keeps writing out["wanted"] = wanted() out["hears"] = hears(st["models"], out["wanted"]) + out["face"] = face return out def model(body): |
