mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-05 01:55:05 +08:00
### What problem does this PR solve? Feat: Translate the fields of the parsing operator #9869 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
26 lines
768 B
TypeScript
26 lines
768 B
TypeScript
import { LlmModelType } from '@/constants/knowledge';
|
|
import { useComposeLlmOptionsByModelTypes } from '@/hooks/llm-hooks';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { SelectWithSearch } from '../originui/select-with-search';
|
|
import { RAGFlowFormItem } from '../ragflow-form';
|
|
|
|
type LLMFormFieldProps = {
|
|
options?: any[];
|
|
name?: string;
|
|
};
|
|
|
|
export function LLMFormField({ options, name }: LLMFormFieldProps) {
|
|
const { t } = useTranslation();
|
|
|
|
const modelOptions = useComposeLlmOptionsByModelTypes([
|
|
LlmModelType.Chat,
|
|
LlmModelType.Image2text,
|
|
]);
|
|
|
|
return (
|
|
<RAGFlowFormItem name={name || 'llm_id'} label={t('chat.model')}>
|
|
<SelectWithSearch options={options || modelOptions}></SelectWithSearch>
|
|
</RAGFlowFormItem>
|
|
);
|
|
}
|