dedupe canvas agent model entry
This commit is contained in:
parent
14ee1cfdaa
commit
76c684ff82
@ -2724,10 +2724,11 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
|
|||||||
allModels.filter(
|
allModels.filter(
|
||||||
(model) =>
|
(model) =>
|
||||||
model.id !== "auto" &&
|
model.id !== "auto" &&
|
||||||
|
model.id !== modelsData?.agentModel?.id &&
|
||||||
model.isMultimodal &&
|
model.isMultimodal &&
|
||||||
!VIDEO_PROVIDER_TYPES.has(model.providerType)
|
!VIDEO_PROVIDER_TYPES.has(model.providerType)
|
||||||
),
|
),
|
||||||
[allModels]
|
[allModels, modelsData?.agentModel?.id]
|
||||||
);
|
);
|
||||||
const videoOnlyModels = useMemo(
|
const videoOnlyModels = useMemo(
|
||||||
() => visualModels.filter((model) => VIDEO_PROVIDER_TYPES.has(model.providerType)),
|
() => visualModels.filter((model) => VIDEO_PROVIDER_TYPES.has(model.providerType)),
|
||||||
@ -2775,7 +2776,6 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
|
|||||||
SMART_AUTO_MODEL;
|
SMART_AUTO_MODEL;
|
||||||
const agentDisplayName =
|
const agentDisplayName =
|
||||||
currentModel?.displayName || selectDisplayModel?.displayName || "Agent模式";
|
currentModel?.displayName || selectDisplayModel?.displayName || "Agent模式";
|
||||||
const agentAvatarUrl = currentModel?.avatarUrl || selectDisplayModel?.avatarUrl || null;
|
|
||||||
const videoFrameSlots = useMemo(() => {
|
const videoFrameSlots = useMemo(() => {
|
||||||
if (!isVideoModel || !videoParams) return [] as string[];
|
if (!isVideoModel || !videoParams) return [] as string[];
|
||||||
if (videoParams.mode === "first-last-frame") return ["首帧", "尾帧"] as string[];
|
if (videoParams.mode === "first-last-frame") return ["首帧", "尾帧"] as string[];
|
||||||
@ -8857,31 +8857,6 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-2 flex-shrink-0">
|
<div className="flex items-center gap-2 flex-shrink-0">
|
||||||
{activeComposerMode === "agent" ? (
|
|
||||||
<div
|
|
||||||
className="h-8 w-8 overflow-hidden rounded-full border border-[#cfd4dc] bg-white flex items-center justify-center"
|
|
||||||
title={agentDisplayName}
|
|
||||||
aria-label={agentDisplayName}
|
|
||||||
>
|
|
||||||
{agentAvatarUrl ? (
|
|
||||||
<img
|
|
||||||
src={buildPreviewImageUrl(agentAvatarUrl, 64)}
|
|
||||||
alt={agentDisplayName}
|
|
||||||
className="h-full w-full object-cover"
|
|
||||||
loading="lazy"
|
|
||||||
decoding="async"
|
|
||||||
onError={(event) => {
|
|
||||||
if (event.currentTarget.src !== agentAvatarUrl) {
|
|
||||||
event.currentTarget.src = agentAvatarUrl;
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<Sparkles className="h-4 w-4 text-[#8b95a7]" />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
|
|
||||||
{activeComposerMode === "image" ? (
|
{activeComposerMode === "image" ? (
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user