mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-13 10:24:44 +08:00
feat: auto select the first model as default model
This commit is contained in:
@@ -2,10 +2,11 @@ import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { loadModels } from "./api";
|
||||
|
||||
export function useModels() {
|
||||
export function useModels({ enabled = true }: { enabled?: boolean } = {}) {
|
||||
const { data, isLoading, error } = useQuery({
|
||||
queryKey: ["models"],
|
||||
queryFn: () => loadModels(),
|
||||
enabled,
|
||||
});
|
||||
return { models: data ?? [], isLoading, error };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user