mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-08 08:28:02 +08:00
Feat: The translation model type options should be consistent with the model's labels. #1036 (#12537)
### What problem does this PR solve? Feat: The translation model type options should be consistent with the model's labels. #1036 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { SwitchLogicOperator } from '@/constants/agent';
|
||||
import { buildOptions } from '@/utils/form';
|
||||
import { useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export function useBuildSwitchLogicOperatorOptions() {
|
||||
@@ -10,3 +11,21 @@ export function useBuildSwitchLogicOperatorOptions() {
|
||||
'flow.switchLogicOperatorOptions',
|
||||
);
|
||||
}
|
||||
|
||||
export function useBuildModelTypeOptions() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const buildModelTypeOptions = useCallback(
|
||||
(list: string[]) => {
|
||||
return list.map((x) => ({
|
||||
value: x,
|
||||
label: t(`setting.modelTypes.${x}`),
|
||||
}));
|
||||
},
|
||||
[t],
|
||||
);
|
||||
|
||||
return {
|
||||
buildModelTypeOptions,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user