mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-26 23:34:47 +08:00
feat: add autoAcceptedPlan to options
This commit is contained in:
@@ -12,6 +12,7 @@ export function chatStream(
|
||||
userMessage: string,
|
||||
params: {
|
||||
thread_id: string;
|
||||
auto_accepted_plan: boolean;
|
||||
max_plan_iterations: number;
|
||||
max_step_num: number;
|
||||
interrupt_feedback?: string;
|
||||
@@ -33,7 +34,6 @@ export function chatStream(
|
||||
return fetchStream<ChatEvent>(resolveServiceURL("chat/stream"), {
|
||||
body: JSON.stringify({
|
||||
messages: [{ role: "user", content: userMessage }],
|
||||
auto_accepted_plan: false,
|
||||
...params,
|
||||
}),
|
||||
signal: options.abortSignal,
|
||||
@@ -44,11 +44,13 @@ async function* chatStreamMock(
|
||||
userMessage: string,
|
||||
params: {
|
||||
thread_id: string;
|
||||
auto_accepted_plan: boolean;
|
||||
max_plan_iterations: number;
|
||||
max_step_num: number;
|
||||
interrupt_feedback?: string;
|
||||
} = {
|
||||
thread_id: "__mock__",
|
||||
auto_accepted_plan: false,
|
||||
max_plan_iterations: 3,
|
||||
max_step_num: 1,
|
||||
interrupt_feedback: undefined,
|
||||
|
||||
@@ -9,6 +9,7 @@ const SETTINGS_KEY = "deerflow.settings";
|
||||
|
||||
const DEFAULT_SETTINGS: SettingsState = {
|
||||
general: {
|
||||
autoAcceptedPlan: false,
|
||||
maxPlanIterations: 1,
|
||||
maxStepNum: 3,
|
||||
},
|
||||
@@ -44,6 +45,7 @@ const DEFAULT_SETTINGS: SettingsState = {
|
||||
|
||||
export type SettingsState = {
|
||||
general: {
|
||||
autoAcceptedPlan: boolean;
|
||||
maxPlanIterations: number;
|
||||
maxStepNum: number;
|
||||
};
|
||||
|
||||
@@ -107,6 +107,7 @@ export async function sendMessage(
|
||||
content,
|
||||
{
|
||||
thread_id: THREAD_ID,
|
||||
auto_accepted_plan: generalSettings.autoAcceptedPlan,
|
||||
max_plan_iterations: generalSettings.maxPlanIterations,
|
||||
max_step_num: generalSettings.maxStepNum,
|
||||
interrupt_feedback: interruptFeedback,
|
||||
|
||||
Reference in New Issue
Block a user