mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-21 21:36:42 +08:00
Feat: Fixed the chat model setting echo issue (#9521)
### What problem does this PR solve? Feat: Fixed the chat model setting echo issue ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -30,3 +30,22 @@ export const removeUselessFieldsFromValues = (values: any, prefix?: string) => {
|
||||
export function buildOptions(data: Record<string, any>) {
|
||||
return Object.values(data).map((val) => ({ label: val, value: val }));
|
||||
}
|
||||
|
||||
export function setLLMSettingEnabledValues(
|
||||
initialLlmSetting?: Record<string, any>,
|
||||
) {
|
||||
const values = Object.keys(variableEnabledFieldMap).reduce<
|
||||
Record<string, boolean>
|
||||
>((pre, field) => {
|
||||
pre[field] =
|
||||
initialLlmSetting === undefined
|
||||
? false
|
||||
: !!initialLlmSetting[
|
||||
variableEnabledFieldMap[
|
||||
field as keyof typeof variableEnabledFieldMap
|
||||
]
|
||||
];
|
||||
return pre;
|
||||
}, {});
|
||||
return values;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user