Enhance configuration and model capabilities

This commit is contained in:
decolua
2026-06-16 23:32:28 +07:00
parent b282f05549
commit d03f9fb823
17 changed files with 121 additions and 52 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
"use client";
import { useState, useEffect } from "react";
import { getCapabilitiesForModel } from "open-sse/providers/capabilities.js";
// Fetch model capabilities once and expose a lookup by fullModel ("provider/model") or bare model id.
export function useModelCaps() {
@@ -32,7 +33,11 @@ export function useModelCaps() {
if (!key) return null;
if (byFull[key]) return byFull[key];
const bare = key.includes("/") ? key.slice(key.indexOf("/") + 1) : key;
return byId[bare] || null;
if (byId[bare]) return byId[bare];
// Fallback: compute caps for dynamic models (passthrough/custom/suggested) not in static list
const provider = key.includes("/") ? key.slice(0, key.indexOf("/")) : null;
const c = getCapabilitiesForModel(provider, bare);
return { vision: c.vision, search: c.search, reasoning: c.reasoning };
};
return { getCaps };