From f772ed8bb97cfae73bcffc8323e803599d3460ac Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 10 Nov 2026 12:15:35 +0100 Subject: feat: models event reports each local model's inputs Co-Authored-By: Claude Opus 5.5 --- assistant.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'assistant.py') diff --git a/assistant.py b/assistant.py index fa8aee0..a7f1e71 100644 --- a/assistant.py +++ b/assistant.py @@ -872,7 +872,10 @@ def send_models(): PROVIDERS.update(load_providers([p for p in CFG["cloud"] if p["name"] not in PROVIDERS])) try: with urllib.request.urlopen(CFG["llm"] + "/models", timeout=10) as r: - local = [{"id": m["id"], "status": m["status"]["value"], "cloud": False} + # inputs as model_inputs() reads them, so a client can grey out + # a mic for a model that cannot hear; None when not reported. + local = [{"id": m["id"], "status": m["status"]["value"], "cloud": False, + "inputs": (m.get("architecture") or {}).get("input_modalities")} for m in json.load(r)["data"]] except (OSError, KeyError, TypeError, ValueError): local = [] # router down: the cloud ones still show @@ -2005,7 +2008,7 @@ def test(): # whose key loaded. send(type="models") items = until("models")[-1]["items"] - assert {"id": "m", "status": "loaded", "cloud": False} in items + assert {"id": "m", "status": "loaded", "cloud": False, "inputs": ["text", "image"]} in items assert {"id": "fake:vendor/x:free", "provider": "fake", "cloud": True} in items assert not [i for i in items if i["id"].startswith("broken:")] send(type="ask", text="x", model="") -- cgit v1.2.3