From bf4820c68fe58d442004f3db1aab9a5d86debc3d Mon Sep 17 00:00:00 2001 From: JeffJiang Date: Thu, 15 May 2025 10:39:53 +0800 Subject: [PATCH] Check the output links are hallucinations from AI (#139) * feat: check output links if a hallucination from AI --- .../app/chat/components/research-block.tsx | 18 ++++++- .../chat/components/research-report-block.tsx | 4 +- web/src/components/deer-flow/link.tsx | 50 +++++++++++++++++++ web/src/components/deer-flow/markdown.tsx | 15 ++---- web/src/core/store/store.ts | 11 ++++ web/src/styles/prosemirror.css | 4 ++ 6 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 web/src/components/deer-flow/link.tsx diff --git a/web/src/app/chat/components/research-block.tsx b/web/src/app/chat/components/research-block.tsx index 36f47c2..d02d59d 100644 --- a/web/src/app/chat/components/research-block.tsx +++ b/web/src/app/chat/components/research-block.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2025 Bytedance Ltd. and/or its affiliates // SPDX-License-Identifier: MIT -import { Check, Copy, Headphones, X } from "lucide-react"; +import { Check, Copy, Headphones, Pencil, Undo2, X } from "lucide-react"; import { useCallback, useEffect, useState } from "react"; import { ScrollContainer } from "~/components/deer-flow/scroll-container"; @@ -47,6 +47,7 @@ export function ResearchBlock({ await listenToPodcast(researchId); }, [researchId]); + const [editing, setEditing] = useState(false); const [copied, setCopied] = useState(false); const handleCopy = useCallback(() => { if (!reportId) { @@ -63,6 +64,10 @@ export function ResearchBlock({ }, 1000); }, [reportId]); + const handleEdit = useCallback(() => { + setEditing((editing) => !editing); + }, []); + // When the research id changes, set the active tab to activities useEffect(() => { if (!hasReport) { @@ -87,6 +92,16 @@ export function ResearchBlock({ + + +