mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-14 22:52:15 +02:00
feat(model-connections): add provider-specific connection forms and shared components
This commit is contained in:
parent
ced1bb85ed
commit
356f0e56c5
15 changed files with 1423 additions and 574 deletions
|
|
@ -0,0 +1,25 @@
|
|||
import type { ModelRead } from "@/contracts/types/model-connections.types";
|
||||
|
||||
export type ModelCapabilityFilter = "chat" | "vision" | "image_gen";
|
||||
|
||||
export const MODEL_CAPABILITY_FILTERS: { key: ModelCapabilityFilter; label: string }[] = [
|
||||
{ key: "chat", label: "Chat" },
|
||||
{ key: "vision", label: "Vision" },
|
||||
{ key: "image_gen", label: "Image" },
|
||||
];
|
||||
|
||||
export function modelLabel(model: ModelRead) {
|
||||
return model.display_name || model.model_id;
|
||||
}
|
||||
|
||||
export function capability(model: ModelRead, key: ModelCapabilityFilter) {
|
||||
if (key === "chat") return Boolean(model.supports_chat);
|
||||
if (key === "vision") return Boolean(model.supports_image_input);
|
||||
return Boolean(model.supports_image_generation);
|
||||
}
|
||||
|
||||
export function capabilityLabels(model: ModelRead) {
|
||||
return MODEL_CAPABILITY_FILTERS.filter((filter) => capability(model, filter.key))
|
||||
.map((filter) => filter.label.toLowerCase())
|
||||
.join(", ");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue