mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-12 10:04:45 +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 };
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ import type { AgentThreadContext } from "../threads";
|
||||
|
||||
export const DEFAULT_LOCAL_SETTINGS: LocalSettings = {
|
||||
context: {
|
||||
model_name: "deepseek-v3.2",
|
||||
model_name: undefined,
|
||||
thinking_enabled: true,
|
||||
is_plan_mode: false,
|
||||
is_plan_mode: true,
|
||||
},
|
||||
layout: {
|
||||
sidebar_collapsed: false,
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface AgentThread extends Thread<AgentThreadState> {}
|
||||
|
||||
export interface AgentThreadContext extends Record<string, unknown> {
|
||||
thread_id: string;
|
||||
model_name: string;
|
||||
model_name: string | undefined;
|
||||
thinking_enabled: boolean;
|
||||
is_plan_mode: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user