Fix: After saving the model parameters of the chat page, the parameter disappears. #11500 (#11501)

### What problem does this PR solve?

Fix: After saving the model parameters of the chat page, the parameter
disappears. #11500

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2025-11-25 11:17:13 +08:00
committed by GitHub
parent 41665b0865
commit 6987e9f23b
2 changed files with 7 additions and 2 deletions

View File

@ -28,6 +28,7 @@ import { useHandleFreedomChange } from './use-watch-change';
interface LlmSettingFieldItemsProps {
prefix?: string;
options?: any[];
llmId?: string;
showFields?: Array<
| 'temperature'
| 'top_p'
@ -73,6 +74,7 @@ export function LlmSettingFieldItems({
'frequency_penalty',
'max_tokens',
],
llmId,
}: LlmSettingFieldItemsProps) {
const form = useFormContext();
const { t } = useTranslate('chat');
@ -131,7 +133,7 @@ export function LlmSettingFieldItems({
<div className="space-y-5">
<LLMFormField
options={options}
name={getFieldWithPrefix('llm_id')}
name={llmId ?? getFieldWithPrefix('llm_id')}
></LLMFormField>
<FormField
control={form.control}

View File

@ -3,7 +3,10 @@ import { LlmSettingFieldItems } from '@/components/llm-setting-items/next';
export function ChatModelSettings() {
return (
<div className="space-y-8">
<LlmSettingFieldItems prefix="llm_setting"></LlmSettingFieldItems>
<LlmSettingFieldItems
prefix="llm_setting"
llmId="llm_id"
></LlmSettingFieldItems>
</div>
);
}