From b057d5249912ced5c7fbcb6f421b677eec2505fb Mon Sep 17 00:00:00 2001 From: jialin Date: Fri, 17 Apr 2026 19:32:31 +0800 Subject: [PATCH] fix: switch model do not work in chat --- src/pages/playground/chat/single-chat.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pages/playground/chat/single-chat.tsx b/src/pages/playground/chat/single-chat.tsx index 54be9df2..84ab7ae8 100644 --- a/src/pages/playground/chat/single-chat.tsx +++ b/src/pages/playground/chat/single-chat.tsx @@ -48,7 +48,7 @@ const GroundLeft: React.FC = forwardRef((props, ref) => { messageList, loading } = useChatCompletion(scroller); - const { handleOnValuesChange, formRef, paramsConfig, parameters } = + const { handleOnValuesChange, formRef, setParams, paramsConfig, parameters } = useInitLLmMeta( { modelList, isChat: true }, { @@ -57,7 +57,7 @@ const GroundLeft: React.FC = forwardRef((props, ref) => { metaKeys: LLM_METAKEYS } ); - + console.log('parameters', parameters); useImperativeHandle(ref, () => { return { viewCode() { @@ -75,6 +75,7 @@ const GroundLeft: React.FC = forwardRef((props, ref) => { ? [{ role: Roles.System, content: systemMessage }] : []; const list = generateMessagesByListContent([...messageList]); + console.log('viewCodeContent+++', parameters); return generateLLMCode({ api: CHAT_API, parameters: { @@ -102,6 +103,13 @@ const GroundLeft: React.FC = forwardRef((props, ref) => { }); }; + const handleOnModelChange = (model: string) => { + setParams({ + ...formRef.current?.getFieldsValue(), + model + }); + }; + const handleCloseViewCode = () => { setShow(false); }; @@ -169,6 +177,7 @@ const GroundLeft: React.FC = forwardRef((props, ref) => {