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

View File

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