feat: add Replay Mode

This commit is contained in:
Li Xin
2025-04-24 21:51:08 +08:00
parent 3735706065
commit cb4b7b7495
10 changed files with 1035 additions and 40 deletions

View File

@@ -39,7 +39,7 @@ export const useStore = create<{
}));
export async function sendMessage(
content: string,
content?: string,
{
interruptFeedback,
}: {
@@ -47,13 +47,15 @@ export async function sendMessage(
} = {},
options: { abortSignal?: AbortSignal } = {},
) {
appendMessage({
id: nanoid(),
threadId: THREAD_ID,
role: "user",
content: content,
contentChunks: [content],
});
if (content !== undefined) {
appendMessage({
id: nanoid(),
threadId: THREAD_ID,
role: "user",
content: content,
contentChunks: [content],
});
}
setResponding(true);
try {
@@ -104,7 +106,7 @@ export async function sendMessage(
};
}
const stream = chatStream(
content,
content ?? "[REPLAY]",
{
thread_id: THREAD_ID,
auto_accepted_plan: generalSettings.autoAcceptedPlan,