RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
fix: Error on chat api,<BadRequestKeyError '400: Bad Request'> #1918 (#1923)
balibabub75115264dbf
diff --git a/web/src/components/api-service/hooks.ts b/web/src/components/api-service/hooks.tsindex 4ca1b37a9a..d93eab2dba 100644--- a/web/src/components/api-service/hooks.ts+++ b/web/src/components/api-service/hooks.ts@@ -1,6 +1,5 @@import {useCreateNextToken,- useFetchNextStats,useFetchTokenList,useRemoveNextToken,} from '@/hooks/chat-hooks';@@ -10,6 +9,7 @@ import {useTranslate,} from '@/hooks/common-hooks';import { IStats } from '@/interfaces/database/chat';+import { useQueryClient } from '@tanstack/react-query';import { message } from 'antd';import { useCallback } from 'react';@@ -46,7 +46,9 @@ type ChartStatsType = {};export const useSelectChartStatsList = (): ChartStatsType => {- const { data: stats } = useFetchNextStats();+ const queryClient = useQueryClient();+ const data = queryClient.getQueriesData({ queryKey: ['fetchStats'] });+ const stats: IStats = data[0][1] as IStats;return Object.keys(stats).reduce((pre, cur) => {const item = stats[cur as keyof IStats];diff --git a/web/src/hooks/chat-hooks.ts b/web/src/hooks/chat-hooks.tsindex 84089f0eae..93a5f6304e 100644--- a/web/src/hooks/chat-hooks.ts+++ b/web/src/hooks/chat-hooks.ts@@ -260,8 +260,8 @@ const getDay = (date?: Dayjs) => date?.format('YYYY-MM-DD');export const useFetchNextStats = () => {const [pickerValue, setPickerValue] = useState<RangeValue>([- dayjs(),dayjs().subtract(7, 'day'),+ dayjs(),]);const { data, isFetching: loading } = useQuery<IStats>({queryKey: ['fetchStats', pickerValue],