summaryrefslogtreecommitdiffhomepage
path: root/src/features/chat/model-select.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-27 20:49:43 +0900
committerAdam Malczewski <[email protected]>2026-06-27 20:49:43 +0900
commit5f97ad6468e857b2dc0dc6567c1d60a55ce1e897 (patch)
tree628dffb232ae80219de498be2bb86885fabd6b18 /src/features/chat/model-select.ts
parent129c8344636a645cfc56b863a7df6e8e93a57e5b (diff)
parentf3f2647b3c6b6d12941f5bd8f5ddcf322aadb139 (diff)
downloaddispatch-web-5f97ad6468e857b2dc0dc6567c1d60a55ce1e897.tar.gz
dispatch-web-5f97ad6468e857b2dc0dc6567c1d60a55ce1e897.zip
Merge branch 'feature/vision-handoff' into dev
# Conflicts: # .dispatch/transport-contract.reference.md # backend-handoff.md # src/app/App.svelte # src/features/chat/ui/Composer.svelte
Diffstat (limited to 'src/features/chat/model-select.ts')
-rw-r--r--src/features/chat/model-select.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/features/chat/model-select.ts b/src/features/chat/model-select.ts
index db41772..602e0ef 100644
--- a/src/features/chat/model-select.ts
+++ b/src/features/chat/model-select.ts
@@ -1,3 +1,5 @@
+import type { ModelMetadata } from "@dispatch/transport-contract";
+
/**
* Pure helpers for the two-step model picker.
*
@@ -47,3 +49,16 @@ export function modelsForKey(models: readonly string[], key: string): string[] {
}
return out;
}
+
+/**
+ * Whether a given full model name (`<key>/<model>`) is vision-capable — i.e.
+ * `GET /models` `modelInfo[name].vision === true`. Absent/`false`/unknown →
+ * `false` (the server's vision handoff transcribes images to text for it).
+ * Pure lookup against the catalog metadata; zero DOM.
+ */
+export function isVisionModel(
+ modelInfo: Readonly<Record<string, ModelMetadata>>,
+ fullName: string,
+): boolean {
+ return modelInfo[fullName]?.vision === true;
+}