fix(chat): remove aggregated default model option
parent
d6b416f5e7
commit
4a2578121a
|
|
@ -97,6 +97,10 @@ export default function ChatPage() {
|
||||||
}
|
}
|
||||||
const a = await AgentAPI.detail(id);
|
const a = await AgentAPI.detail(id);
|
||||||
setAgent(a);
|
setAgent(a);
|
||||||
|
const firstModel = parseAgentModels(a.model)[0];
|
||||||
|
if (firstModel) {
|
||||||
|
setOverrides((o) => ({ ...o, model: o.model || firstModel }));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadAgentList = async () => {
|
const loadAgentList = async () => {
|
||||||
|
|
@ -404,15 +408,6 @@ export default function ChatPage() {
|
||||||
label: modelName
|
label: modelName
|
||||||
}));
|
}));
|
||||||
const activeModelValue = overrides.model || '';
|
const activeModelValue = overrides.model || '';
|
||||||
const defaultModelLabel = agentModel || '默认模型';
|
|
||||||
const selectedModelKey = activeModelValue || '__default__';
|
|
||||||
const modelSelectOptions = [
|
|
||||||
{
|
|
||||||
value: '__default__',
|
|
||||||
label: defaultModelLabel
|
|
||||||
},
|
|
||||||
...modelOptions
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="chat-shell">
|
<div className="chat-shell">
|
||||||
|
|
@ -650,17 +645,13 @@ export default function ChatPage() {
|
||||||
<div className="chat-input-toolbar">
|
<div className="chat-input-toolbar">
|
||||||
<div className="chat-input-toolbar-left">
|
<div className="chat-input-toolbar-left">
|
||||||
<Select
|
<Select
|
||||||
value={selectedModelKey}
|
value={activeModelValue || undefined}
|
||||||
className="chat-model-select"
|
className="chat-model-select"
|
||||||
popupMatchSelectWidth={false}
|
popupMatchSelectWidth={false}
|
||||||
options={modelSelectOptions}
|
options={modelOptions}
|
||||||
suffixIcon={<DownOutlined className="chat-model-select-arrow" />}
|
suffixIcon={<DownOutlined className="chat-model-select-arrow" />}
|
||||||
onChange={(value) =>
|
placeholder="选择模型"
|
||||||
setOverrides((o) => ({
|
onChange={(value) => setOverrides((o) => ({ ...o, model: String(value) }))}
|
||||||
...o,
|
|
||||||
model: value === '__default__' ? undefined : String(value)
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Upload
|
<Upload
|
||||||
|
|
|
||||||
|
|
@ -601,6 +601,7 @@ body {
|
||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
padding: 0 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-model-select .ant-select-selection-placeholder {
|
.chat-model-select .ant-select-selection-placeholder {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue