fix: fetch llm list by @tanstack/react-query #1306 (#1708)

### What problem does this PR solve?

fix: fetch llm list by @tanstack/react-query #1306

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-07-25 18:06:39 +08:00
committed by GitHub
parent a99d19bdea
commit 375f621405
10 changed files with 170 additions and 207 deletions

View File

@ -2,7 +2,7 @@ import {
useFetchKnowledgeBaseConfiguration,
useUpdateKnowledge,
} from '@/hooks/knowledge-hooks';
import { useFetchLlmList, useSelectLlmOptions } from '@/hooks/llm-hooks';
import { useSelectLlmOptions } from '@/hooks/llm-hooks';
import { useNavigateToDataset } from '@/hooks/route-hook';
import {
useFetchTenantInfo,
@ -17,7 +17,6 @@ import { Form, UploadFile } from 'antd';
import { FormInstance } from 'antd/lib';
import pick from 'lodash/pick';
import { useCallback, useEffect } from 'react';
import { LlmModelType } from '../../constant';
export const useSubmitKnowledgeConfiguration = (form: FormInstance) => {
const { saveKnowledgeConfiguration, loading } = useUpdateKnowledge();
@ -46,7 +45,6 @@ export const useFetchKnowledgeConfigurationOnMount = (form: FormInstance) => {
useFetchTenantInfo();
const { data: knowledgeDetails } = useFetchKnowledgeBaseConfiguration();
useFetchLlmList(LlmModelType.Embedding);
useEffect(() => {
const fileList: UploadFile[] = getUploadFileListFromBase64(