fix: chat compare switch model meta

This commit is contained in:
jialin
2025-12-26 17:29:36 +08:00
parent a006263e51
commit 5b5b2c6364
3 changed files with 72 additions and 76 deletions
@@ -14,6 +14,7 @@ interface ActiveModelsProps {
const ActiveModels: React.FC<ActiveModelsProps> = (props) => {
const { spans, modelSelections, setModelRefs } = props;
return (
<Row gutter={[16, 0]} style={{ height: '100%' }}>
{modelSelections.map((model, index) => (
@@ -21,7 +22,8 @@ const ActiveModels: React.FC<ActiveModelsProps> = (props) => {
span={spans.span}
key={`${model.value || 'empty'}-${model.uid}`}
style={{
height: spans.count < 4 ? 'calc(100% - 16px)' : 'calc(50% - 16px)'
height: spans.count < 4 ? 'calc(100% - 16px)' : 'calc(50% - 16px)',
overflow: 'hidden'
}}
>
<ModelItem
@@ -47,7 +47,8 @@ interface ModelItemProps {
}
const ModelItem: React.FC<ModelItemProps> = forwardRef((props, ref) => {
const { modelList, model, instanceId } = props;
const { modelList, ...restProps } = props;
const { model, instanceId } = restProps;
const {
globalParams,
setGlobalParams,
@@ -66,14 +67,20 @@ const ModelItem: React.FC<ModelItemProps> = forwardRef((props, ref) => {
paramsConfig,
initialValues,
parameters
} = useInitLLmMeta(props, {
defaultValues: {
...llmInitialValues,
model: model
} = useInitLLmMeta(
{
...restProps,
modelList: modelFullList
},
defaultParamsConfig: ChatParamsConfig,
metaKeys: LLM_METAKEYS
});
{
defaultValues: {
...llmInitialValues,
model: model
},
defaultParamsConfig: ChatParamsConfig,
metaKeys: LLM_METAKEYS
}
);
const intl = useIntl();
const isApplyToAllModels = useRef(false);
const [systemMessage, setSystemMessage] = useState<string>('');