Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion web/src/hooks/use-agent-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ export function useCancelConversation() {
return { data, loading, cancelConversation: mutateAsync };
}

export const useFetchSharedAgent = (): {
export const useFetchFlowSSE = (): {
data: IFlow;
loading: boolean;
refetch: () => void;
Expand All @@ -808,6 +808,7 @@ export const useFetchSharedAgent = (): {
} = useQuery({
queryKey: [AgentApiAction.FetchSharedAgent, sharedId],
initialData: {} as IFlow,
enabled: !!sharedId,
refetchOnReconnect: false,
refetchOnMount: false,
refetchOnWindowFocus: false,
Expand Down
3 changes: 2 additions & 1 deletion web/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,8 @@ General:实体和关系提取提示来自 GitHub - microsoft/graphrag:基于
includeHeadingContentTip:
'启用后,标题下的直接内容将作为一个独立的块保留。子块仅保留标题路径。',
rootAsHeading: '将首个切片设为 H0 标题',
rootAsHeadingTip: '将首个切片设为全局标题,以确保整个文档层级结构中拥有一致的上下文信息。该功能尤其适用于首段包含关键信息的简历。',
rootAsHeadingTip:
'将首个切片设为全局标题,以确保整个文档层级结构中拥有一致的上下文信息。该功能尤其适用于首段包含关键信息的简历。',
hierarchyTip: `构建标题树并生成独立的块,每个块携带其完整的祖先标题路径(例如 第1部分 › 第3章 › 第2节 + 正文)。\n
适用场景:具有独立的、结构性重要章节的文档——如法律条款、法规、合同和技术规范——其中每个块即使没有上下文也能通过其结构位置来识别。`,
groupTip: `在选定的标题级别将文档扁平分割,并自动合并相邻的小节以保持内容连续性。不注入父标题路径。\n
Expand Down
8 changes: 2 additions & 6 deletions web/src/pages/next-chats/share/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import MessageItem from '@/components/message-item';
import PdfSheet from '@/components/pdf-drawer';
import { useClickDrawer } from '@/components/pdf-drawer/hooks';
import { useSyncThemeFromParams } from '@/components/theme-provider';
import { MessageType, SharedFrom } from '@/constants/chat';
import { useFetchSharedAgent } from '@/hooks/use-agent-request';
import { MessageType } from '@/constants/chat';
import { useFetchExternalChatInfo } from '@/hooks/use-chat-request';
import i18n, { changeLanguageAsync } from '@/locales/config';
import { buildMessageUuidWithRole } from '@/utils/chat';
Expand All @@ -20,7 +19,6 @@ import { buildMessageItemReference } from '../utils';
const ChatContainer = () => {
const {
sharedId: conversationId,
from,
locale,
theme,
visibleAvatar,
Expand All @@ -44,15 +42,13 @@ const ChatContainer = () => {
const sendDisabled = useSendButtonDisabled(value);
const { data: chatInfo } = useFetchExternalChatInfo();

const { data: flowData } = useFetchSharedAgent();
React.useEffect(() => {
if (locale && i18n.language !== locale) {
changeLanguageAsync(locale);
}
}, [locale, visibleAvatar]);

const avatarDialogSrc =
from === SharedFrom.Agent ? flowData?.avatar : chatInfo.avatar;
const avatarDialogSrc = chatInfo.avatar;

if (!conversationId) {
return <div>empty</div>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const SourceDetailPage = () => {
];
}, [detail, runSchedule]);

const { addLoading, handleAddOk } = useAddDataSource({isEdit:true});
const { addLoading, handleAddOk } = useAddDataSource({ isEdit: true });

const onSubmit = useCallback(() => {
formRef?.current?.submit();
Expand Down
5 changes: 3 additions & 2 deletions web/src/pages/user-setting/data-source/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { useSetModalState } from '@/hooks/common-hooks';
import { useGetPaginationWithRouter } from '@/hooks/logic-hooks';
import dataSourceService, {
dataSourceRebuild,
dataSourceResume, dataSourceUpdate,
dataSourceResume,
dataSourceUpdate,
deleteDataSource,
featchDataSourceDetail,
getDataSourceLogs,
Expand Down Expand Up @@ -68,7 +69,7 @@ export const useListDataSource = () => {
return { list, categorizedList: updatedDataSourceTemplates, isFetching };
};

export const useAddDataSource = ({isEdit=false}:{isEdit?:boolean} ) => {
export const useAddDataSource = ({ isEdit = false }: { isEdit?: boolean }) => {
const [addSource, setAddSource] = useState<IDataSorceInfo | undefined>(
undefined,
);
Expand Down
Loading