2023-11-08 19:01:29 +00:00
|
|
|
import { useMemo } from "react";
|
|
|
|
import { useAccessStore, useAppConfig } from "../store";
|
|
|
|
import { collectModels } from "./model";
|
|
|
|
|
|
|
|
export function useAllModels() {
|
|
|
|
const accessStore = useAccessStore();
|
|
|
|
const configStore = useAppConfig();
|
|
|
|
const models = useMemo(() => {
|
|
|
|
return collectModels(
|
|
|
|
configStore.models,
|
2023-11-11 16:29:36 +00:00
|
|
|
[configStore.customModels, accessStore.customModels].join(","),
|
2023-11-08 19:01:29 +00:00
|
|
|
);
|
|
|
|
}, [accessStore.customModels, configStore.customModels, configStore.models]);
|
|
|
|
|
|
|
|
return models;
|
|
|
|
}
|