mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-25 16:26:51 +08:00
### What problem does this PR solve? Fixes: Fixed model provider issues and improved some features - Removed the old login page - Updated model provider icons - Added RAPTOR modification range parameter ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -19,6 +19,7 @@ import {
|
||||
FormMessage,
|
||||
} from '../ui/form';
|
||||
import { ExpandedInput } from '../ui/input';
|
||||
import { Radio } from '../ui/radio';
|
||||
import { Textarea } from '../ui/textarea';
|
||||
|
||||
export const excludedParseMethods = [
|
||||
@ -111,6 +112,38 @@ const RaptorFormFields = ({
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={'parser_config.raptor.scope'}
|
||||
render={({ field }) => {
|
||||
return (
|
||||
<FormItem className=" items-center space-y-0 ">
|
||||
<div className="flex items-start">
|
||||
<FormLabel
|
||||
tooltip={t('generationScopeTip')}
|
||||
className="text-sm whitespace-nowrap w-1/4"
|
||||
>
|
||||
{t('generationScope')}
|
||||
</FormLabel>
|
||||
<div className="w-3/4">
|
||||
<FormControl>
|
||||
<Radio.Group {...field}>
|
||||
<div className={'flex gap-4 w-full text-text-secondary '}>
|
||||
<Radio value="dataset">{t('scopeDataset')}</Radio>
|
||||
<Radio value="file">{t('scopeSingleFile')}</Radio>
|
||||
</div>
|
||||
</Radio.Group>
|
||||
</FormControl>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex pt-1">
|
||||
<div className="w-1/4"></div>
|
||||
<FormMessage />
|
||||
</div>
|
||||
</FormItem>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
{useRaptor && (
|
||||
<div className="space-y-3">
|
||||
<FormField
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
import { IconMap } from '@/constants/llm';
|
||||
import { IconMap, LLMFactory } from '@/constants/llm';
|
||||
import { cn } from '@/lib/utils';
|
||||
import Icon, { UserOutlined } from '@ant-design/icons';
|
||||
import { IconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
||||
import { Avatar } from 'antd';
|
||||
import { AvatarSize } from 'antd/es/avatar/AvatarContext';
|
||||
import { useMemo } from 'react';
|
||||
import { IconFontFill } from './icon-font';
|
||||
import { useIsDarkTheme } from './theme-provider';
|
||||
|
||||
const importAll = (requireContext: __WebpackModuleApi.RequireContext) => {
|
||||
@ -61,15 +63,45 @@ export const LlmIcon = ({
|
||||
size?: AvatarSize;
|
||||
imgClass?: string;
|
||||
}) => {
|
||||
const icon = IconMap[name as keyof typeof IconMap];
|
||||
const isDark = useIsDarkTheme();
|
||||
const themeIcons = [
|
||||
LLMFactory.FishAudio,
|
||||
LLMFactory.TogetherAI,
|
||||
LLMFactory.Meituan,
|
||||
];
|
||||
let icon = useMemo(() => {
|
||||
const icontemp = IconMap[name as keyof typeof IconMap];
|
||||
if (themeIcons.includes(name as LLMFactory)) {
|
||||
if (isDark) {
|
||||
return icontemp + '-dark';
|
||||
} else {
|
||||
return icontemp + '-bright';
|
||||
}
|
||||
}
|
||||
return icontemp;
|
||||
}, [name, isDark]);
|
||||
|
||||
const svgIcons = [
|
||||
LLMFactory.LocalAI,
|
||||
// LLMFactory.VolcEngine,
|
||||
LLMFactory.MiniMax,
|
||||
LLMFactory.Gemini,
|
||||
LLMFactory.StepFun,
|
||||
// LLMFactory.DeerAPI,
|
||||
];
|
||||
if (svgIcons.includes(name as LLMFactory)) {
|
||||
return (
|
||||
<SvgIcon
|
||||
name={`llm/${icon}`}
|
||||
width={width}
|
||||
height={height}
|
||||
imgClass={imgClass}
|
||||
></SvgIcon>
|
||||
);
|
||||
}
|
||||
|
||||
return icon ? (
|
||||
<SvgIcon
|
||||
name={`llm/${icon}`}
|
||||
width={width}
|
||||
height={height}
|
||||
imgClass={imgClass}
|
||||
></SvgIcon>
|
||||
<IconFontFill name={icon} className={cn('size-8', imgClass)} />
|
||||
) : (
|
||||
<Avatar shape="square" size={size} icon={<UserOutlined />} />
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user