diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-10 12:15:35 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-10 12:15:35 +0100 |
| commit | f772ed8bb97cfae73bcffc8323e803599d3460ac (patch) | |
| tree | 6c330143f750bde7cbd4312c38a88550bf30d44b | |
| parent | 00602b3ad7d613a1f575d1e5395406eb6b319c1d (diff) | |
| download | desktop-assistant-f772ed8bb97cfae73bcffc8323e803599d3460ac.tar.gz desktop-assistant-f772ed8bb97cfae73bcffc8323e803599d3460ac.zip | |
feat: models event reports each local model's inputs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| -rw-r--r-- | assistant.py | 7 | ||||
| -rw-r--r-- | docs/superpowers/specs/2026-10-23-cloud-models-design.md | 4 |
2 files changed, 8 insertions, 3 deletions
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="") diff --git a/docs/superpowers/specs/2026-10-23-cloud-models-design.md b/docs/superpowers/specs/2026-10-23-cloud-models-design.md index d2270af..fe5d007 100644 --- a/docs/superpowers/specs/2026-10-23-cloud-models-design.md +++ b/docs/superpowers/specs/2026-10-23-cloud-models-design.md @@ -95,7 +95,9 @@ ids contain `/` and sometimes `:` (OpenRouter's `:free`). model. - **`models` command.** Answers with the router's models (id, status) plus every configured cloud model, each with `cloud: true|false` and, - for cloud, its provider name. Feeds the dropdown. + for cloud, its provider name. Feeds the dropdown. A local item is + `{id, status, cloud: false, inputs}`, `inputs` being the router's + `architecture.input_modalities` or null when not reported. - **`--cloud-models <name>`.** CLI mode: reads `config.toml`, runs that provider's `key_cmd`, prints the provider's `/models` ids as JSON, one array, sorted, and exits. The settings page runs it to fetch the list, |
