mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-04-22 22:20:07 +08:00
### What problem does this PR solve? Fix: New user can't accept invite without configuring LLM API #4379 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
2a07eb69a7
commit
c1d71e9a3f
@ -508,7 +508,7 @@ export const useSelectItem = (defaultId?: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const useFetchModelId = () => {
|
export const useFetchModelId = () => {
|
||||||
const { data: tenantInfo } = useFetchTenantInfo();
|
const { data: tenantInfo } = useFetchTenantInfo(true);
|
||||||
|
|
||||||
return tenantInfo?.llm_id ?? '';
|
return tenantInfo?.llm_id ?? '';
|
||||||
};
|
};
|
||||||
|
@ -46,7 +46,9 @@ export const useFetchUserInfo = (): ResponseGetType<IUserInfo> => {
|
|||||||
return { data, loading };
|
return { data, loading };
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useFetchTenantInfo = (): ResponseGetType<ITenantInfo> => {
|
export const useFetchTenantInfo = (
|
||||||
|
showEmptyModelWarn = false,
|
||||||
|
): ResponseGetType<ITenantInfo> => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { data, isFetching: loading } = useQuery({
|
const { data, isFetching: loading } = useQuery({
|
||||||
queryKey: ['tenantInfo'],
|
queryKey: ['tenantInfo'],
|
||||||
@ -58,7 +60,10 @@ export const useFetchTenantInfo = (): ResponseGetType<ITenantInfo> => {
|
|||||||
// llm_id is chat_id
|
// llm_id is chat_id
|
||||||
// asr_id is speech2txt
|
// asr_id is speech2txt
|
||||||
const { data } = res;
|
const { data } = res;
|
||||||
if (isEmpty(data.embd_id) || isEmpty(data.llm_id)) {
|
if (
|
||||||
|
showEmptyModelWarn &&
|
||||||
|
(isEmpty(data.embd_id) || isEmpty(data.llm_id))
|
||||||
|
) {
|
||||||
Modal.warning({
|
Modal.warning({
|
||||||
title: t('common.warn'),
|
title: t('common.warn'),
|
||||||
content: (
|
content: (
|
||||||
@ -90,7 +95,7 @@ export const useSelectParserList = (): Array<{
|
|||||||
value: string;
|
value: string;
|
||||||
label: string;
|
label: string;
|
||||||
}> => {
|
}> => {
|
||||||
const { data: tenantInfo } = useFetchTenantInfo();
|
const { data: tenantInfo } = useFetchTenantInfo(true);
|
||||||
|
|
||||||
const parserList = useMemo(() => {
|
const parserList = useMemo(() => {
|
||||||
const parserArray: Array<string> = tenantInfo?.parser_ids?.split(',') ?? [];
|
const parserArray: Array<string> = tenantInfo?.parser_ids?.split(',') ?? [];
|
||||||
|
@ -11,7 +11,7 @@ import styles from './index.less';
|
|||||||
|
|
||||||
const AssistantSetting = ({ show, form }: ISegmentedContentProps) => {
|
const AssistantSetting = ({ show, form }: ISegmentedContentProps) => {
|
||||||
const { t } = useTranslate('chat');
|
const { t } = useTranslate('chat');
|
||||||
const { data } = useFetchTenantInfo();
|
const { data } = useFetchTenantInfo(true);
|
||||||
|
|
||||||
const normFile = (e: any) => {
|
const normFile = (e: any) => {
|
||||||
if (Array.isArray(e)) {
|
if (Array.isArray(e)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user